diff --git a/packages/button/README.md b/packages/button/README.md index dc6a49d9e..2ae15d2e3 100644 --- a/packages/button/README.md +++ b/packages/button/README.md @@ -6,6 +6,7 @@ 1. [Button circle](#button-circle) 1. [Button with left icon](#button-with-left-icon) 1. [Button with right icon](#button-with-right-icon) +1. [Disabled Button](#disabled-button) ## Installation @@ -76,3 +77,38 @@ const RightIconButton = () => ( ); export default RightIconButton; ``` + +## Disabled Button + +For a better accessibility (users to have focus on disabled buttons), you should use the aria-disabled attribute instead of the disabled attribute. + +```javascript +const DisabledButton = () => ( + +); +export default DisabledButton; +``` + +Be careful that using the aria-disabled attribute will not disable the button, so you have to handle the disabled state inside your onClick or onSubmit function. + +```javascript +const disabledButton = true; + +
+); +export default DisabledButton; +``` diff --git a/packages/button/src/Button.stories.tsx b/packages/button/src/Button.stories.tsx index 5d6af3a11..cb0f0a86b 100644 --- a/packages/button/src/Button.stories.tsx +++ b/packages/button/src/Button.stories.tsx @@ -76,7 +76,7 @@ ButtonSmallStory.args = { export const ButtonDisabledStory: Story