Shortcut
import { Shortcut, formatShortcut, speakShortcut } from '@hanzo/ui'
No examples yet.
Types
export type ShortcutPlatform = 'mac' | 'other'export type ShortcutKeys = readonly string[] | readonly (readonly string[])[]export type FormatOptions = {
platform?: ShortcutPlatform
/** Between combinations of a sequence. Default "then". */
sequenceJoinLabel?: string
/** Between the keys of one combination. Default none on a Mac, a space elsewhere. */
combinationSeparator?: string
}export type ShortcutProps = Omit<ComponentProps<typeof XStack>, 'children'> & {
keys: ShortcutKeys
/** Default: the platform the page is read on. */
platform?: ShortcutPlatform
/** `keys` draws keycaps; `text` plain text in the surrounding type; `button` the quiet hint inside a Button. */
variant?: 'keys' | 'text' | 'button'
/** `desktop` hides it under a coarse pointer, where there is no keyboard to press it on. */
visibility?: 'always' | 'desktop'
sequenceJoinLabel?: string
combinationSeparator?: string
}Exports
ShortcutformatShortcutspeakShortcuttype ShortcutPropstype ShortcutKeystype ShortcutPlatform