useTheme
Overview
A hook to get the classes for a given key and kwargs. Uses computeds for caching.
If the resolved slot entry declares composes, the referenced slots are resolved first (recursively) and their classes prepended to the result. See the module description for composition semantics and the meta-key naming convention.
Signature
useTheme(componentName, props, context, keyFn)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| componentName | string | yes | The name of the component. |
| props | ThemeProps | yes | The reactive or computed props to pass to the class function. |
| context | any | no | The context to pass if the config or config.class is a function. |
| keyFn | (key: string, kwargs: any) => string | no | A function to modify a key based on kwargs. |
Returns
A function that returns the classes for a given key and kwargs.
Source
client/lib/use/useTheme.js:300