feat: add Keybind component for displaying keyboard shortcuts

This commit is contained in:
David Hill
2026-01-16 23:43:41 +00:00
parent d645e8bbe1
commit 1250486ddf
3 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import type { ComponentProps, ParentProps } from "solid-js"
export interface KeybindProps extends ParentProps {
class?: string
classList?: ComponentProps<"span">["classList"]
}
export function Keybind(props: KeybindProps) {
return (
<span
data-component="keybind"
classList={{
...(props.classList ?? {}),
[props.class ?? ""]: !!props.class,
}}
>
{props.children}
</span>
)
}