Shift + Tab
import { Kbd } from "@chakra-ui/react"
const Demo = () => {
return <Kbd>Shift + Tab</Kbd>
}
Usage
import { Kbd } from "@chakra-ui/react"
<Kbd>F12</Kbd>
Examples
Combinations
Render Kbd
to showcase key combinations
ctrl+shift+del
import { HStack, Kbd } from "@chakra-ui/react"
const Demo = () => {
return (
<HStack gap="1">
<Kbd>ctrl</Kbd>+<Kbd>shift</Kbd>+<Kbd>del</Kbd>
</HStack>
)
}
Function Keys
Here's an example of using Kbd
to showcase function keys
āā„ā§ā
import { HStack, Kbd } from "@chakra-ui/react"
const Demo = () => {
return (
<HStack>
<Kbd>ā</Kbd>
<Kbd>ā„</Kbd>
<Kbd>ā§</Kbd>
<Kbd>ā</Kbd>
</HStack>
)
}
Variants
Use the variant
prop to change the appearance of the Kbd
component
Shift + TabShift + TabShift + TabShift + Tab
import { HStack, Kbd } from "@chakra-ui/react"
const Demo = () => {
return (
<HStack gap="4">
<Kbd variant="raised">Shift + Tab</Kbd>
<Kbd variant="outline">Shift + Tab</Kbd>
<Kbd variant="subtle">Shift + Tab</Kbd>
<Kbd variant="plain">Shift + Tab</Kbd>
</HStack>
)
}
Sizes
Use the size
prop to change the size of the Kbd
component
Shift + TabShift + TabShift + Tab
import { HStack, Kbd } from "@chakra-ui/react"
const Demo = () => {
return (
<HStack gap="4">
<Kbd size="sm">Shift + Tab</Kbd>
<Kbd size="md">Shift + Tab</Kbd>
<Kbd size="lg">Shift + Tab</Kbd>
</HStack>
)
}
Within Text
Use Kbd
within text to highlight key combinations
Press F12 to open DevTools
import { Kbd, Text } from "@chakra-ui/react"
const Demo = () => {
return (
<Text>
Press <Kbd>F12</Kbd> to open DevTools
</Text>
)
}
Props
Prop | Default | Type |
---|---|---|
colorPalette | 'gray' | 'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink' | 'accent' The color palette of the component |
variant | 'raised' | 'raised' | 'outline' | 'subtle' | 'plain' The variant of the component |
size | 'md' | 'sm' | 'md' | 'lg' The size of the component |