File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,27 @@ export interface IButtonGroupProps
12
12
* Flag to indicate the spacing between the buttons.
13
13
*/
14
14
spaced ?: boolean ;
15
+
16
+ /**
17
+ * Flag to indicate if buttons are stacked vertically.
18
+ */
19
+ vertical ?: boolean ;
15
20
}
16
21
17
22
const ClayButtonGroup : React . FunctionComponent < IButtonGroupProps > = ( {
18
23
children,
19
24
className,
20
25
role = 'group' ,
21
26
spaced,
27
+ vertical,
22
28
...otherProps
23
29
} : IButtonGroupProps ) => (
24
30
< div
25
31
{ ...otherProps }
26
- className = { classNames ( className , 'btn-group' ) }
32
+ className = { classNames (
33
+ className ,
34
+ vertical ? 'btn-group-vertical' : 'btn-group'
35
+ ) }
27
36
role = { role }
28
37
>
29
38
{ spaced
Original file line number Diff line number Diff line change @@ -45,6 +45,15 @@ storiesOf('Components|ClayButton', module)
45
45
< ClayButton > { 'group.' } </ ClayButton >
46
46
</ ClayButton . Group >
47
47
) )
48
+ . add ( 'button group vertical' , ( ) => (
49
+ < ClayButton . Group spaced = { boolean ( 'Spaced' , false ) as false } vertical >
50
+ < ClayButton > { 'This' } </ ClayButton >
51
+ < ClayButton displayType = "secondary" > { 'is' } </ ClayButton >
52
+ < ClayButton > { 'a' } </ ClayButton >
53
+ < ClayButton displayType = "secondary" > { 'button' } </ ClayButton >
54
+ < ClayButton > { 'group.' } </ ClayButton >
55
+ </ ClayButton . Group >
56
+ ) )
48
57
. add ( 'ButtonWithIcon' , ( ) => (
49
58
< >
50
59
< ClayButtonWithIcon
You can’t perform that action at this time.
0 commit comments