GithubHelp home page GithubHelp logo

gabxyz / next-app-themes Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 671 KB

Next.js starter template with themes support in the new app directory

Home Page: https://next-app-themes.vercel.app

License: MIT License

JavaScript 10.95% TypeScript 87.65% CSS 1.40%
app-directory framer-motion next-themes nextjs radix-ui tailwindcss template typescript vercel

next-app-themes's Introduction

next-app-themes

What is this

This is a basic next.js starter template with themes support in the new app directory.

Check the Live Demo

Main

UI

Plugins

Utilities

Others

Also some custom transitions from Carbon Design System

How does it work

To make next-themes work with the app directory, I basically implemented this solution, commented by @WITS in an issue in the next-themes repository.

This template comes with a providers.tsx component that is used to render ThemeProvider from next-themes using the "use client" directive, which is required for third-party packages in the new app directory. The providers.tsx component is rendered inside the body tag in the root layout.tsx.

There's also a theme-select.tsx component, that uses the useTheme hook to handle theme state and useState hooks for handling display value and animation states. This component was built with radix's dropdown-menu primitive and uses framer-motion for the animations.

Usage

You don't need to use tailwind dark: selectors for dark mode styles, since it's all handled automatically with radix colors and windy-radix-palette. I strongly recommend checking out the radix colors docs, they have detailed palette composition sections that help you understand how to use their color system.

You can also style any radix primitive component using the rdx-*: prefix in tailwind classes. See more in tailwindcss-radix

Run the following command to clone template using pnpm as your package manager

pnpm dlx create-next-app my-app --example "https://github.com/gabxyz/next-app-themes"

Now you can do whatever you want with it.

next-app-themes's People

Contributors

gabxyz avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.