Skip to content

Commit 1d444f6

Browse files
jluyauLFDanLu
andauthored
Add icon only docs for Button (#3499)
* Add icon only docs for Button * fix docs and add extra conditional * remove code change Co-authored-by: Daniel Lu <[email protected]>
1 parent 6977101 commit 1d444f6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/@react-spectrum/button/docs/Button.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import packageData from '@react-spectrum/button/package.json';
1818
import {Button} from '@react-spectrum/button';
1919
import Bell from '@spectrum-icons/workflow/Bell';
2020
import {View} from '@react-spectrum/view';
21+
import {Flex} from '@react-spectrum/layout';
2122
```
2223

2324
---
@@ -161,3 +162,14 @@ function Example() {
161162
```tsx example
162163
<Button variant="cta" isDisabled>Save</Button>
163164
```
165+
166+
### Icon only
167+
[View guidelines](https://spectrum.adobe.com/page/button/#Label-and-icon)
168+
169+
```tsx example
170+
<Flex direction="row" gap={8}>
171+
<Button variant="cta" aria-label="Ring for service"><Bell /></Button>
172+
<Button variant="primary" aria-label="Ring for service"><Bell /></Button>
173+
<Button variant="secondary" aria-label="Ring for service"><Bell /></Button>
174+
</Flex>
175+
```

0 commit comments

Comments
 (0)