import { wrToClassList } from 'ngwr/utils';
wrToClassList('p-4 rounded-xl'); // ['p-4', 'rounded-xl']
wrToClassList(['btn', 'p-4 rounded'], 'x'); // ['btn', 'p-4', 'rounded', 'x']
wrToClassList('a', null, false, ' ', 'a'); // ['a']wrToClassList
Flattens class inputs into a de-duplicated list of single class names.
Usage
Pass your own CDK panelClass through it: the CDK does not split 'a b' and throws.
API
| Name | Description | Type | Default |
|---|---|---|---|
wrToClassList | Splits on whitespace and de-duplicates. Skips false, null, undefined and empty tokens. | (...values: readonly (WrClassInput | false)[]) => string[] | — |
See also
Guide ThemingLoad the theme, switch light and dark, and rebrand the palette.Guide OverlayStyle ngwr's floating panels and control where focus goes.Type Common typesShared type aliases from ngwr/utils.Component DialogOpen any component as a modal dialog and await its result.Component SelectPick one or several values from a list, with search and free-text tags.