2.1.1 • Published 1 year 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
1 year ago
0.0.0-canary-20241206144245
1 year ago
2.1.0
1 year ago
0.0.0-canary-20241205201328
1 year ago
0.0.0-canary-20241205120225
1 year ago
0.0.0-canary-20241205115555
1 year ago
0.0.0-canary-20241205024636
1 year ago
0.0.0-canary-20241204224020
1 year ago
0.0.0-canary-20241204223333
1 year ago
0.0.0-canary-20241204222550
1 year ago
0.0.0-canary-20241204130109
1 year ago
0.0.0-canary-20241204110242
1 year ago
0.0.0-canary-20241204105441
1 year ago
0.0.0-canary-20241203205233
1 year ago
0.0.0-canary-20241203131244
1 year ago
0.0.0-canary-20241201220710
1 year ago
0.0.0-canary-20241201205643
1 year ago
0.0.0-canary-20241201202446
1 year ago
0.0.0-canary-20241201195108
1 year ago
0.0.0-canary-20241201144422
1 year ago
0.0.0-canary-20241201142842
1 year ago
0.0.0-canary-20241130132200
1 year ago
2.0.1
1 year ago
0.0.0-canary-20241130124528
1 year ago
2.0.1-beta.7
1 year ago
2.0.1-beta.6
1 year ago
2.0.1-beta.5
1 year ago
2.0.1-beta.4
1 year ago
2.0.1-beta.3
1 year ago
2.0.1-beta.2
1 year ago
2.0.1-beta.1
1 year ago
2.0.1-beta.0
1 year ago