Skip to content

Commit

Permalink
docs(Button): add stacked button set knob
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Aug 4, 2020
1 parent 20b73c6 commit 3181fbf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/react/src/components/Button/Button-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import React from 'react';
import classNames from 'classnames';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
Expand Down Expand Up @@ -109,6 +110,7 @@ const props = {
'Icon description (iconDescription)',
'Button icon'
),
stacked: boolean('Stack buttons vertically (stacked)', false),
onClick: action('onClick'),
onFocus: action('onFocus'),
};
Expand Down Expand Up @@ -197,9 +199,12 @@ storiesOf('Button', module)
.add(
'Sets of Buttons',
() => {
const setProps = props.set();
const { stacked, ...setProps } = props.set();
const buttonSetClasses = classNames(`${prefix}--btn-set`, {
[`${prefix}--btn-set--stacked`]: stacked,
});
return (
<div className={`${prefix}--btn-set`}>
<div className={buttonSetClasses}>
<Button kind="secondary" {...setProps}>
Secondary button
</Button>
Expand Down

0 comments on commit 3181fbf

Please sign in to comment.