diff --git a/app/javascript/crayons/Button/Button.jsx b/app/javascript/crayons/Button/Button.jsx
index 135e45566..c1e849835 100644
--- a/app/javascript/crayons/Button/Button.jsx
+++ b/app/javascript/crayons/Button/Button.jsx
@@ -56,6 +56,7 @@ export const Button = ({
onMouseOut,
onFocus,
onBlur,
+ tabIndex,
}) => {
const ComponentName = tagName;
const Icon = icon;
@@ -81,6 +82,7 @@ export const Button = ({
onMouseOut={onMouseOut}
onFocus={onFocus}
onBlur={onBlur}
+ tabIndex={tabIndex}
{...otherProps}
>
{contentType !== 'text' && contentType !== 'icon-right' && Icon && (
@@ -111,6 +113,7 @@ Button.defaultProps = {
onMouseOut: undefined,
onFocus: undefined,
onBlur: undefined,
+ tabIndex: undefined,
};
Button.propTypes = {
@@ -146,4 +149,5 @@ Button.propTypes = {
onMouseOut: PropTypes.func,
onFocus: PropTypes.func,
onBlur: PropTypes.func,
+ tabIndex: PropTypes.number,
};
diff --git a/app/javascript/crayons/Button/__tests__/Button.test.jsx b/app/javascript/crayons/Button/__tests__/Button.test.jsx
index fad607eb2..ff603cd89 100644
--- a/app/javascript/crayons/Button/__tests__/Button.test.jsx
+++ b/app/javascript/crayons/Button/__tests__/Button.test.jsx
@@ -9,6 +9,11 @@ describe(' component', () => {
expect(tree).toMatchSnapshot();
});
+ it('should render with a tabIndex', () => {
+ const tree = render();
+ expect(tree).toMatchSnapshot();
+ });
+
it('should render a secondary button when using the variant "secondary"', () => {
const tree = render();
expect(tree).toMatchSnapshot();
diff --git a/app/javascript/crayons/Button/__tests__/__snapshots__/Button.test.jsx.snap b/app/javascript/crayons/Button/__tests__/__snapshots__/Button.test.jsx.snap
index 6915d04d0..dd5f730e6 100644
--- a/app/javascript/crayons/Button/__tests__/__snapshots__/Button.test.jsx.snap
+++ b/app/javascript/crayons/Button/__tests__/__snapshots__/Button.test.jsx.snap
@@ -127,3 +127,14 @@ exports[` component should render an outlined button when using the va
Hello world!
`;
+
+exports[` component should render with a tabIndex 1`] = `
+
+`;