ui icon indicating copy to clipboard operation
ui copied to clipboard

Add Dark Mode Guide for Vite with React

Open CarlosZiegler opened this issue 1 year ago • 8 comments

This PR adds a guide for implementing dark mode in a Vite project with React. The guide includes the following steps:

  1. Creating a theme provider using React's Context API.
  2. Wrapping the root layout with the ThemeProvider.
  3. Adding a mode toggle to switch between light and dark mode.

The guide is intended to be clear and easy to follow, allowing developers to implement dark mode in their Vite and React projects effectively.

Please review and let me know if any changes are required.

PS: Added a GIF but I am not so familiar to put it into MDX when work on github CODESPACES :(

CarlosZiegler avatar Jun 27 '23 20:06 CarlosZiegler

⚠️ No Changeset found

Latest commit: 509fcb6a569f82942f92646f709a377c4c31941f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jun 27 '23 20:06 changeset-bot[bot]

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

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 27 '23 20:06 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2023 3:10pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-template ⬜️ Ignored (Inspect) Aug 3, 2023 3:10pm

vercel[bot] avatar Jun 28 '23 05:06 vercel[bot]

@dan5py updated.

CarlosZiegler avatar Jun 28 '23 05:06 CarlosZiegler

@dan5py updated

CarlosZiegler avatar Jun 28 '23 20:06 CarlosZiegler

@dan5py and @CarlosZiegler , rather than this being on the installation page what if we make the dark mode page similar to instalation page and show tabs for next.js remix and vite dark mode configuration ?

NikharPandya avatar Jun 29 '23 21:06 NikharPandya

@NikharPandya I was thinking the same thing.

dan5py avatar Jun 29 '23 21:06 dan5py

@dan5py I could help to implement that.

NikharPandya avatar Jun 29 '23 21:06 NikharPandya

@dan5py #814 Resolves this pr with a new grid layout (similar to the installation page), we could close this.

NikharPandya avatar Jul 06 '23 03:07 NikharPandya

@dan5py and @CarlosZiegler , rather than this being on the installation page what if we make the dark mode page similar to instalation page and show tabs for next.js remix and vite dark mode configuration ?

Is there a PR open for this? I recommend using the existing next-themes package for the next.js configuration

ap-1 avatar Jul 09 '23 17:07 ap-1

Can we implement the dark mode using react and javascript?

raghavjindalll avatar Feb 15 '24 20:02 raghavjindalll

Can we implement the dark mode using react and javascript?

Here the docs : https://ui.shadcn.com/docs/dark-mode/vite

CarlosZiegler avatar Feb 16 '24 14:02 CarlosZiegler