Skip to content
PixiKit

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
NameTypeDefaultDescription
titlestringRequiredThe name of the setting.
descriptionstringNoneA 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.
childrenReactNodeNoneThe control itself, when `control` is `custom`.
checkedbooleanNoneThe switch state, when you hold it. Update it in the handler, or once the promise settles.
defaultCheckedbooleanfalseThe switch state at first, when the row holds it.
onCheckedChange(next: boolean) => void | Promise<void>NoneCalled with the next switch state. A promise puts the row in a pending state and a rejection rolls the change back.
actionLabelstring"Change"The text of the button or link.
onAction() => void | Promise<void>NoneCalled when the button or link is used. A promise shows a spinner, a rejection shows the error line.
valuestringNoneThe saved text of the field, when you hold it.
defaultValuestring""The text of the field at first.
onSubmit(value: string) => void | Promise<void>NoneCalled with the text when the field is submitted.
inputLabelstringNoneThe name of the field for screen readers. Default: the title.
placeholderstringNoneHint shown in the empty field.
submitLabelstring"Save"The text of the field's submit button.
tone"default" | "danger""default"`danger` is for destructive settings: the button turns red.
confirmstringNoneWhen set, the button first asks "Are you sure?" with this text on the Confirm button.
undoablebooleanfalseAfter a switch change a short "Saved. Undo" note appears.
detailReactNodeNoneA 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.
disabledbooleanfalseTurns the control off.
classNamestringNone

More forms blocks in Pro

View all

Related