You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-2
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ Almost all Trunx components have a `bulma` prop that accepts:
41
41
42
42
- a string
43
43
- an array of bulma classes
44
-
- an object which keys are bulma classes
44
+
- an object which keys are bulma classes, when value is truthy then the class is added
45
45
- an array of any of the previous
46
46
47
47
You know, Trunx is a Super Sayan because it is written in TypeScript. The `bulma` prop can be autocompleted and typos can be avoided thanks to type checking.
Trunx provides other React components that implement a Bulma element or a Bulma Component. This means that they usually add a related Bulma class. For example `Button`components renders a button tag with the Bulma `button` class. They may have props related to some Bulma class (.e.g. `color`, `size`). Most of the Bulma related props start with `is`, `has` and the prop name is just the camel-case version of its related Bulma class. For example `isRounded` prop corresponds to `is-rounded` Bulma class.
73
+
Trunx provides React components that implement a Bulma element or a Bulma component. This means that they usually add a related Bulma class. For example `Button`component renders a button HTML tag with the Bulma `button` class. They may have props related to some Bulma class (.e.g. `color`, `size`). Most of the Bulma related props start with `is`, `has` and the prop name is just the camel-case version of its related Bulma class. For example `isRounded` prop corresponds to `is-rounded` Bulma class.
74
74
75
75
```tsx
76
76
<Buttoncolor="primary"size="large"isRounded>
@@ -193,6 +193,8 @@ Bulma related:
193
193
194
194
Trunx package provides a utility for conditionally joining CSS classes together.
195
195
196
+
Syntax is similar to [classnames npm package](https://www.npmjs.com/package/classnames).
197
+
196
198
```js
197
199
import { classnames } from"trunx"
198
200
@@ -233,6 +235,15 @@ export function MyButton({
233
235
}
234
236
```
235
237
238
+
Notice that you can use Trunx without React! It can be used with any framework as well as with _Web Components_.
239
+
The _classnames.js_ is only 299 bytes and can be imported directly with
240
+
241
+
```js
242
+
importclassnamesfrom"trunx/classnames"
243
+
```
244
+
245
+
The snippet above will avoid importing the React stuff.
0 commit comments