cls(...args: unknown[]): string
Combines class specifiers into a single class string, for use in class
attributes in HTML or JSX.
Each argument will be transformed as follows:
- Strings will be included as-is.
- Boolean values will be ignored (
condition && 'class'
). - Null and undefined values will be ignored.
- Arrays will be flattened.
- Objects will have their keys included if the value is truthy.
- Functions will be called with no arguments, and the result will be processed as above.
- All other values will be ignored.