diff options
| author | David Hill <[email protected]> | 2026-01-16 23:43:41 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2026-01-17 00:55:13 +0000 |
| commit | 1250486ddfef6f2db353af4977cd7f4654aaf72f (patch) | |
| tree | 82ca4dbf72b55912684d7fadd35e054b129593d3 /packages/ui/src/components/keybind.tsx | |
| parent | d645e8bbe18a3559d83de4d59c342e3a00ed8822 (diff) | |
| download | opencode-1250486ddfef6f2db353af4977cd7f4654aaf72f.tar.gz opencode-1250486ddfef6f2db353af4977cd7f4654aaf72f.zip | |
feat: add Keybind component for displaying keyboard shortcuts
Diffstat (limited to 'packages/ui/src/components/keybind.tsx')
| -rw-r--r-- | packages/ui/src/components/keybind.tsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/ui/src/components/keybind.tsx b/packages/ui/src/components/keybind.tsx new file mode 100644 index 000000000..a0fa0483f --- /dev/null +++ b/packages/ui/src/components/keybind.tsx @@ -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> + ) +} |
