Setting Row
One setting with its explanation and its control. A switch, button, link or small field that shows pending, success, error with Retry, an inline confirm and undo.
pixikit.com/docs/app-ui/forms/setting-row
Customize
Control
Default checked
Tone
Undoable
Layout
Surface
Disabled
Props
23| Name | Type | Default | Description |
|---|---|---|---|
title | string | Required | The name of the setting. |
description | string | None | A line that explains what the setting does. |
control | "switch" | "button" | "link" | "input" | "custom" | "switch" | What the row holds at its end: a switch, a button, a link, a small field or your own content. |
children | ReactNode | None | The control itself, when `control` is `custom`. |
checked | boolean | None | The switch state, when you hold it. Update it in the handler, or once the promise settles. |
defaultChecked | boolean | false | The switch state at first, when the row holds it. |
onCheckedChange | (next: boolean) => void | Promise<void> | None | Called with the next switch state. A promise puts the row in a pending state and a rejection rolls the change back. |
actionLabel | string | "Change" | The text of the button or link. |
onAction | () => void | Promise<void> | None | Called when the button or link is used. A promise shows a spinner, a rejection shows the error line. |
value | string | None | The saved text of the field, when you hold it. |
defaultValue | string | "" | The text of the field at first. |
onSubmit | (value: string) => void | Promise<void> | None | Called with the text when the field is submitted. |
inputLabel | string | None | The name of the field for screen readers. Default: the title. |
placeholder | string | None | Hint shown in the empty field. |
submitLabel | string | "Save" | The text of the field's submit button. |
tone | "default" | "danger" | "default" | `danger` is for destructive settings: the button turns red. |
confirm | string | None | When set, the button first asks "Are you sure?" with this text on the Confirm button. |
undoable | boolean | false | After a switch change a short "Saved. Undo" note appears. |
detail | ReactNode | None | A well under the text, such as the current plan or card. |
layout | "auto" | "stacked" | "inline" | "auto" | `auto` puts the control at the end on wide rows and under the text on narrow ones. |
surface | "plain" | "card" | "well" | "plain" | `plain` has no box, `card` is a bordered card, `well` is a tinted panel. |
disabled | boolean | false | Turns the control off. |
className | string | None |