(e.key === 'Enter' || e.keyCode === 13) && o.handler()}
diff --git a/src/Twirl.tsx b/src/Twirl.tsx
index 2828ca3..c25c71a 100644
--- a/src/Twirl.tsx
+++ b/src/Twirl.tsx
@@ -6,6 +6,7 @@ export const Twirl = ((props) => (
(
(e.key === 'Enter' || e.keyCode === 13) && o.handler()}
diff --git a/src/index.ts b/src/index.ts
index d78c179..bf23563 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -21,6 +21,8 @@ export interface CommonBurgerProps {
duration?: number;
/** Hides the default browser focus style. */
hideOutline?: boolean;
+ /** An ARIA label to improve accessibility. */
+ label?: string;
/** A callback which receives a single boolean argument, indicating if the icon is toggled. */
onToggle?: (toggled: boolean) => any;
/** Specifies if the icon bars should be rounded. */
@@ -40,6 +42,7 @@ export interface RenderOptions {
handler: () => void;
isLeft: boolean;
isToggled: boolean;
+ label: string | undefined;
margin: number;
move: number;
/** CSS transition-duration property (in seconds). */
diff --git a/tests/label.test.tsx b/tests/label.test.tsx
new file mode 100644
index 0000000..b1a1e1d
--- /dev/null
+++ b/tests/label.test.tsx
@@ -0,0 +1,9 @@
+import React from 'react'
+import Hamburger from '../src'
+import { render } from '@testing-library/react'
+
+it(`sets an accessibility label`, () => {
+ const { getByTestId: get } = render()
+
+ expect(get('tilt')).toHaveAttribute('aria-label', 'Toggle menu')
+})