-
-
Notifications
You must be signed in to change notification settings - Fork 300
/
IconSpacing.tsx
84 lines (81 loc) · 2.46 KB
/
IconSpacing.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import type { ReactElement } from "react";
import { Button } from "@react-md/button";
import { Divider } from "@react-md/divider";
import { TextIconSpacing } from "@react-md/icon";
import { CloseSVGIcon, HomeSVGIcon } from "@react-md/material-icons";
import { Typography } from "@react-md/typography";
import styles from "./IconSpacing.module.scss";
function CustomIcon(): ReactElement {
return <HomeSVGIcon />;
}
export default function IconSpacing(): ReactElement {
return (
<>
<Typography type="headline-5">Within buttons</Typography>
<Button id="icon-button-1" className={styles.button}>
<TextIconSpacing icon={<HomeSVGIcon />}>Button</TextIconSpacing>
</Button>
<Button
id="icon-button-2"
className={styles.button}
themeType="outline"
theme="secondary"
>
<TextIconSpacing icon={<HomeSVGIcon />} iconAfter>
Button
</TextIconSpacing>
</Button>
<Button
id="icon-button-3"
className={styles.button}
themeType="contained"
theme="warning"
>
<TextIconSpacing icon={<HomeSVGIcon />}>
<TextIconSpacing icon={<CloseSVGIcon />} iconAfter>
Multiple
</TextIconSpacing>
</TextIconSpacing>
</Button>
<Typography type="headline-5">Normal usage</Typography>
<ul className={styles.list}>
<li>
<TextIconSpacing icon={<HomeSVGIcon />}>Icon Before</TextIconSpacing>
</li>
<li>
<TextIconSpacing icon={<HomeSVGIcon />} iconAfter>
Icon After
</TextIconSpacing>
</li>
<li>
<TextIconSpacing icon={<HomeSVGIcon />}>
<TextIconSpacing icon={<CloseSVGIcon />} iconAfter>
Multiple
</TextIconSpacing>
</TextIconSpacing>
</li>
<Divider />
<li>
<TextIconSpacing icon={<CustomIcon />}>
Broken Custom Icon
</TextIconSpacing>
</li>
<li>
<TextIconSpacing icon={<CustomIcon />} forceIconWrap>
Fixed Custom Icon
</TextIconSpacing>
</li>
<li>
<TextIconSpacing icon="*" forceIconWrap>
Using an asterisk "icon"
</TextIconSpacing>
</li>
<li>
<TextIconSpacing icon="*" forceIconWrap iconAfter>
Using an asterisk "icon"
</TextIconSpacing>
</li>
</ul>
</>
);
}