2.1.1 • Published 2 years ago
@nextui-org/use-theme v2.1.1
@nextui-org/use-theme
React hook to switch between light and dark themes
Installation
yarn add @nextui-org/use-theme
# or
npm i @nextui-org/use-themeUsage
Import useTheme
import {useTheme} from "@nextui-org/use-theme";theme
// `theme` is the active theme name
// by default, it will use the one in localStorage.
// if it is no such value in localStorage, `light` theme will be used
const {theme} = useTheme();setTheme
You can use any theme name you want, but make sure it exists in your
tailwind.config.js file. See Create Theme for more details.
// set `theme` by using `setTheme`
const {setTheme} = useTheme();
// setting to light theme
setTheme('light')
// setting to dark theme
setTheme('dark')
// setting to purple-dark theme
setTheme('purple-dark')Contribution
Yes please! See the contributing guidelines for details.
License
This project is licensed under the terms of the MIT license.
2.1.1
2 years ago
0.0.0-canary-20241206144245
2 years ago
2.1.0
2 years ago
0.0.0-canary-20241205201328
2 years ago
0.0.0-canary-20241205120225
2 years ago
0.0.0-canary-20241205115555
2 years ago
0.0.0-canary-20241205024636
2 years ago
0.0.0-canary-20241204224020
2 years ago
0.0.0-canary-20241204223333
2 years ago
0.0.0-canary-20241204222550
2 years ago
0.0.0-canary-20241204130109
2 years ago
0.0.0-canary-20241204110242
2 years ago
0.0.0-canary-20241204105441
2 years ago
0.0.0-canary-20241203205233
2 years ago
0.0.0-canary-20241203131244
2 years ago
0.0.0-canary-20241201220710
2 years ago
0.0.0-canary-20241201205643
2 years ago
0.0.0-canary-20241201202446
2 years ago
0.0.0-canary-20241201195108
2 years ago
0.0.0-canary-20241201144422
2 years ago
0.0.0-canary-20241201142842
2 years ago
0.0.0-canary-20241130132200
2 years ago
2.0.1
2 years ago
0.0.0-canary-20241130124528
2 years ago
2.0.1-beta.7
2 years ago
2.0.1-beta.6
2 years ago
2.0.1-beta.5
2 years ago
2.0.1-beta.4
2 years ago
2.0.1-beta.3
2 years ago
2.0.1-beta.2
2 years ago
2.0.1-beta.1
2 years ago
2.0.1-beta.0
2 years ago