Skip to content

Commit

Permalink
Improve classNames JS helper example
Browse files Browse the repository at this point in the history
  • Loading branch information
mbohal committed Jan 30, 2025
1 parent ea294f2 commit d065a67
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/jsHelpers/classNames/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,20 @@ import { classNames } from '@react-ui-org/react-ui';
And use it:

```docoff-react-preview
<docoff-placeholder bordered>Grid item</docoff-placeholder>
<div
className={classNames(
'd-inline-block',
Date.now() > 1609455600 && 'text-warning',
Date.now() > 1622498400 ? 'text-secondary' : null,
true && 'mt-5',
1 && 'ml-5',
'',
false && 'mb-5',
null && 'mb-5',
undefined && 'mb-5',
0 && 'mb-5',
)}
>
{(new Date()).toLocaleDateString()}
</div>
<docoff-placeholder bordered>Grid item</docoff-placeholder>
```

0 comments on commit d065a67

Please sign in to comment.