useTheme
The useTheme
hook allows you to access or modify the theme and mode properties of the Cerberus Design System.
Usage
API
Arguments
The useTheme
accepts the following optional arguments:
Name | Default | Description |
---|---|---|
defaultTheme | 'cerberus' | The default theme of the Cerberus Design System. |
defaultMode | 'light' | The default mode of the Cerberus Design System. |
Options
The useTheme
hook accepts an optional options
object with the following properties:
Name | Default | Description |
---|---|---|
cache | true | Whether to cache the theme and mode in the local storage. |
updateTheme | A custom function to call when the theme is updated. | |
updateMode | A custom function to call when the mode is updated. |
Return
The useTheme
hook returns an object with the following properties:
Name | Description |
---|---|
theme | The current theme of the Cerberus Design System. |
mode | The current mode of the Cerberus Design System. |
updateTheme | A function that allows you to update the theme of the Cerberus Design System. |
updateMode | A function that allows you to update the mode of the Cerberus Design System. |