Skip to content


The classNames helper joins all classnames you pass into the function as single classname. It automatically filters out empty strings and values that are not strings, so you can conditionally assemble classnames and classNames function will take care about the single format of classname for you.

Basic Usage

To use classNames helper, you need to import it first:

import { classNames } from '@react-ui-org/react-ui';

And use it:

    'd-inline-block', > 1609455600 && 'text-warning', > 1622498400 ? 'text-secondary' : null,
  {(new Date()).toLocaleDateString()}