{"slug":"shortcut","name":"Shortcut","category":"Display & Misc","summary":"Renders a keyboard combination as key caps.","status":"stable","since":"0.2.0","import":"import { Shortcut } from '@elluzion/iv-ui';","usage":["`keys` accepts a single key or an ordered array.","`label` supplies the accessible name for the combination.","Use inside menus, command palettes, and help panels."],"props":[{"name":"keys","type":"string | string[]","default":null,"description":"Key or keys to display, in order.","required":true,"bindable":false},{"name":"label","type":"string","default":"''","description":"Accessible name for the combination.","required":false,"bindable":false},{"name":"size","type":"'sm' | 'md'","default":"'sm'","description":"Key cap size.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[],"snippets":[],"types":[],"manual":[],"tokens":["--iv_border","--iv_font-mono","--iv_foreground-dim","--iv_leading-none","--iv_radius-sm","--iv_surface-elevated","--iv_text-sm","--iv_text-xs"],"cssHooks":["iv-key","iv-md","iv-root"],"accessibility":{"notes":["The component renders `<kbd>` elements, which assistive technology recognizes.","Pass `label` when the visual key names are symbols rather than words.","Keys are rendered in order; keep the platform convention, such as Control before K."]},"related":[{"title":"Menu","summary":"A vertical list of commands, options, or links.","url":"/components/menu","kind":"Component"},{"title":"Tooltip","summary":"A short label shown on hover or focus.","url":"/components/tooltip","kind":"Component"},{"title":"Badge","summary":"A compact label for status, counts, or categories.","url":"/components/badge","kind":"Component"},{"title":"Button","summary":"Triggers an action or submits a form.","url":"/components/button","kind":"Component"}],"examples":[{"id":"single","title":"Single key","description":"One key cap.","code":"<script lang=\"ts\">\n\timport { Shortcut } from '@elluzion/iv-ui';\n</script>\n\n<p class=\"line\">Press <Shortcut keys=\"Esc\" /> to close the palette.</p>\n\n<style>\n\t.line {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-sm);\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-body);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"combos","title":"Combinations","description":"Modifier keys in order, with the accessible name spelled out.","code":"<script lang=\"ts\">\n\timport { Shortcut } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"stack\">\n\t<p class=\"line\">\n\t\tCommand palette <Shortcut keys={['⌘', 'K']} label=\"Command K\" />\n\t</p>\n\t<p class=\"line\">\n\t\tSearch files <Shortcut keys={['Ctrl', 'Shift', 'P']} label=\"Control Shift P\" />\n\t</p>\n\t<p class=\"line\">\n\t\tToggle sidebar <Shortcut keys={['⌘', 'B']} label=\"Command B\" />\n\t</p>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-md);\n\t}\n\n\t.line {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-sm);\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-body);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"sizes","title":"Sizes","description":"`sm` inside menus, `md` for help panels.","code":"<script lang=\"ts\">\n\timport { Shortcut } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"row\">\n\t<Shortcut keys={['⌘', 'K']} />\n\t<Shortcut keys={['⌘', 'K']} size=\"md\" />\n</div>\n\n<style>\n\t.row {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-lg);\n\t}\n</style>"}],"markdown":"/components/shortcut.md","page":"/components/shortcut"}