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
This is the default variant for the `Button` component.
23
23
24
-
```jsx live drafts
24
+
```jsx live
25
25
<Button>Default</Button>
26
26
```
27
27
28
28
### Danger button
29
29
30
30
The `danger` variant of `Button` is used to warn users about potentially destructive actions
31
31
32
-
```jsx live drafts
32
+
```jsx live
33
33
<Button variant="danger">Danger</Button>
34
34
```
35
35
36
36
### Outline button
37
37
38
38
The `outline` variant of `Button` is typically used as a secondary button
39
39
40
-
```jsx live drafts
40
+
```jsx live
41
41
<Button variant="outline">Outline</Button>
42
42
```
43
43
44
44
### Invisible button
45
45
46
46
The `invisible` variant of `Button` indicates that the action is a low priority one.
47
47
48
-
```jsx live drafts
48
+
```jsx live
49
49
<Button variant="invisible">Invisible</Button>
50
50
```
51
51
52
52
### Different sized buttons
53
53
54
54
`Button` component supports three different sizes. `small`, `medium`, `large`.
55
55
56
-
```jsx live drafts
56
+
```jsx live
57
57
<>
58
58
<Button size="small">Search</Button>
59
59
<Button sx={{mt:2}}>Search</Button>
@@ -68,7 +68,7 @@ The `invisible` variant of `Button` indicates that the action is a low priority
68
68
We can place an inside the `Button` in either the leading or the trailing position to enhance the visual context.
69
69
It is recommended to use an octicon here.
70
70
71
-
```jsx live drafts
71
+
```jsx live
72
72
<>
73
73
<Button leadingIcon={SearchIcon}>Search</Button>
74
74
<Button trailingIcon={SearchIcon} sx={{mt:2}}>
@@ -84,15 +84,15 @@ It is recommended to use an octicon here.
84
84
85
85
A separate component called `IconButton` is used if the action shows only an icon with no text. This button will remain square in shape.
86
86
87
-
```jsx live drafts
87
+
```jsx live
88
88
<IconButton icon={SearchIcon}>Search</IconButton>
89
89
```
90
90
91
91
### Different sized icon buttons
92
92
93
93
`IconButton` also supports the three different sizes. `small`, `medium`, `large`.
94
94
95
-
```jsx live drafts
95
+
```jsx live
96
96
<>
97
97
<IconButton icon={SearchIcon} size="small">
98
98
Search
@@ -112,7 +112,7 @@ A common use case for primer is a button with a counter component which shows th
112
112
We provide `Button.Counter` as a composite component which requires you to provide a number as child.
113
113
The counter will match the `variant` styles of the parent button.
114
114
115
-
```jsx live drafts
115
+
```jsx live
116
116
<Button>
117
117
Watch
118
118
<Button.Counter>1</Button.Counter>
@@ -124,7 +124,7 @@ The counter will match the `variant` styles of the parent button.
124
124
A button can be styled in an appropriate manner using the `sx` prop. This maybe to change width, or to add margins etc.
125
125
Here's an example of a block button which takes 100% of available width. Checkout [styled-system](https://styled-system.com/) to see what you can send in an `sx` prop.
0 commit comments