Skip to content

Commit d065a67

Browse files
committed
Improve classNames JS helper example
1 parent ea294f2 commit d065a67

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/jsHelpers/classNames/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ import { classNames } from '@react-ui-org/react-ui';
1616
And use it:
1717

1818
```docoff-react-preview
19+
<docoff-placeholder bordered>Grid item</docoff-placeholder>
1920
<div
2021
className={classNames(
2122
'd-inline-block',
22-
Date.now() > 1609455600 && 'text-warning',
23-
Date.now() > 1622498400 ? 'text-secondary' : null,
23+
true && 'mt-5',
24+
1 && 'ml-5',
25+
'',
26+
false && 'mb-5',
27+
null && 'mb-5',
28+
undefined && 'mb-5',
29+
0 && 'mb-5',
2430
)}
2531
>
2632
{(new Date()).toLocaleDateString()}
2733
</div>
34+
<docoff-placeholder bordered>Grid item</docoff-placeholder>
2835
```

0 commit comments

Comments
 (0)