Preset tile
npx shadcn add @klarhimmel/theme-partsCopy for AIDetailsAbout, usage, props and more
One theme preset as a pressable tile: its page, text and accent swatches, its name and a line on its look. Spread an item of listPresets() into it.
Preview
Preset tile
Import
Import
- Files
- theme-parts.tsx, in components/klarhimmel/ui/. With it: input, theme, utils.
- Render in
- Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | required | The preset and a line on how it looks. |
look | string | - | The preset and a line on how it looks. |
swatches | { canvas: string; ink: string; accent: string } | required | Hex colours of its page, text and accent. |
pressed | boolean | false | The chosen preset. |
onPress | (name: string) => void | - | Called with the preset's name. |
disabled | boolean | - | |
className | string | - | Extra classes, merged after the component's own. |
mode | string | - |