Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(components): add ThemeToggle component #6531

Closed
wants to merge 1 commit into from

Conversation

M0HAMEDHANY
Copy link

This PR introduces the ThemeToggle component, which allows users to toggle between light and dark modes. It uses the next-themes library to handle theme changes globally across the app. The component provides customization options for size, variant, and icons, and is designed to integrate seamlessly into the UI.

Changes:

  • Added ThemeToggle component with support for light and dark modes.
  • Wrapping the app with ThemeProvider from next-themes to manage global theme changes.
  • Added options for customizing icon styles, sizes, and variants.

Usage:

  • Import the ThemeToggle component in your project.
  • Ensure the app is wrapped with ThemeProvider for theme management.
  • Use the toggle button to switch between themes.

Example Usage:

import { ThemeToggle } from "@/components/ui/theme-toggle";

export default function Header() {
  return (
    <nav>
      <ThemeToggle />
    </nav>
  );
}

Copy link

vercel bot commented Jan 31, 2025

@M0HAMEDHANY is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@M0HAMEDHANY
Copy link
Author

@shadcn

@M0HAMEDHANY M0HAMEDHANY closed this Feb 2, 2025
@M0HAMEDHANY M0HAMEDHANY deleted the feature/theme-toggle branch February 2, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant