Settings edit row
Business name
Lindqvist Bakery
npx shadcn add @klarhimmel/settingsCopy for AIDetailsAbout, usage, props and more
A row that shows its value and edits it in place: Edit turns it into a field with Save and Cancel; Enter saves, Escape cancels.
Preview
Settings edit row
Import
Import
- Files
- settings.tsx, in components/klarhimmel/ui/. With it: button, card, input, switch, 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 |
|---|---|---|---|
label | ReactNode | required | The row's words. |
description | ReactNode | - | The row's words. |
value | string | required | The saved value. |
placeholder | string | - | Shown when the value is empty. |
onSave | (value: string) => boolean | Promise<boolean> | required | Saves; answers whether it did. |
editLabel | string | 'Edit' | Button words, for another language. |
saveLabel | string | 'Save' | Button words, for another language. |
cancelLabel | string | 'Cancel' | Button words, for another language. |
className | string | - | Extra classes, merged after the component's own. |