Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/Button/IconButton.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"defaultValue": "",
"description": "provide an octicon. It will be placed in the center of the button"
},
{
"name": "aria-label",
"type": "string",
"defaultValue": "",
"description": "Use an aria label to describe the functionality of the button. Please refer to [our guidance on alt text](https://primer.style/guides/accessibility/alternative-text-for-images) for tips on writing good alternative text."
},
{
"name": "sx",
"type": "SystemStyleObject"
Expand Down
14 changes: 7 additions & 7 deletions src/Button/IconButton.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ export default {
title: 'Components/IconButton/Features',
}

export const Primary = () => <IconButton icon={HeartIcon} variant="primary" aria-label="Primary" />
export const Primary = () => <IconButton icon={HeartIcon} variant="primary" aria-label="Favorite" />

export const Danger = () => <IconButton icon={HeartIcon} variant="danger" aria-label="Danger" />
export const Danger = () => <IconButton icon={HeartIcon} variant="danger" aria-label="Favorite" />

export const Invisible = () => <IconButton icon={HeartIcon} variant="invisible" aria-label="Invisible" />
export const Invisible = () => <IconButton icon={HeartIcon} variant="invisible" aria-label="Favorite" />

export const Disabled = () => <IconButton disabled icon={HeartIcon} aria-label="Disabled" />
export const Disabled = () => <IconButton disabled icon={HeartIcon} aria-label="Favorite" />

export const Small = () => <IconButton size="small" icon={HeartIcon} aria-label="Default" />
export const Small = () => <IconButton size="small" icon={HeartIcon} aria-label="Favorite" />

export const Medium = () => <IconButton size="medium" icon={HeartIcon} aria-label="Default" />
export const Medium = () => <IconButton size="medium" icon={HeartIcon} aria-label="Favorite" />

export const Large = () => <IconButton size="large" icon={HeartIcon} aria-label="Default" />
export const Large = () => <IconButton size="large" icon={HeartIcon} aria-label="Favorite" />
6 changes: 3 additions & 3 deletions src/Button/IconButton.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Playground.args = {
disabled: false,
inactive: false,
variant: 'default',
'aria-label': 'Icon button description',
icon: XIcon,
'aria-label': 'Favorite',
icon: HeartIcon,
}

export const Default = () => <IconButton icon={HeartIcon} aria-label="Default" />
export const Default = () => <IconButton icon={HeartIcon} aria-label="Favorite" />