Skip to content

Commit f89d158

Browse files
committed
add icon and text to story toolbar button
1 parent 1c8b762 commit f89d158

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

src/plugins/shared_ux/public/components/toolbar_button/toolbar_button.stories.tsx

+26-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
*/
88

99
import React from 'react';
10-
import { ToolbarButton as ToolbarButtonComponent } from './toolbar_button.component';
10+
import {
11+
EuiFlexGroup,
12+
EuiFlexItem,
13+
EuiIcon,
14+
EuiPopover,
15+
EuiPopoverTitle,
16+
EuiText,
17+
} from '@elastic/eui';
1118
import { ToolbarButton } from './toolbar_button';
19+
import { ToolbarButton as ToolbarButtonComponent } from './toolbar_button.component';
1220
import mdx from './toolbar_button.mdx';
1321

1422
export default {
@@ -19,10 +27,23 @@ export default {
1927
},
2028
};
2129

22-
export const ConnectedComponent = () => {
23-
return <ToolbarButton />;
24-
};
30+
const title = 'test';
2531

2632
export const PureComponent = () => {
27-
return <ToolbarButtonComponent hasArrow={false} />;
33+
return (
34+
<EuiFlexGroup alignItems="center">
35+
<EuiPopover
36+
ownFocus
37+
button={
38+
<ToolbarButtonComponent iconType="managementApp" iconSide="left">
39+
<EuiText size="m">Sample Text</EuiText>
40+
</ToolbarButtonComponent>
41+
}
42+
anchorPosition="downRight"
43+
>
44+
<EuiPopoverTitle>{title}</EuiPopoverTitle>
45+
Test
46+
</EuiPopover>
47+
</EuiFlexGroup>
48+
);
2849
};

0 commit comments

Comments
 (0)