Skip to content

Commit bc7f422

Browse files
committed
chore: add docs for icon button
1 parent 357ed0d commit bc7f422

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Shared/Components/Button/Button.component.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ const ButtonElement = ({
114114
* ```tsx
115115
* <Button component={ButtonComponentType.link} linkProps={{ to: '#' }} />
116116
* ```
117+
*
118+
* @example Icon button
119+
* ```tsx
120+
* <Button icon={<ICCube />} ariaLabel="Label" />
121+
* ```
117122
*/
118123
const Button = ({
119124
dataTestId,

src/Shared/Components/Button/types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ export type ButtonProps = (
119119
endIcon?: ReactElement
120120
}
121121
| {
122+
/**
123+
* If provided, icon button is rendered
124+
*/
122125
icon: ReactElement
126+
/**
127+
* Label for the icon button for accessibility.
128+
* Shown on hover in tooltip if tippy is not provided explicitly
129+
*/
123130
ariaLabel: string
124131
text?: never
125132
startIcon?: never

0 commit comments

Comments
 (0)