You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the Nebula Toggle component—a premium, cosmic theme toggle switch with glowing nebula swirl effects, light/dark transition animations, and local storage state persistence.
Changes
Created apps/www/registry/magicui/nebula-toggle.tsx containing the component source code.
Created apps/www/registry/example/nebula-toggle-demo.tsx for the component preview.
Created apps/www/content/docs/components/nebula-toggle.mdx for documentation and properties reference.
Added sidebar navigation link in apps/www/config/docs.ts.
Registered component and demo metadata in registry-ui.ts and registry-examples.ts.
Generated registry JSON files using the build script.
Motivation
I wanted to add a unique and visually appealing alternative to the standard theme toggle. Nebula Toggle combines smooth light/dark transitions, subtle animations, and a nebula-inspired design to create a more engaging user experience. The component is reusable, customizable, accessible, and ready to use, giving developers another high-quality option for implementing theme switching in their applications.
Thanks @Sahilmd01, love the cosmic look!
But I'll hold off merging — it overlaps with our existing animated-theme-toggler and mutates the global dark class + localStorage, which conflicts with the site's next-themes
A purely presentational checked/onChange switch would be much easier to accept — thanks again! 🙏
Thanks for the review and the kind words! I appreciate the feedback.
That makes sense I overlooked the fact that the component should work with next-themes instead of managing the theme state itself. I'll refactor it into a purely presentational component that accepts checked and onCheckedChange props without touching the global dark class or localStorage.
Thanks again for the guidance!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the Nebula Toggle component—a premium, cosmic theme toggle switch with glowing nebula swirl effects, light/dark transition animations, and local storage state persistence.
Changes
apps/www/registry/magicui/nebula-toggle.tsxcontaining the component source code.apps/www/registry/example/nebula-toggle-demo.tsxfor the component preview.apps/www/content/docs/components/nebula-toggle.mdxfor documentation and properties reference.apps/www/config/docs.ts.registry-ui.tsandregistry-examples.ts.Motivation
I wanted to add a unique and visually appealing alternative to the standard theme toggle. Nebula Toggle combines smooth light/dark transitions, subtle animations, and a nebula-inspired design to create a more engaging user experience. The component is reusable, customizable, accessible, and ready to use, giving developers another high-quality option for implementing theme switching in their applications.
Breaking Changes
None.
Screenshots