Ink Theme Switch, animated React component
A dark-mode toggle where the dark version of a settings panel pours out of the switch as a growing ink circle and drains back in when you switch off. The sun pulls in its rays and turns into a crescent moon, and only the component's own panel is themed.
- Pro
- Inputs & Controls
- Spring
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Settings
Notifications
Auto-update
Share analytics
Sam AlvarezPro plan · renews in 12 days
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| defaultDark | boolean | false | Start with the panel dark. Only the component's own panel is themed; the page theme is never touched. |
| onChange | (dark: boolean) => void | — | Called with the new value when the user flips the switch. |
| autoplay | boolean | false | Flips between light and dark every 2.2s until someone touches it. |
| className | string | — | Extra classes for the panel. |