Prodular UI

Inputs

Switch

Turns a setting on or off immediately, like a light switch.

npx prodular-ui add switch

Settings list

Round robin across agents who are online.

Customers can reopen them by replying.

Available on the Scale plan.

Sizes

Anatomy

<Field orientation="horizontal">  <FieldContent>    <FieldLabel>Auto-assign new tickets</FieldLabel>    <FieldDescription>Round robin across agents who are online.</FieldDescription>  </FieldContent>  <Switch defaultChecked /></Field>

Guidance

Use it when

  • Settings that take effect as soon as they change, with no save button.

Avoid

  • Choices inside a form that is saved later. Use Checkbox.
  • Labels that describe both states (On or off). Name the setting instead.

Rules for AI agents

Published in llms-full.txt and the registry, so coding agents follow them when they build with this component.

  • Place it in Field orientation="horizontal" with FieldContent (label and description) first and the Switch last, so switches line up on the right.
  • Save the change right away and show a toast if it fails. Do not wait for a submit button.
  • Use size sm only in dense tables and toolbars.

API

Switch

PropTypeDefaultDescription
checked / defaultCheckedbooleanControlled or initial state.
onCheckedChange(checked: boolean) => voidCalled when toggled.
size"sm" | "default""default"Track size.