Use the default slot to set the value of the Kbd.
<template>
<PKbd>K</PKbd>
</template>
Use the value prop to set the value of the Kbd.
<template>
<PKbd value="K" />
</template>
You can pass special keys to the value prop that goes through the useKbd composable. For example, the meta key displays as ⌘ on macOS and Ctrl on other platforms.
<template>
<PKbd value="meta" />
</template>
Use the color prop to change the color of the Kbd.
<template>
<PKbd color="neutral">K</PKbd>
</template>
Use the variant prop to change the variant of the Kbd.
<template>
<PKbd color="neutral" variant="solid">K</PKbd>
</template>
Use the size prop to change the size of the Kbd.
<template>
<PKbd size="lg">K</PKbd>
</template>
class propUse the class prop to override the base styles of the Badge.
<template>
<PKbd class="akar:font-bold akar:rounded-full" variant="subtle">K</PKbd>
</template>
| Prop | Default | Type |
|---|
| Slot | Type |
|---|
Below is the theme configuration skeleton for the PKbd. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.
export default defineAppConfig({
pohon: {
kbd: {
base: '',
variants: {
color: {
primary: '',
secondary: '',
success: '',
info: '',
warning: '',
error: '',
neutral: ''
},
variant: {
solid: '',
outline: '',
soft: '',
subtle: ''
},
size: {
sm: '',
md: '',
lg: ''
}
},
compoundVariants: [],
defaultVariants: {
variant: 'outline',
color: 'neutral',
size: 'md'
}
}
}
};
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
kbd: {
base: '',
variants: {
color: {
primary: '',
secondary: '',
success: '',
info: '',
warning: '',
error: '',
neutral: ''
},
variant: {
solid: '',
outline: '',
soft: '',
subtle: ''
},
size: {
sm: '',
md: '',
lg: ''
}
},
compoundVariants: [],
defaultVariants: {
variant: 'outline',
color: 'neutral',
size: 'md'
}
}
}
};