shadcn-ui-switch

star 8

Add toggle switches with ShadSwitch and ShadSwitchFormField; label, form validation. Use when adding on/off toggles or switch form fields in a Flutter shadcn_ui app or ShadForm.

serverpod By serverpod schedule Updated 3/7/2026

name: shadcn_ui-switch description: Add toggle switches with ShadSwitch and ShadSwitchFormField; label, form validation. Use when adding on/off toggles or switch form fields in a Flutter shadcn_ui app or ShadForm.

Shadcn UI — Switch

Instructions

ShadSwitch is a control that toggles between checked and unchecked. Use value and onChanged; optional label. For forms use ShadSwitchFormField with id, initialValue, inputLabel, inputSublabel, validator.

Standalone

ShadSwitch(
  value: value,
  onChanged: (v) => setState(() => value = v),
  label: const Text('Airplane Mode'),
)

Form field

ShadSwitchFormField(
  id: 'terms',
  initialValue: false,
  inputLabel: const Text('I accept the terms and conditions'),
  onChanged: (v) {},
  inputSublabel: const Text('You agree to our Terms and Conditions'),
  validator: (v) {
    if (!v) return 'You must accept the terms and conditions';
    return null;
  },
)
Install via CLI
npx skills add https://github.com/serverpod/skills-registry --skill shadcn-ui-switch
Repository Details
star Stars 8
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator