@patternfly/react-core 4.198.14 → 4.198.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/esm/components/Form/FormFieldGroup.d.ts +1 -1
- package/dist/esm/components/Form/FormFieldGroupExpandable.d.ts +2 -2
- package/dist/esm/components/Form/FormFieldGroupHeader.d.ts +3 -1
- package/dist/esm/components/Form/FormFieldGroupHeader.d.ts.map +1 -1
- package/dist/esm/components/Form/FormFieldGroupHeader.js.map +1 -1
- package/dist/esm/components/Form/InternalFormFieldGroup.d.ts +2 -2
- package/dist/esm/components/Tabs/Tab.d.ts +3 -1
- package/dist/esm/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/esm/components/Tabs/Tab.js +4 -3
- package/dist/esm/components/Tabs/Tab.js.map +1 -1
- package/dist/esm/components/Tabs/TabButton.d.ts +2 -0
- package/dist/esm/components/Tabs/TabButton.d.ts.map +1 -1
- package/dist/esm/components/Tabs/TabButton.js +2 -2
- package/dist/esm/components/Tabs/TabButton.js.map +1 -1
- package/dist/esm/components/Tile/Tile.d.ts.map +1 -1
- package/dist/esm/components/Tile/Tile.js +1 -1
- package/dist/esm/components/Tile/Tile.js.map +1 -1
- package/dist/js/components/Form/FormFieldGroup.d.ts +1 -1
- package/dist/js/components/Form/FormFieldGroupExpandable.d.ts +2 -2
- package/dist/js/components/Form/FormFieldGroupHeader.d.ts +3 -1
- package/dist/js/components/Form/FormFieldGroupHeader.d.ts.map +1 -1
- package/dist/js/components/Form/FormFieldGroupHeader.js.map +1 -1
- package/dist/js/components/Form/InternalFormFieldGroup.d.ts +2 -2
- package/dist/js/components/Tabs/Tab.d.ts +3 -1
- package/dist/js/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/js/components/Tabs/Tab.js +4 -3
- package/dist/js/components/Tabs/Tab.js.map +1 -1
- package/dist/js/components/Tabs/TabButton.d.ts +2 -0
- package/dist/js/components/Tabs/TabButton.d.ts.map +1 -1
- package/dist/js/components/Tabs/TabButton.js +2 -2
- package/dist/js/components/Tabs/TabButton.js.map +1 -1
- package/dist/js/components/Tile/Tile.d.ts.map +1 -1
- package/dist/js/components/Tile/Tile.js +1 -1
- package/dist/js/components/Tile/Tile.js.map +1 -1
- package/dist/umd/react-core.js +6 -6
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Form/FormFieldGroup.tsx +1 -1
- package/src/components/Form/FormFieldGroupExpandable.tsx +2 -2
- package/src/components/Form/FormFieldGroupHeader.tsx +5 -1
- package/src/components/Form/InternalFormFieldGroup.tsx +2 -2
- package/src/components/Form/__tests__/FormFieldGroup.test.tsx +1 -1
- package/src/components/Form/__tests__/__snapshots__/FormFieldGroup.test.tsx.snap +1 -1
- package/src/components/Form/examples/Form.md +1 -1
- package/src/components/Tabs/Tab.tsx +31 -24
- package/src/components/Tabs/TabButton.tsx +5 -1
- package/src/components/Tabs/examples/Tabs.md +527 -256
- package/src/components/Tile/Tile.tsx +3 -0
- package/src/components/Tile/__tests__/__snapshots__/Tile.test.tsx.snap +9 -0
- package/src/components/Tile/examples/Tile.md +41 -39
- package/src/demos/TileDemo.md +17 -35
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
id: Tabs
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-c-tabs
|
|
5
|
-
propComponents: ['Tabs', 'TabProps', 'TabContent', 'TabTitleText', 'TabTitleIcon'
|
|
5
|
+
propComponents: ['Tabs', 'TabProps', 'TabContent', 'TabTitleText', 'TabTitleIcon']
|
|
6
6
|
ouia: true
|
|
7
7
|
---
|
|
8
|
+
|
|
8
9
|
import UsersIcon from '@patternfly/react-icons/dist/esm/icons/users-icon';
|
|
9
10
|
import BoxIcon from '@patternfly/react-icons/dist/esm/icons/box-icon';
|
|
10
11
|
import DatabaseIcon from '@patternfly/react-icons/dist/esm/icons/database-icon';
|
|
@@ -19,6 +20,87 @@ Similarly the 'Tab content light variation' checkbox affects the TabContent back
|
|
|
19
20
|
## Examples
|
|
20
21
|
|
|
21
22
|
### Default
|
|
23
|
+
|
|
24
|
+
When passing in a Tooltip component to the Tab component, the Tooltip can also be passed in directly to the `tooltip` prop.
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
import React from 'react';
|
|
28
|
+
import { Tabs, Tab, TabTitleText, Checkbox, Tooltip } from '@patternfly/react-core';
|
|
29
|
+
|
|
30
|
+
class SimpleTabs extends React.Component {
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
this.state = {
|
|
34
|
+
activeTabKey: 0,
|
|
35
|
+
isBox: false
|
|
36
|
+
};
|
|
37
|
+
// Toggle currently active tab
|
|
38
|
+
this.handleTabClick = (event, tabIndex) => {
|
|
39
|
+
this.setState({
|
|
40
|
+
activeTabKey: tabIndex
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
this.toggleBox = checked => {
|
|
45
|
+
this.setState({
|
|
46
|
+
isBox: checked
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
render() {
|
|
52
|
+
const { activeTabKey, isBox } = this.state;
|
|
53
|
+
const tooltip = (
|
|
54
|
+
<Tooltip content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support." />
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<div>
|
|
59
|
+
<Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox}>
|
|
60
|
+
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
61
|
+
Users
|
|
62
|
+
</Tab>
|
|
63
|
+
<Tab eventKey={1} title={<TabTitleText>Containers</TabTitleText>}>
|
|
64
|
+
Containers
|
|
65
|
+
</Tab>
|
|
66
|
+
<Tab eventKey={2} title={<TabTitleText>Database</TabTitleText>}>
|
|
67
|
+
Database
|
|
68
|
+
</Tab>
|
|
69
|
+
<Tab eventKey={3} title={<TabTitleText>Disabled</TabTitleText>} isDisabled>
|
|
70
|
+
Disabled
|
|
71
|
+
</Tab>
|
|
72
|
+
<Tab eventKey={4} title={<TabTitleText>ARIA Disabled</TabTitleText>} isAriaDisabled>
|
|
73
|
+
ARIA Disabled
|
|
74
|
+
</Tab>
|
|
75
|
+
<Tab
|
|
76
|
+
tooltip={tooltip}
|
|
77
|
+
eventKey={5}
|
|
78
|
+
title={<TabTitleText>ARIA Disabled (Tooltip)</TabTitleText>}
|
|
79
|
+
isAriaDisabled
|
|
80
|
+
>
|
|
81
|
+
ARIA Disabled (Tooltip)
|
|
82
|
+
</Tab>
|
|
83
|
+
</Tabs>
|
|
84
|
+
<div style={{ marginTop: '20px' }}>
|
|
85
|
+
<Checkbox
|
|
86
|
+
label="isBox"
|
|
87
|
+
isChecked={isBox}
|
|
88
|
+
onChange={this.toggleBox}
|
|
89
|
+
aria-label="show box variation checkbox"
|
|
90
|
+
id="toggle-box"
|
|
91
|
+
name="toggle-box"
|
|
92
|
+
/>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### With tooltip react ref
|
|
101
|
+
|
|
102
|
+
When using a React ref to link a Tooltip to a Tab component, an `id` must be manually set on the Tooltip component, and the Tab component must have a matching `aria-describedby` attribute so that screen readers are able to announce the Tooltip contents.
|
|
103
|
+
|
|
22
104
|
```js
|
|
23
105
|
import React from 'react';
|
|
24
106
|
import { Tabs, Tab, TabTitleText, Checkbox, Tooltip } from '@patternfly/react-core';
|
|
@@ -28,7 +110,7 @@ class SimpleTabs extends React.Component {
|
|
|
28
110
|
super(props);
|
|
29
111
|
this.state = {
|
|
30
112
|
activeTabKey: 0,
|
|
31
|
-
isBox: false
|
|
113
|
+
isBox: false
|
|
32
114
|
};
|
|
33
115
|
// Toggle currently active tab
|
|
34
116
|
this.handleTabClick = (event, tabIndex) => {
|
|
@@ -45,7 +127,7 @@ class SimpleTabs extends React.Component {
|
|
|
45
127
|
}
|
|
46
128
|
|
|
47
129
|
render() {
|
|
48
|
-
const {activeTabKey, isBox } = this.state;
|
|
130
|
+
const { activeTabKey, isBox } = this.state;
|
|
49
131
|
const tooltipRef = React.createRef();
|
|
50
132
|
|
|
51
133
|
return (
|
|
@@ -66,20 +148,30 @@ class SimpleTabs extends React.Component {
|
|
|
66
148
|
<Tab eventKey={4} title={<TabTitleText>ARIA Disabled</TabTitleText>} isAriaDisabled>
|
|
67
149
|
ARIA Disabled
|
|
68
150
|
</Tab>
|
|
69
|
-
<Tab
|
|
151
|
+
<Tab
|
|
152
|
+
eventKey={5}
|
|
153
|
+
title={<TabTitleText>ARIA Disabled (Tooltip)</TabTitleText>}
|
|
154
|
+
isAriaDisabled
|
|
155
|
+
ref={tooltipRef}
|
|
156
|
+
aria-describedby="tooltip-tab-5"
|
|
157
|
+
>
|
|
70
158
|
ARIA Disabled (Tooltip)
|
|
71
159
|
</Tab>
|
|
72
160
|
</Tabs>
|
|
73
|
-
<Tooltip
|
|
74
|
-
|
|
161
|
+
<Tooltip
|
|
162
|
+
content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support."
|
|
163
|
+
reference={tooltipRef}
|
|
164
|
+
id="tooltip-tab-5"
|
|
165
|
+
/>
|
|
166
|
+
<div style={{ marginTop: '20px' }}>
|
|
75
167
|
<Checkbox
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
168
|
+
label="isBox"
|
|
169
|
+
isChecked={isBox}
|
|
170
|
+
onChange={this.toggleBox}
|
|
171
|
+
aria-label="show box variation checkbox"
|
|
172
|
+
id="toggle-box"
|
|
173
|
+
name="toggle-box"
|
|
174
|
+
/>
|
|
83
175
|
</div>
|
|
84
176
|
</div>
|
|
85
177
|
);
|
|
@@ -88,14 +180,16 @@ class SimpleTabs extends React.Component {
|
|
|
88
180
|
```
|
|
89
181
|
|
|
90
182
|
### Uncontrolled
|
|
183
|
+
|
|
91
184
|
```js
|
|
92
185
|
import React from 'react';
|
|
93
186
|
import { Tabs, Tab, TabTitleText, Checkbox, Tooltip } from '@patternfly/react-core';
|
|
94
187
|
|
|
95
188
|
class UncontrolledSimpleTabs extends React.Component {
|
|
96
|
-
|
|
97
189
|
render() {
|
|
98
|
-
const
|
|
190
|
+
const tooltip = (
|
|
191
|
+
<Tooltip content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support." />
|
|
192
|
+
);
|
|
99
193
|
|
|
100
194
|
return (
|
|
101
195
|
<>
|
|
@@ -110,16 +204,20 @@ class UncontrolledSimpleTabs extends React.Component {
|
|
|
110
204
|
Database
|
|
111
205
|
</Tab>
|
|
112
206
|
<Tab eventKey={3} title={<TabTitleText>Disabled</TabTitleText>} isDisabled>
|
|
113
|
-
|
|
207
|
+
Disabled
|
|
114
208
|
</Tab>
|
|
115
209
|
<Tab eventKey={4} title={<TabTitleText>ARIA Disabled</TabTitleText>} isAriaDisabled>
|
|
116
210
|
ARIA Disabled
|
|
117
211
|
</Tab>
|
|
118
|
-
<Tab
|
|
212
|
+
<Tab
|
|
213
|
+
eventKey={5}
|
|
214
|
+
title={<TabTitleText>ARIA Disabled (Tooltip)</TabTitleText>}
|
|
215
|
+
isAriaDisabled
|
|
216
|
+
tooltip={tooltip}
|
|
217
|
+
>
|
|
119
218
|
ARIA Disabled (Tooltip)
|
|
120
219
|
</Tab>
|
|
121
220
|
</Tabs>
|
|
122
|
-
<Tooltip content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support." reference={tooltipRef} />
|
|
123
221
|
</>
|
|
124
222
|
);
|
|
125
223
|
}
|
|
@@ -127,6 +225,7 @@ class UncontrolledSimpleTabs extends React.Component {
|
|
|
127
225
|
```
|
|
128
226
|
|
|
129
227
|
### Box light variation
|
|
228
|
+
|
|
130
229
|
```js
|
|
131
230
|
import React from 'react';
|
|
132
231
|
import { Tabs, Tab, TabTitleText, Checkbox, Tooltip } from '@patternfly/react-core';
|
|
@@ -136,7 +235,7 @@ class SimpleTabs extends React.Component {
|
|
|
136
235
|
super(props);
|
|
137
236
|
this.state = {
|
|
138
237
|
activeTabKey: 0,
|
|
139
|
-
isTabsLightScheme: true
|
|
238
|
+
isTabsLightScheme: true
|
|
140
239
|
};
|
|
141
240
|
// Toggle currently active tab
|
|
142
241
|
this.handleTabClick = (event, tabIndex) => {
|
|
@@ -153,12 +252,19 @@ class SimpleTabs extends React.Component {
|
|
|
153
252
|
}
|
|
154
253
|
|
|
155
254
|
render() {
|
|
156
|
-
const {activeTabKey, isBox, isTabsLightScheme } = this.state;
|
|
157
|
-
const
|
|
255
|
+
const { activeTabKey, isBox, isTabsLightScheme } = this.state;
|
|
256
|
+
const tooltip = (
|
|
257
|
+
<Tooltip content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support." />
|
|
258
|
+
);
|
|
158
259
|
|
|
159
260
|
return (
|
|
160
261
|
<div>
|
|
161
|
-
<Tabs
|
|
262
|
+
<Tabs
|
|
263
|
+
activeKey={activeTabKey}
|
|
264
|
+
onSelect={this.handleTabClick}
|
|
265
|
+
variant={isTabsLightScheme ? 'light300' : 'default'}
|
|
266
|
+
isBox
|
|
267
|
+
>
|
|
162
268
|
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
163
269
|
Users
|
|
164
270
|
</Tab>
|
|
@@ -174,20 +280,24 @@ class SimpleTabs extends React.Component {
|
|
|
174
280
|
<Tab eventKey={4} title={<TabTitleText>ARIA Disabled</TabTitleText>} isAriaDisabled>
|
|
175
281
|
ARIA Disabled
|
|
176
282
|
</Tab>
|
|
177
|
-
<Tab
|
|
283
|
+
<Tab
|
|
284
|
+
eventKey={5}
|
|
285
|
+
title={<TabTitleText>ARIA Disabled (Tooltip)</TabTitleText>}
|
|
286
|
+
isAriaDisabled
|
|
287
|
+
tooltip={tooltip}
|
|
288
|
+
>
|
|
178
289
|
ARIA Disabled (Tooltip)
|
|
179
290
|
</Tab>
|
|
180
291
|
</Tabs>
|
|
181
|
-
<
|
|
182
|
-
<div style={{marginTop: "20px"}}>
|
|
292
|
+
<div style={{ marginTop: '20px' }}>
|
|
183
293
|
<Checkbox
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
294
|
+
label="Tabs light variation"
|
|
295
|
+
isChecked={isTabsLightScheme}
|
|
296
|
+
onChange={this.toggleScheme}
|
|
297
|
+
aria-label="show light scheme variation checkbox"
|
|
298
|
+
id="toggle-scheme"
|
|
299
|
+
name="toggle-scheme"
|
|
300
|
+
/>
|
|
191
301
|
</div>
|
|
192
302
|
</div>
|
|
193
303
|
);
|
|
@@ -196,6 +306,7 @@ class SimpleTabs extends React.Component {
|
|
|
196
306
|
```
|
|
197
307
|
|
|
198
308
|
### Default overflow
|
|
309
|
+
|
|
199
310
|
```js
|
|
200
311
|
import React from 'react';
|
|
201
312
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -223,7 +334,7 @@ class ScrollButtonsPrimaryTabs extends React.Component {
|
|
|
223
334
|
}
|
|
224
335
|
|
|
225
336
|
render() {
|
|
226
|
-
const {activeTabKey, isBox} = this.state;
|
|
337
|
+
const { activeTabKey, isBox } = this.state;
|
|
227
338
|
return (
|
|
228
339
|
<div>
|
|
229
340
|
<Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox}>
|
|
@@ -261,15 +372,15 @@ class ScrollButtonsPrimaryTabs extends React.Component {
|
|
|
261
372
|
Tab 11 section
|
|
262
373
|
</Tab>
|
|
263
374
|
</Tabs>
|
|
264
|
-
<div style={{marginTop:
|
|
375
|
+
<div style={{ marginTop: '20px' }}>
|
|
265
376
|
<Checkbox
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
377
|
+
label="isBox"
|
|
378
|
+
isChecked={isBox}
|
|
379
|
+
onChange={this.toggleBox}
|
|
380
|
+
aria-label="show box variation checkbox on overflow"
|
|
381
|
+
id="toggle-box-overflow"
|
|
382
|
+
name="toggle-box-overflow"
|
|
383
|
+
/>
|
|
273
384
|
</div>
|
|
274
385
|
</div>
|
|
275
386
|
);
|
|
@@ -278,6 +389,7 @@ class ScrollButtonsPrimaryTabs extends React.Component {
|
|
|
278
389
|
```
|
|
279
390
|
|
|
280
391
|
### Vertical
|
|
392
|
+
|
|
281
393
|
```js
|
|
282
394
|
import React from 'react';
|
|
283
395
|
import { Tabs, Tab, TabTitleText, Checkbox, Tooltip } from '@patternfly/react-core';
|
|
@@ -304,8 +416,11 @@ class VerticalTabs extends React.Component {
|
|
|
304
416
|
}
|
|
305
417
|
|
|
306
418
|
render() {
|
|
307
|
-
const {activeTabKey, isBox} = this.state;
|
|
308
|
-
const
|
|
419
|
+
const { activeTabKey, isBox } = this.state;
|
|
420
|
+
const tooltip = (
|
|
421
|
+
<Tooltip content="Aria-disabled tabs are like disabled tabs, but focusable. Allows for tooltip support." />
|
|
422
|
+
);
|
|
423
|
+
|
|
309
424
|
return (
|
|
310
425
|
<div>
|
|
311
426
|
<Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} isVertical isBox={isBox}>
|
|
@@ -324,20 +439,24 @@ class VerticalTabs extends React.Component {
|
|
|
324
439
|
<Tab eventKey={4} title={<TabTitleText>ARIA Disabled</TabTitleText>} isAriaDisabled>
|
|
325
440
|
ARIA Disabled
|
|
326
441
|
</Tab>
|
|
327
|
-
<Tab
|
|
442
|
+
<Tab
|
|
443
|
+
eventKey={5}
|
|
444
|
+
title={<TabTitleText>ARIA Disabled (Tooltip)</TabTitleText>}
|
|
445
|
+
isAriaDisabled
|
|
446
|
+
tooltip={tooltip}
|
|
447
|
+
>
|
|
328
448
|
ARIA Disabled (Tooltip)
|
|
329
449
|
</Tab>
|
|
330
450
|
</Tabs>
|
|
331
|
-
<
|
|
332
|
-
<div style={{marginTop: "20px"}}>
|
|
451
|
+
<div style={{ marginTop: '20px' }}>
|
|
333
452
|
<Checkbox
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
453
|
+
label="isBox"
|
|
454
|
+
isChecked={isBox}
|
|
455
|
+
onChange={this.toggleBox}
|
|
456
|
+
aria-label="show box variation checkbox with vertical"
|
|
457
|
+
id="toggle-box-vertical"
|
|
458
|
+
name="toggle-box-vertical"
|
|
459
|
+
/>
|
|
341
460
|
</div>
|
|
342
461
|
</div>
|
|
343
462
|
);
|
|
@@ -346,6 +465,7 @@ class VerticalTabs extends React.Component {
|
|
|
346
465
|
```
|
|
347
466
|
|
|
348
467
|
### Vertical expandable
|
|
468
|
+
|
|
349
469
|
```js
|
|
350
470
|
import React from 'react';
|
|
351
471
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -369,34 +489,43 @@ class VerticalExpandableTabs extends React.Component {
|
|
|
369
489
|
};
|
|
370
490
|
}
|
|
371
491
|
render() {
|
|
372
|
-
const {activeTabKey, isExpanded} = this.state;
|
|
492
|
+
const { activeTabKey, isExpanded } = this.state;
|
|
373
493
|
return (
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
494
|
+
<Tabs
|
|
495
|
+
activeKey={activeTabKey}
|
|
496
|
+
onSelect={this.handleTabClick}
|
|
497
|
+
isVertical
|
|
498
|
+
expandable={{ default: 'expandable', md: 'nonExpandable', lg: 'expandable' }}
|
|
499
|
+
isExpanded={isExpanded}
|
|
500
|
+
onToggle={this.onToggle}
|
|
501
|
+
toggleText="Containers"
|
|
502
|
+
>
|
|
503
|
+
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
504
|
+
Users
|
|
505
|
+
</Tab>
|
|
506
|
+
<Tab eventKey={1} title={<TabTitleText>Containers</TabTitleText>}>
|
|
507
|
+
Containers
|
|
508
|
+
</Tab>
|
|
509
|
+
<Tab eventKey={2} title={<TabTitleText>Database</TabTitleText>}>
|
|
510
|
+
Database
|
|
511
|
+
</Tab>
|
|
512
|
+
<Tab eventKey={3} title={<TabTitleText>Server</TabTitleText>}>
|
|
513
|
+
Server
|
|
514
|
+
</Tab>
|
|
515
|
+
<Tab eventKey={4} title={<TabTitleText>System</TabTitleText>}>
|
|
516
|
+
System
|
|
517
|
+
</Tab>
|
|
518
|
+
<Tab eventKey={6} title={<TabTitleText>Network</TabTitleText>}>
|
|
519
|
+
Network
|
|
520
|
+
</Tab>
|
|
521
|
+
</Tabs>
|
|
394
522
|
);
|
|
395
523
|
}
|
|
396
524
|
}
|
|
397
525
|
```
|
|
398
526
|
|
|
399
527
|
### Vertical expandable uncontrolled
|
|
528
|
+
|
|
400
529
|
```js
|
|
401
530
|
import React from 'react';
|
|
402
531
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -414,34 +543,42 @@ class VerticalExpandableUncontrolledTabs extends React.Component {
|
|
|
414
543
|
};
|
|
415
544
|
}
|
|
416
545
|
render() {
|
|
417
|
-
const {activeTabKey} = this.state;
|
|
546
|
+
const { activeTabKey } = this.state;
|
|
418
547
|
return (
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
</
|
|
548
|
+
<Tabs
|
|
549
|
+
activeKey={activeTabKey}
|
|
550
|
+
onSelect={this.handleTabClick}
|
|
551
|
+
isVertical
|
|
552
|
+
expandable={{ default: 'expandable', md: 'nonExpandable', lg: 'expandable' }}
|
|
553
|
+
defaultIsExpanded={false}
|
|
554
|
+
toggleText="Containers"
|
|
555
|
+
>
|
|
556
|
+
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
557
|
+
Users
|
|
558
|
+
</Tab>
|
|
559
|
+
<Tab eventKey={1} title={<TabTitleText>Containers</TabTitleText>}>
|
|
560
|
+
Containers
|
|
561
|
+
</Tab>
|
|
562
|
+
<Tab eventKey={2} title={<TabTitleText>Database</TabTitleText>}>
|
|
563
|
+
Database
|
|
564
|
+
</Tab>
|
|
565
|
+
<Tab eventKey={3} title={<TabTitleText>Server</TabTitleText>}>
|
|
566
|
+
Server
|
|
567
|
+
</Tab>
|
|
568
|
+
<Tab eventKey={4} title={<TabTitleText>System</TabTitleText>}>
|
|
569
|
+
System
|
|
570
|
+
</Tab>
|
|
571
|
+
<Tab eventKey={6} title={<TabTitleText>Network</TabTitleText>}>
|
|
572
|
+
Network
|
|
573
|
+
</Tab>
|
|
574
|
+
</Tabs>
|
|
439
575
|
);
|
|
440
576
|
}
|
|
441
577
|
}
|
|
442
578
|
```
|
|
443
579
|
|
|
444
580
|
### Inset
|
|
581
|
+
|
|
445
582
|
```js
|
|
446
583
|
import React from 'react';
|
|
447
584
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -468,16 +605,20 @@ class InsetTabs extends React.Component {
|
|
|
468
605
|
}
|
|
469
606
|
|
|
470
607
|
render() {
|
|
471
|
-
const {activeTabKey, isBox} = this.state;
|
|
608
|
+
const { activeTabKey, isBox } = this.state;
|
|
472
609
|
return (
|
|
473
610
|
<div>
|
|
474
|
-
<Tabs
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
611
|
+
<Tabs
|
|
612
|
+
activeKey={activeTabKey}
|
|
613
|
+
onSelect={this.handleTabClick}
|
|
614
|
+
inset={{
|
|
615
|
+
default: 'insetNone',
|
|
616
|
+
md: 'insetSm',
|
|
617
|
+
xl: 'inset2xl',
|
|
618
|
+
'2xl': 'insetLg'
|
|
619
|
+
}}
|
|
620
|
+
isBox={isBox}
|
|
621
|
+
>
|
|
481
622
|
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
482
623
|
Users
|
|
483
624
|
</Tab>
|
|
@@ -497,15 +638,15 @@ class InsetTabs extends React.Component {
|
|
|
497
638
|
Network
|
|
498
639
|
</Tab>
|
|
499
640
|
</Tabs>
|
|
500
|
-
<div style={{marginTop:
|
|
641
|
+
<div style={{ marginTop: '20px' }}>
|
|
501
642
|
<Checkbox
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
643
|
+
label="isBox"
|
|
644
|
+
isChecked={isBox}
|
|
645
|
+
onChange={this.toggleBox}
|
|
646
|
+
aria-label="show box variation checkbox with inset"
|
|
647
|
+
id="toggle-box-inset"
|
|
648
|
+
name="toggle-box-inset"
|
|
649
|
+
/>
|
|
509
650
|
</div>
|
|
510
651
|
</div>
|
|
511
652
|
);
|
|
@@ -514,6 +655,7 @@ class InsetTabs extends React.Component {
|
|
|
514
655
|
```
|
|
515
656
|
|
|
516
657
|
### Page Insets
|
|
658
|
+
|
|
517
659
|
```js
|
|
518
660
|
import React from 'react';
|
|
519
661
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -540,11 +682,10 @@ class PageInsetsTabs extends React.Component {
|
|
|
540
682
|
}
|
|
541
683
|
|
|
542
684
|
render() {
|
|
543
|
-
const {activeTabKey, isBox} = this.state;
|
|
685
|
+
const { activeTabKey, isBox } = this.state;
|
|
544
686
|
return (
|
|
545
687
|
<div>
|
|
546
|
-
<Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} usePageInsets
|
|
547
|
-
isBox={isBox}>
|
|
688
|
+
<Tabs activeKey={activeTabKey} onSelect={this.handleTabClick} usePageInsets isBox={isBox}>
|
|
548
689
|
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
549
690
|
Users
|
|
550
691
|
</Tab>
|
|
@@ -564,15 +705,15 @@ class PageInsetsTabs extends React.Component {
|
|
|
564
705
|
Network
|
|
565
706
|
</Tab>
|
|
566
707
|
</Tabs>
|
|
567
|
-
<div style={{marginTop:
|
|
708
|
+
<div style={{ marginTop: '20px' }}>
|
|
568
709
|
<Checkbox
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
710
|
+
label="isBox"
|
|
711
|
+
isChecked={isBox}
|
|
712
|
+
onChange={this.toggleBox}
|
|
713
|
+
aria-label="show box variation checkbox with inset"
|
|
714
|
+
id="toggle-box-inset"
|
|
715
|
+
name="toggle-box-inset"
|
|
716
|
+
/>
|
|
576
717
|
</div>
|
|
577
718
|
</div>
|
|
578
719
|
);
|
|
@@ -581,6 +722,7 @@ class PageInsetsTabs extends React.Component {
|
|
|
581
722
|
```
|
|
582
723
|
|
|
583
724
|
### Icons and text
|
|
725
|
+
|
|
584
726
|
```js
|
|
585
727
|
import React from 'react';
|
|
586
728
|
import { Tabs, Tab, TabTitleText, TabTitleIcon } from '@patternfly/react-core';
|
|
@@ -608,22 +750,82 @@ class IconAndTextTabs extends React.Component {
|
|
|
608
750
|
render() {
|
|
609
751
|
return (
|
|
610
752
|
<Tabs activeKey={this.state.activeTabKey} onSelect={this.handleTabClick}>
|
|
611
|
-
<Tab
|
|
753
|
+
<Tab
|
|
754
|
+
eventKey={0}
|
|
755
|
+
title={
|
|
756
|
+
<>
|
|
757
|
+
<TabTitleIcon>
|
|
758
|
+
<UsersIcon />
|
|
759
|
+
</TabTitleIcon>{' '}
|
|
760
|
+
<TabTitleText>Users</TabTitleText>{' '}
|
|
761
|
+
</>
|
|
762
|
+
}
|
|
763
|
+
>
|
|
612
764
|
Users
|
|
613
765
|
</Tab>
|
|
614
|
-
<Tab
|
|
766
|
+
<Tab
|
|
767
|
+
eventKey={1}
|
|
768
|
+
title={
|
|
769
|
+
<>
|
|
770
|
+
<TabTitleIcon>
|
|
771
|
+
<BoxIcon />
|
|
772
|
+
</TabTitleIcon>{' '}
|
|
773
|
+
<TabTitleText>Containers</TabTitleText>{' '}
|
|
774
|
+
</>
|
|
775
|
+
}
|
|
776
|
+
>
|
|
615
777
|
Containers
|
|
616
778
|
</Tab>
|
|
617
|
-
<Tab
|
|
779
|
+
<Tab
|
|
780
|
+
eventKey={2}
|
|
781
|
+
title={
|
|
782
|
+
<>
|
|
783
|
+
<TabTitleIcon>
|
|
784
|
+
<DatabaseIcon />
|
|
785
|
+
</TabTitleIcon>{' '}
|
|
786
|
+
<TabTitleText>Database</TabTitleText>{' '}
|
|
787
|
+
</>
|
|
788
|
+
}
|
|
789
|
+
>
|
|
618
790
|
Database
|
|
619
791
|
</Tab>
|
|
620
|
-
<Tab
|
|
792
|
+
<Tab
|
|
793
|
+
eventKey={3}
|
|
794
|
+
title={
|
|
795
|
+
<>
|
|
796
|
+
<TabTitleIcon>
|
|
797
|
+
<ServerIcon />
|
|
798
|
+
</TabTitleIcon>{' '}
|
|
799
|
+
<TabTitleText>Server</TabTitleText>{' '}
|
|
800
|
+
</>
|
|
801
|
+
}
|
|
802
|
+
>
|
|
621
803
|
Server
|
|
622
804
|
</Tab>
|
|
623
|
-
<Tab
|
|
805
|
+
<Tab
|
|
806
|
+
eventKey={4}
|
|
807
|
+
title={
|
|
808
|
+
<>
|
|
809
|
+
<TabTitleIcon>
|
|
810
|
+
<LaptopIcon />
|
|
811
|
+
</TabTitleIcon>{' '}
|
|
812
|
+
<TabTitleText>System</TabTitleText>{' '}
|
|
813
|
+
</>
|
|
814
|
+
}
|
|
815
|
+
>
|
|
624
816
|
System
|
|
625
817
|
</Tab>
|
|
626
|
-
<Tab
|
|
818
|
+
<Tab
|
|
819
|
+
eventKey={6}
|
|
820
|
+
title={
|
|
821
|
+
<>
|
|
822
|
+
<TabTitleIcon>
|
|
823
|
+
<ProjectDiagramIcon />
|
|
824
|
+
</TabTitleIcon>{' '}
|
|
825
|
+
<TabTitleText>Network</TabTitleText>{' '}
|
|
826
|
+
</>
|
|
827
|
+
}
|
|
828
|
+
>
|
|
627
829
|
Network
|
|
628
830
|
</Tab>
|
|
629
831
|
</Tabs>
|
|
@@ -633,6 +835,7 @@ class IconAndTextTabs extends React.Component {
|
|
|
633
835
|
```
|
|
634
836
|
|
|
635
837
|
### Tabs with sub tabs
|
|
838
|
+
|
|
636
839
|
```js
|
|
637
840
|
import React from 'react';
|
|
638
841
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -666,78 +869,78 @@ class SecondaryTabs extends React.Component {
|
|
|
666
869
|
}
|
|
667
870
|
|
|
668
871
|
render() {
|
|
669
|
-
const {activeTabKey1, activeTabKey2, isBox} = this.state;
|
|
872
|
+
const { activeTabKey1, activeTabKey2, isBox } = this.state;
|
|
670
873
|
return (
|
|
671
874
|
<div>
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
875
|
+
<Tabs activeKey={activeTabKey1} onSelect={this.handleTabClickFirst} isBox={isBox}>
|
|
876
|
+
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
877
|
+
<Tabs activeKey={activeTabKey2} isSecondary onSelect={this.handleTabClickSecond}>
|
|
878
|
+
<Tab eventKey={20} title={<TabTitleText>Secondary tab item 1</TabTitleText>}>
|
|
879
|
+
Secondary tab item 1 item section
|
|
880
|
+
</Tab>
|
|
881
|
+
<Tab eventKey={21} title={<TabTitleText>Secondary tab item 2</TabTitleText>}>
|
|
882
|
+
Secondary tab item 2 section
|
|
883
|
+
</Tab>
|
|
884
|
+
<Tab eventKey={22} title={<TabTitleText>Secondary tab item 3</TabTitleText>}>
|
|
885
|
+
Secondary tab item 3 section
|
|
886
|
+
</Tab>
|
|
887
|
+
<Tab eventKey={23} title={<TabTitleText>Secondary tab item 4</TabTitleText>}>
|
|
888
|
+
Secondary tab item 4 section
|
|
889
|
+
</Tab>
|
|
890
|
+
<Tab eventKey={24} title={<TabTitleText>Secondary tab item 5</TabTitleText>}>
|
|
891
|
+
Secondary tab item 5 section
|
|
892
|
+
</Tab>
|
|
893
|
+
<Tab eventKey={25} title={<TabTitleText>Secondary tab item 6</TabTitleText>}>
|
|
894
|
+
Secondary tab item 6 section
|
|
895
|
+
</Tab>
|
|
896
|
+
<Tab eventKey={26} title={<TabTitleText>Secondary tab item 7</TabTitleText>}>
|
|
897
|
+
Secondary tab item 7 section
|
|
898
|
+
</Tab>
|
|
899
|
+
<Tab eventKey={27} title={<TabTitleText>Secondary tab item 8</TabTitleText>}>
|
|
900
|
+
Secondary tab item 8 section
|
|
901
|
+
</Tab>
|
|
902
|
+
</Tabs>
|
|
903
|
+
</Tab>
|
|
904
|
+
<Tab eventKey={1} title={<TabTitleText>Containers</TabTitleText>}>
|
|
905
|
+
Containers
|
|
906
|
+
</Tab>
|
|
907
|
+
<Tab eventKey={2} title={<TabTitleText>Database</TabTitleText>}>
|
|
908
|
+
Database
|
|
909
|
+
</Tab>
|
|
910
|
+
<Tab eventKey={3} title={<TabTitleText>Server</TabTitleText>}>
|
|
911
|
+
Server
|
|
912
|
+
</Tab>
|
|
913
|
+
<Tab eventKey={4} title={<TabTitleText>System</TabTitleText>}>
|
|
914
|
+
System
|
|
915
|
+
</Tab>
|
|
916
|
+
<Tab eventKey={6} title={<TabTitleText>Network</TabTitleText>}>
|
|
917
|
+
Network
|
|
918
|
+
</Tab>
|
|
919
|
+
<Tab eventKey={7} title={<TabTitleText>Tab item 7</TabTitleText>}>
|
|
920
|
+
Tab 7 section
|
|
921
|
+
</Tab>
|
|
922
|
+
<Tab eventKey={8} title={<TabTitleText>Tab item 8</TabTitleText>}>
|
|
923
|
+
Tab 8 section
|
|
924
|
+
</Tab>
|
|
925
|
+
<Tab eventKey={9} title={<TabTitleText>Tab item 9</TabTitleText>}>
|
|
926
|
+
Tab 9 section
|
|
927
|
+
</Tab>
|
|
928
|
+
<Tab eventKey={10} title={<TabTitleText>Tab item 10</TabTitleText>}>
|
|
929
|
+
Tab 10 section
|
|
930
|
+
</Tab>
|
|
931
|
+
<Tab eventKey={11} title={<TabTitleText>Tab item 11</TabTitleText>}>
|
|
932
|
+
Tab 11 section
|
|
933
|
+
</Tab>
|
|
934
|
+
</Tabs>
|
|
935
|
+
<div style={{ marginTop: '20px' }}>
|
|
936
|
+
<Checkbox
|
|
937
|
+
label="isBox"
|
|
938
|
+
isChecked={isBox}
|
|
939
|
+
onChange={this.toggleBox}
|
|
940
|
+
aria-label="show box variation checkbox with sub tabs"
|
|
941
|
+
id="toggle-box-secondary"
|
|
942
|
+
name="toggle-box-secondary"
|
|
943
|
+
/>
|
|
741
944
|
</div>
|
|
742
945
|
</div>
|
|
743
946
|
);
|
|
@@ -746,6 +949,7 @@ class SecondaryTabs extends React.Component {
|
|
|
746
949
|
```
|
|
747
950
|
|
|
748
951
|
### Filled
|
|
952
|
+
|
|
749
953
|
```js
|
|
750
954
|
import React from 'react';
|
|
751
955
|
import { Tabs, Tab, TabTitleText, Checkbox } from '@patternfly/react-core';
|
|
@@ -772,29 +976,29 @@ class FilledTabs extends React.Component {
|
|
|
772
976
|
}
|
|
773
977
|
|
|
774
978
|
render() {
|
|
775
|
-
const {activeTabKey, isBox} = this.state;
|
|
979
|
+
const { activeTabKey, isBox } = this.state;
|
|
776
980
|
return (
|
|
777
981
|
<div>
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
982
|
+
<Tabs isFilled activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox}>
|
|
983
|
+
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>}>
|
|
984
|
+
Users
|
|
985
|
+
</Tab>
|
|
986
|
+
<Tab eventKey={1} title={<TabTitleText>Containers</TabTitleText>}>
|
|
987
|
+
Containers
|
|
988
|
+
</Tab>
|
|
989
|
+
<Tab eventKey={2} title={<TabTitleText>Database</TabTitleText>}>
|
|
990
|
+
Database
|
|
991
|
+
</Tab>
|
|
992
|
+
</Tabs>
|
|
993
|
+
<div style={{ marginTop: '20px' }}>
|
|
994
|
+
<Checkbox
|
|
995
|
+
label="isBox"
|
|
996
|
+
isChecked={isBox}
|
|
997
|
+
onChange={this.toggleBox}
|
|
998
|
+
aria-label="show box variation checkbox with filled tabs"
|
|
999
|
+
id="toggle-box-filled"
|
|
1000
|
+
name="toggle-box-filled"
|
|
1001
|
+
/>
|
|
798
1002
|
</div>
|
|
799
1003
|
</div>
|
|
800
1004
|
);
|
|
@@ -803,6 +1007,7 @@ class FilledTabs extends React.Component {
|
|
|
803
1007
|
```
|
|
804
1008
|
|
|
805
1009
|
### Filled with icons
|
|
1010
|
+
|
|
806
1011
|
```js
|
|
807
1012
|
import React from 'react';
|
|
808
1013
|
import { Tabs, Tab, TabTitleText, TabTitleIcon, Checkbox } from '@patternfly/react-core';
|
|
@@ -832,29 +1037,59 @@ class FilledTabsWithIcons extends React.Component {
|
|
|
832
1037
|
}
|
|
833
1038
|
|
|
834
1039
|
render() {
|
|
835
|
-
const {activeTabKey, isBox} = this.state;
|
|
1040
|
+
const { activeTabKey, isBox } = this.state;
|
|
836
1041
|
return (
|
|
837
1042
|
<div>
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1043
|
+
<Tabs isFilled activeKey={activeTabKey} onSelect={this.handleTabClick} isBox={isBox}>
|
|
1044
|
+
<Tab
|
|
1045
|
+
eventKey={0}
|
|
1046
|
+
title={
|
|
1047
|
+
<>
|
|
1048
|
+
<TabTitleIcon>
|
|
1049
|
+
<UsersIcon />
|
|
1050
|
+
</TabTitleIcon>{' '}
|
|
1051
|
+
<TabTitleText>Users</TabTitleText>{' '}
|
|
1052
|
+
</>
|
|
1053
|
+
}
|
|
1054
|
+
>
|
|
1055
|
+
Users
|
|
1056
|
+
</Tab>
|
|
1057
|
+
<Tab
|
|
1058
|
+
eventKey={1}
|
|
1059
|
+
title={
|
|
1060
|
+
<>
|
|
1061
|
+
<TabTitleIcon>
|
|
1062
|
+
<BoxIcon />
|
|
1063
|
+
</TabTitleIcon>{' '}
|
|
1064
|
+
<TabTitleText>Containers</TabTitleText>{' '}
|
|
1065
|
+
</>
|
|
1066
|
+
}
|
|
1067
|
+
>
|
|
1068
|
+
Containers
|
|
1069
|
+
</Tab>
|
|
1070
|
+
<Tab
|
|
1071
|
+
eventKey={2}
|
|
1072
|
+
title={
|
|
1073
|
+
<>
|
|
1074
|
+
<TabTitleIcon>
|
|
1075
|
+
<DatabaseIcon />
|
|
1076
|
+
</TabTitleIcon>{' '}
|
|
1077
|
+
<TabTitleText>Database</TabTitleText>{' '}
|
|
1078
|
+
</>
|
|
1079
|
+
}
|
|
1080
|
+
>
|
|
1081
|
+
Database
|
|
1082
|
+
</Tab>
|
|
1083
|
+
</Tabs>
|
|
1084
|
+
<div style={{ marginTop: '20px' }}>
|
|
1085
|
+
<Checkbox
|
|
1086
|
+
label="isBox"
|
|
1087
|
+
isChecked={isBox}
|
|
1088
|
+
onChange={this.toggleBox}
|
|
1089
|
+
aria-label="show box variation checkbox with filled icon tabs"
|
|
1090
|
+
id="toggle-box-filled-icon"
|
|
1091
|
+
name="toggle-box-filled-icon"
|
|
1092
|
+
/>
|
|
858
1093
|
</div>
|
|
859
1094
|
</div>
|
|
860
1095
|
);
|
|
@@ -863,6 +1098,7 @@ class FilledTabsWithIcons extends React.Component {
|
|
|
863
1098
|
```
|
|
864
1099
|
|
|
865
1100
|
### Using the nav element
|
|
1101
|
+
|
|
866
1102
|
```js
|
|
867
1103
|
import React from 'react';
|
|
868
1104
|
import { Tabs, Tab, TabsComponent, TabTitleText } from '@patternfly/react-core';
|
|
@@ -890,7 +1126,7 @@ class TabsNav extends React.Component {
|
|
|
890
1126
|
aria-label="Local"
|
|
891
1127
|
component={TabsComponent.nav}
|
|
892
1128
|
>
|
|
893
|
-
|
|
1129
|
+
<Tab eventKey={0} title={<TabTitleText>Users</TabTitleText>} href="#users">
|
|
894
1130
|
Users
|
|
895
1131
|
</Tab>
|
|
896
1132
|
<Tab eventKey={1} title={<TabTitleText>Containers</TabTitleText>} href="#containers">
|
|
@@ -914,8 +1150,8 @@ class TabsNav extends React.Component {
|
|
|
914
1150
|
}
|
|
915
1151
|
```
|
|
916
1152
|
|
|
917
|
-
|
|
918
1153
|
### Sub nav using the nav element
|
|
1154
|
+
|
|
919
1155
|
```js
|
|
920
1156
|
import React from 'react';
|
|
921
1157
|
import { Tabs, Tab, TabsComponent, TabTitleText } from '@patternfly/react-core';
|
|
@@ -1001,6 +1237,7 @@ class SecondaryTabsNav extends React.Component {
|
|
|
1001
1237
|
```
|
|
1002
1238
|
|
|
1003
1239
|
### Separate content
|
|
1240
|
+
|
|
1004
1241
|
```js
|
|
1005
1242
|
import React from 'react';
|
|
1006
1243
|
import { Tabs, Tab, TabTitleText, TabContent } from '@patternfly/react-core';
|
|
@@ -1028,9 +1265,24 @@ class SeparateTabContent extends React.Component {
|
|
|
1028
1265
|
return (
|
|
1029
1266
|
<React.Fragment>
|
|
1030
1267
|
<Tabs activeKey={this.state.activeTabKey} onSelect={this.handleTabClick}>
|
|
1031
|
-
<Tab
|
|
1032
|
-
|
|
1033
|
-
|
|
1268
|
+
<Tab
|
|
1269
|
+
eventKey={0}
|
|
1270
|
+
title={<TabTitleText>Tab item 1</TabTitleText>}
|
|
1271
|
+
tabContentId="refTab1Section"
|
|
1272
|
+
tabContentRef={this.contentRef1}
|
|
1273
|
+
/>
|
|
1274
|
+
<Tab
|
|
1275
|
+
eventKey={1}
|
|
1276
|
+
title={<TabTitleText>Tab item 2</TabTitleText>}
|
|
1277
|
+
tabContentId="refTab2Section"
|
|
1278
|
+
tabContentRef={this.contentRef2}
|
|
1279
|
+
/>
|
|
1280
|
+
<Tab
|
|
1281
|
+
eventKey={2}
|
|
1282
|
+
title={<TabTitleText>Tab item 3</TabTitleText>}
|
|
1283
|
+
tabContentId="refTab3Section"
|
|
1284
|
+
tabContentRef={this.contentRef3}
|
|
1285
|
+
/>
|
|
1034
1286
|
</Tabs>
|
|
1035
1287
|
<div>
|
|
1036
1288
|
<TabContent eventKey={0} id="refTab1Section" ref={this.contentRef1} aria-label="Tab item 1">
|
|
@@ -1050,13 +1302,14 @@ class SeparateTabContent extends React.Component {
|
|
|
1050
1302
|
```
|
|
1051
1303
|
|
|
1052
1304
|
### Tab content with body and padding
|
|
1305
|
+
|
|
1053
1306
|
```js
|
|
1054
1307
|
import React from 'react';
|
|
1055
1308
|
import { Tabs, Tab, TabTitleText, TabContent, TabContentBody } from '@patternfly/react-core';
|
|
1056
1309
|
|
|
1057
1310
|
const TabContentWithBody = () => {
|
|
1058
1311
|
const [activeTabKey, setActiveTabKey] = React.useState(0);
|
|
1059
|
-
|
|
1312
|
+
|
|
1060
1313
|
// Toggle currently active tab
|
|
1061
1314
|
const handleTabClick = (event, tabIndex) => {
|
|
1062
1315
|
setActiveTabKey(tabIndex);
|
|
@@ -1069,9 +1322,24 @@ const TabContentWithBody = () => {
|
|
|
1069
1322
|
return (
|
|
1070
1323
|
<React.Fragment>
|
|
1071
1324
|
<Tabs activeKey={activeTabKey} onSelect={handleTabClick}>
|
|
1072
|
-
<Tab
|
|
1073
|
-
|
|
1074
|
-
|
|
1325
|
+
<Tab
|
|
1326
|
+
eventKey={0}
|
|
1327
|
+
title={<TabTitleText>Tab item 1</TabTitleText>}
|
|
1328
|
+
tabContentId="refTab1Section"
|
|
1329
|
+
tabContentRef={contentRef1}
|
|
1330
|
+
/>
|
|
1331
|
+
<Tab
|
|
1332
|
+
eventKey={1}
|
|
1333
|
+
title={<TabTitleText>Tab item 2</TabTitleText>}
|
|
1334
|
+
tabContentId="refTab2Section"
|
|
1335
|
+
tabContentRef={contentRef2}
|
|
1336
|
+
/>
|
|
1337
|
+
<Tab
|
|
1338
|
+
eventKey={2}
|
|
1339
|
+
title={<TabTitleText>Tab item 3</TabTitleText>}
|
|
1340
|
+
tabContentId="refTab3Section"
|
|
1341
|
+
tabContentRef={contentRef3}
|
|
1342
|
+
/>
|
|
1075
1343
|
</Tabs>
|
|
1076
1344
|
<div>
|
|
1077
1345
|
<TabContent eventKey={0} id="refTab1Section" ref={contentRef1} aria-label="Tab item 1">
|
|
@@ -1086,10 +1354,11 @@ const TabContentWithBody = () => {
|
|
|
1086
1354
|
</div>
|
|
1087
1355
|
</React.Fragment>
|
|
1088
1356
|
);
|
|
1089
|
-
}
|
|
1357
|
+
};
|
|
1090
1358
|
```
|
|
1091
1359
|
|
|
1092
1360
|
### Children mounting on click
|
|
1361
|
+
|
|
1093
1362
|
```js
|
|
1094
1363
|
import React from 'react';
|
|
1095
1364
|
import { Tabs, Tab, TabTitleText } from '@patternfly/react-core';
|
|
@@ -1111,13 +1380,13 @@ class MountingSimpleTabs extends React.Component {
|
|
|
1111
1380
|
render() {
|
|
1112
1381
|
return (
|
|
1113
1382
|
<Tabs mountOnEnter activeKey={this.state.activeTabKey} onSelect={this.handleTabClick}>
|
|
1114
|
-
<Tab eventKey={0} title={<TabTitleText>Tab item 1</TabTitleText>}
|
|
1383
|
+
<Tab eventKey={0} title={<TabTitleText>Tab item 1</TabTitleText>}>
|
|
1115
1384
|
Tab 1 section
|
|
1116
1385
|
</Tab>
|
|
1117
|
-
<Tab eventKey={1} title={<TabTitleText>Tab item 2</TabTitleText>}
|
|
1386
|
+
<Tab eventKey={1} title={<TabTitleText>Tab item 2</TabTitleText>}>
|
|
1118
1387
|
Tab 2 section
|
|
1119
1388
|
</Tab>
|
|
1120
|
-
<Tab eventKey={2} title={<TabTitleText>Tab item 3</TabTitleText>}
|
|
1389
|
+
<Tab eventKey={2} title={<TabTitleText>Tab item 3</TabTitleText>}>
|
|
1121
1390
|
Tab 3 section
|
|
1122
1391
|
</Tab>
|
|
1123
1392
|
</Tabs>
|
|
@@ -1127,6 +1396,7 @@ class MountingSimpleTabs extends React.Component {
|
|
|
1127
1396
|
```
|
|
1128
1397
|
|
|
1129
1398
|
### Unmounting invisible children
|
|
1399
|
+
|
|
1130
1400
|
```js
|
|
1131
1401
|
import React from 'react';
|
|
1132
1402
|
import { Tabs, Tab, TabTitleText } from '@patternfly/react-core';
|
|
@@ -1148,13 +1418,13 @@ class UnmountingSimpleTabs extends React.Component {
|
|
|
1148
1418
|
render() {
|
|
1149
1419
|
return (
|
|
1150
1420
|
<Tabs unmountOnExit activeKey={this.state.activeTabKey} onSelect={this.handleTabClick}>
|
|
1151
|
-
<Tab eventKey={0} title={<TabTitleText>Tab item 1</TabTitleText>}
|
|
1421
|
+
<Tab eventKey={0} title={<TabTitleText>Tab item 1</TabTitleText>}>
|
|
1152
1422
|
Tab 1 section
|
|
1153
1423
|
</Tab>
|
|
1154
|
-
<Tab eventKey={1} title={<TabTitleText>Tab item 2</TabTitleText>}
|
|
1424
|
+
<Tab eventKey={1} title={<TabTitleText>Tab item 2</TabTitleText>}>
|
|
1155
1425
|
Tab 2 section
|
|
1156
1426
|
</Tab>
|
|
1157
|
-
<Tab eventKey={2} title={<TabTitleText>Tab item 3</TabTitleText>}
|
|
1427
|
+
<Tab eventKey={2} title={<TabTitleText>Tab item 3</TabTitleText>}>
|
|
1158
1428
|
Tab 3 section
|
|
1159
1429
|
</Tab>
|
|
1160
1430
|
</Tabs>
|
|
@@ -1164,6 +1434,7 @@ class UnmountingSimpleTabs extends React.Component {
|
|
|
1164
1434
|
```
|
|
1165
1435
|
|
|
1166
1436
|
### Toggled separate content
|
|
1437
|
+
|
|
1167
1438
|
```js
|
|
1168
1439
|
import React from 'react';
|
|
1169
1440
|
import { Tabs, Tab, TabContent, Button, Divider } from '@patternfly/react-core';
|