useTheme
The useTheme
hook allows you to access or modify the theme and mode properties of the Cerberus Design System.
When to use
This hook is ideal for when you need a 'one shot' access or modify the theme or mode properties of the Cerberus Design System.
Usage
When not to use
When you need to access or modify the theme or mode proprties in multiple components, consider using the ThemeProvider family instead.
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. |
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. |