Skip to content

Commit 6c35dec

Browse files
committed
Update button loading state examples
1 parent 32aea98 commit 6c35dec

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

react/components/Button/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ const CloseIcon = require('../icon/Close').default
164164
Loading state
165165

166166
```js
167-
initialState = { isLoading1: false, isLoading2: true };
167+
initialState = { isLoading1: true, isLoading2: true, isLoading3: true };
168168
<div>
169169
<div>
170170
<Button
171-
variation="primary"
171+
variation="danger"
172+
size="small"
172173
onClick={() => setState({ isLoading1: !state.isLoading1 })}
173174
isLoading={state.isLoading1}
174175
>
@@ -184,5 +185,15 @@ initialState = { isLoading1: false, isLoading2: true };
184185
Toggle loading state
185186
</Button>
186187
</div>
188+
<div className="mt4">
189+
<Button
190+
variation="secondary"
191+
size="large"
192+
onClick={() => setState({ isLoading3: !state.isLoading3 })}
193+
isLoading={state.isLoading3}
194+
>
195+
Toggle loading state
196+
</Button>
197+
</div>
187198
</div>
188199
```

0 commit comments

Comments
 (0)