Save 15% on all Justd Blocks
Dark mode

Astro

Want making your Astro project slick with dark mode? Here’s the playbook for getting that moody vibe on lock.

Inline Scripts

Astro supports inline scripts, so we can get localStorage and set the theme.

Loading source code...

Theme Switcher

First, install the justd-icons package.

Make sure you also install the composed components and the required packages for the component to function properly.

And then, add the following code the component where you want to use the theme switcher.

Loading source code...