@@ -45,10 +45,16 @@ $ yarn add react-semantic-render
45
45
46
46
## Usage
47
47
48
- ** Show**
48
+ ### Show
49
49
50
50
Renders content if ` when ` equals true.
51
51
52
+ | Property | Type | Description
53
+ | ---| ---| ---| ---| ---|
54
+ | ` when ` | boolean | Conditional statement
55
+ | ` render ` | function | Shorthand for primary content
56
+ | ` children ` | node | Primary content
57
+
52
58
``` jsx
53
59
import { Show } from ' react-semantic-render' ;
54
60
@@ -69,10 +75,16 @@ import { Show } from 'react-semantic-render'
69
75
/ >
70
76
```
71
77
72
- ** List**
78
+ ### List
73
79
74
80
Renders content from specified callback function from either ` render ` or ` children ` on each element of ` items ` .
75
81
82
+ | Property | Type | Description
83
+ | ---| ---| ---| ---| ---|
84
+ | ` items ` | any[ ] | Array to map
85
+ | ` render ` | function | Shorthand for primary content
86
+ | ` children ` | node | Primary content
87
+
76
88
``` jsx
77
89
import { List } from ' react-semantic-render'
78
90
@@ -83,10 +95,15 @@ import { List } from 'react-semantic-render'
83
95
< / List>
84
96
```
85
97
86
- ** Switch**
98
+ ### Switch
87
99
88
100
Renders content from first ` Switch.Case ` that matches ` value ` , else ` Switch.Default ` if it exists.
89
101
102
+ | Property | Type | Description
103
+ | ---| ---| ---| ---| ---|
104
+ | ` value ` | boolean | Conditional statement
105
+ | ` children ` | node | Primary content
106
+
90
107
``` jsx
91
108
import { Switch } from ' react-semantic-render'
92
109
@@ -100,10 +117,16 @@ import { Switch } from 'react-semantic-render'
100
117
< / Switch>
101
118
```
102
119
103
- ** ShowIfElse**
120
+ ### ShowIfElse
104
121
105
122
Renders content from if when condition equals true, else renders content from else.
106
123
124
+ | Property | Type | Description
125
+ | ---| ---| ---| ---| ---|
126
+ | ` condition ` | boolean | Conditional statement
127
+ | ` if ` | function | Renders when condition is true
128
+ | ` else ` | function | Renders when condition is false
129
+
107
130
``` jsx
108
131
import { ShowIfElse } from ' react-semantic-render'
109
132
@@ -118,10 +141,14 @@ import { ShowIfElse } from 'react-semantic-render'
118
141
/ >
119
142
```
120
143
121
- ** Hideable**
144
+ ### Hideable
122
145
123
146
Higher order component that injects 'hide' prop into specified component.
124
147
148
+ | Property | Type | Description
149
+ | ---| ---| ---| ---| ---|
150
+ | ` hide ` | boolean | Conditional statement
151
+
125
152
``` jsx
126
153
import { Hideable } from ' react-semantic-render'
127
154
import { Button } from ' ./components'
0 commit comments