Debian Codegraph @

node/@patternfly/react-core/src/components/Label/examples/LabelCompact.tsx

raw
1 import { Fragment } from 'react';
2 import { Label, LabelColor } from '@patternfly/react-core';
3 import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
4 import RhUiInformationFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-information-fill-icon';
5
6 export const LabelCompact: React.FunctionComponent = () => (
7 <Fragment>
8 <Label isCompact>Compact</Label>
9 <Label isCompact icon={<CubeIcon />}>
10 Compact icon
11 </Label>
12 <Label isCompact onClose={() => Function.prototype}>
13 Compact removable
14 </Label>
15 <Label isCompact icon={<CubeIcon />} onClose={() => Function.prototype}>
16 Compact icon removable
17 </Label>
18 <Label isCompact href="#compact">
19 Compact link
20 </Label>
21 <Label isCompact href="#compact" onClose={() => Function.prototype}>
22 Compact link removable
23 </Label>{' '}
24 <Label isCompact onClick={() => Function.prototype}>
25 Compact clickable
26 </Label>{' '}
27 <Label isCompact onClick={() => Function.prototype} onClose={() => Function.prototype}>
28 Compact clickable removable
29 </Label>{' '}
30 <Label isCompact icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
31 Compact label with icon that overflows
32 </Label>{' '}
33 <Label isDisabled isCompact href="#compact" onClose={() => Function.prototype} icon={<CubeIcon />}>
34 Compact link removable (disabled)
35 </Label>{' '}
36 <Label
37 isDisabled
38 isCompact
39 onClick={() => Function.prototype}
40 onClose={() => Function.prototype}
41 icon={<CubeIcon />}
42 >
43 Compact clickable removable (disabled)
44 </Label>
45 <Label variant="outline" color={LabelColor.blue} isCompact icon={<CubeIcon />}>
46 Compact icon
47 </Label>
48 <Label variant="outline" color={LabelColor.blue} isCompact onClose={() => Function.prototype}>
49 Compact removable
50 </Label>
51 <Label variant="outline" color={LabelColor.blue} isCompact icon={<CubeIcon />} onClose={() => Function.prototype}>
52 Compact icon removable
53 </Label>
54 <Label variant="outline" color={LabelColor.blue} isCompact href="#compact">
55 Compact link
56 </Label>
57 <Label variant="outline" color={LabelColor.blue} isCompact href="#compact" onClose={() => Function.prototype}>
58 Compact link removable
59 </Label>
60 <Label
61 variant="outline"
62 color={LabelColor.blue}
63 isCompact
64 icon={<CubeIcon />}
65 onClose={() => Function.prototype}
66 textMaxWidth="16ch"
67 >
68 Compact label with icon that overflows
69 </Label>{' '}
70 <Label isDisabled isCompact href="#compact" onClose={() => Function.prototype} icon={<RhUiInformationFillIcon />}>
71 Compact link removable (disabled)
72 </Label>{' '}
73 <Label
74 isDisabled
75 isCompact
76 onClick={() => Function.prototype}
77 onClose={() => Function.prototype}
78 icon={<RhUiInformationFillIcon />}
79 >
80 Compact clickable removable (disabled)
81 </Label>
82 </Fragment>
83 );