Skip to content

Day Night Toggle

A theme switch (role switch) where the sun morphs into a moon, the clouds sink and the stars come out, all on springs.

Plan
Pro · commercial license
Dependencies
React only
Props
9 (7 adjustable)

Included in Pro and Lifetime. See pricing

Made with Furin: Pill Nav · Metal Button · Copy Morph

Props

PropTypeDefaultDescription
checkedboolean""Dark mode on (controlled mode).
defaultCheckedbooleanfalseDark mode on mount (uncontrolled mode).
onChange(night: boolean) => void""Called on change; receives true if it ends up night.
sizenumber56Height of the switch, in px (the width is 2.3 times that).
labelstring"Dark mode"Accessible label.
showLabelbooleantrueShows the day or night label below, in monospace.
dayLabelstring"Day"Label for light mode, shown below the switch.
nightLabelstring"Night"Label for dark mode, shown below the switch.
autoplaynumber0Seconds between automatic changes (0 = off; stops on interaction).

Installation

With your license

1Set up the Pro registry once

Pro components aren't on npm or in the public shadcn registry: you install them with your license from Furin's private registry.

Use my license

2Install Day Night Toggle

npx shadcn@latest add @furin-pro/day-night-toggle

Dependencies

React
18 or later
Other libraries
none
License
commercial

Pro components install into your project: the code is yours and there's nothing else to download.

Keep exploring

  • Dock

    Free

    A bar of icons that magnify under the cursor, on glass.

    Navigation

  • A slider (role slider, full keyboard support) that stretches like rubber when dragged past its limits and snaps back with a bounce; the track squashes to preserve volume.

    Navigation