aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/atoms')
-rw-r--r--src/components/atoms/forms/label.stories.tsx13
-rw-r--r--src/components/atoms/forms/label.tsx4
2 files changed, 17 insertions, 0 deletions
diff --git a/src/components/atoms/forms/label.stories.tsx b/src/components/atoms/forms/label.stories.tsx
index 79f1a34..f66aa13 100644
--- a/src/components/atoms/forms/label.stories.tsx
+++ b/src/components/atoms/forms/label.stories.tsx
@@ -12,6 +12,19 @@ export default {
size: 'small',
},
argTypes: {
+ 'aria-label': {
+ control: {
+ type: 'text',
+ },
+ description: 'Define an accessible name.',
+ table: {
+ category: 'Accessibility',
+ },
+ type: {
+ name: 'string',
+ required: false,
+ },
+ },
className: {
control: {
type: 'text',
diff --git a/src/components/atoms/forms/label.tsx b/src/components/atoms/forms/label.tsx
index ce4c70f..2ec614f 100644
--- a/src/components/atoms/forms/label.tsx
+++ b/src/components/atoms/forms/label.tsx
@@ -3,6 +3,10 @@ import styles from './label.module.scss';
export type LabelProps = {
/**
+ * An accessible name for the label.
+ */
+ 'aria-label'?: string;
+ /**
* The label body.
*/
children: ReactNode;