Skip to content

Commit 1d187b9

Browse files
docs
1 parent 0b3f2f7 commit 1d187b9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/rules/a11y-use-next-tooltip.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,15 @@ import {Tooltip} from '@primer/react'
1414
```tsx
1515
import {Tooltip} from '@primer/react/next'
1616
```
17+
18+
## Icon buttons and tooltips
19+
20+
Even though the below code is perfectly valid, since icon buttons now come with tooltips by default, it is not required to explicitly use the Tooltip component on icon buttons.
21+
22+
```jsx
23+
import {IconButton} from '@primer/react'
24+
import {Tooltip} from '@primer/react/next'
25+
;<Tooltip text={'Search'} direction={'e'}>
26+
<IconButton icon={SearchIcon} aria-label={'Search'} />
27+
</Tooltip>
28+
```

0 commit comments

Comments
 (0)