shadcn.io is not affiliated with official shadcn/ui
Sheet examples · Settings
Theme Settings Sheet for React
A right-side appearance sheet with a Light, Dark or System theme choice and checkboxes for compact mode and animations.
An appearance panel: a radio group picks one theme out of Light, Dark and System, and two checkboxes turn Compact Mode and Enable Animations on or off. Dark is the starting theme. Hook the choice up to your theme provider to apply it.
Preview
Installation
FAQ
How are Light, Dark, and System built?
As a RadioGroup with defaultValue="dark", inside a FieldSet whose FieldLegend reads Theme. Picking one clears the others, which three checkboxes couldn't do.
What are Compact Mode and Enable Animations?
Two checkboxes in horizontal Field rows, label first. Compact Mode starts off and Enable Animations starts on.
Does this sheet store the theme?
No. The radio group and the checkboxes are uncontrolled, and nothing writes the choice anywhere. Control the radio group's value and pass it to your theme provider, and store it if it should survive a reload.
Why is Appearance a SheetTitle?
SheetTitle names the dialog for assistive tech, so every sheet renders one; hide it with sr-only when the design has no visible heading. It reads Appearance, with Customize how the app looks as the description.
Related
- App Preferences SheetA right-side sheet of four app
- Notification Preferences SheetA right-side sheet of notification
- Privacy Settings SheetA right-side sheet of privacy checkboxes
- Basic Radio GroupA vertical radio group of three options
- Simple CheckboxA checkbox with a label for a single
- User Profile Edit SheetA right-side sheet for editing a username