API reference
props
API reference for the `props` function
The css.props()
function returns styleObject
as hashedClassName
together while filtering out falsy values like undefined
, false
, or null
. It is useful when conditionally combining styles.
💡 className will be something like "one_ocpc7u two_ocpc7u"
Only truthy values are preserved.
Usage Patterns
Conditional styles
With ternary
Return value
Returns a single string of space-separated styleObject, ignoring falsy inputs:
See Also
Good to know
Since falsy values are filtered out, you can use logical and, ternary operators, etc. in argument expressions.