5
5
Simplest use case: a button with text in it, telling the user what to do.
6
6
7
7
``` handlebars
8
- {{es-button label="click me"}}
8
+ <EsButton @ label="click me" />
9
9
```
10
10
11
-
12
11
Also supported- block use:
13
12
14
13
``` handlebars
15
- {{#es-button}}
14
+ <EsButton>
16
15
click me <span>🐹</span>
17
- {{/es-button}}
18
- ```
19
-
20
- To toggle the 'disabled' property, set 'isDisabled' to true
21
-
22
- ``` handlebars
23
- {{es-button label="click me" isDisabled=true}}
16
+ </EsButton>
24
17
```
25
18
26
19
To add interactivity you can pass an action to ` onClicked `
@@ -33,37 +26,18 @@ To add interactivity you can pass an action to `onClicked`
33
26
{{value}}
34
27
```
35
28
36
- ## Styling Links
37
- It is also possible to style a link to look like a button using the ` something ` class
38
-
39
- ``` html
40
- <a href =" https://emberjs.com" class =" es-button" >Go to Ember homepage</a >
41
- ```
42
-
43
- ## Styles
44
-
45
- Outline button style:
29
+ ## Secondary Buttons
46
30
47
31
``` handlebars
48
- {{es-button label="click me" isDark=false}}
32
+ <EsButton @ label="click me" @secondary={{true}} />
49
33
```
50
34
51
- Smaller button:
52
-
53
- ``` handlebars
54
- {{es-button label="click me" isTiny=true}}
55
- ```
56
-
57
- Less Padding:
58
-
59
- ``` handlebars
60
- {{es-button label="click me" isDark=true isDense=true}}
61
- ```
62
-
63
- Full-width button:
35
+ ## Styling Links
36
+ It is also possible to style a link to look like a button using the ` something ` class
64
37
65
- ``` handlebars
66
- {{es-button label="click me" isBlock=true}}
38
+ ``` html
39
+ <a href =" https://emberjs.com" class =" es-button" >Go to Ember homepage</a >
40
+ <a href =" https://guides.emberjs.com" class =" es-button-secondary" >Go to the Guides</a >
67
41
```
68
42
69
43
## Accessibility
@@ -73,14 +47,7 @@ Since we're using the native HTML button element and requiring a label value to
73
47
If you are going to put an icon in the button, then you will need to set an aria-label property on the button:
74
48
75
49
``` handlebars
76
- {{#es-button ariaLabel ="Hamster Secrets" title="Hamster Secrets"}}
50
+ <EsButton aria-label ="Hamster Secrets" title="Hamster Secrets">
77
51
🐹
78
- {{/es-button}}
52
+ </EsButton>
79
53
```
80
-
81
- ## Other Uses
82
-
83
- There are some other ways this component could be used:
84
-
85
- - as a link
86
- - as a toggle button (supports the aria-pressed attribute)
0 commit comments