Skip to content

Commit 32cbedc

Browse files
committed
docs(storybook): add story for slots
1 parent 9e64a39 commit 32cbedc

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

packages/uui-toast-notification-layout/lib/uui-toast-notification-layout.story.ts

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,52 @@ export default {
77
id: 'uui-toast-notification-layout',
88
title: 'Displays/Toast Notification/Toast Notification Layout',
99
component: 'uui-toast-notification-layout',
10+
args: {
11+
headline: 'Headline',
12+
},
13+
argTypes: {
14+
headline: {
15+
control: { type: 'text' },
16+
},
17+
slot: {
18+
control: { type: 'text' },
19+
},
20+
},
21+
decorators: [
22+
(Story: any) => html`<div style="max-width:200px;">${Story()}</div>`,
23+
],
1024
};
1125

12-
export const Overview: Story = () =>
13-
html`<uui-toast-notification-layout headline="Headline">
26+
export const Overview: Story = props =>
27+
html`<uui-toast-notification-layout .headline=${props.headline}>
1428
Use this component within your dialog-element.
1529
<uui-button slot="actions" look="primary" label="button"></uui-button>
1630
</uui-toast-notification-layout>`;
31+
32+
export const SlottedContent: Story = props =>
33+
html`<uui-toast-notification-layout>
34+
<h3 slot="headline">${props.headline}</h3>
35+
${props.slot}
36+
<div slot="actions">
37+
<uui-icon-registry-essential>
38+
<uui-action-bar>
39+
<uui-button look="primary"
40+
><uui-icon name="add"></uui-icon
41+
></uui-button>
42+
<uui-button look="outline"
43+
><uui-icon name="delete"></uui-icon
44+
></uui-button>
45+
</uui-action-bar>
46+
</uui-icon-registry-essential>
47+
</div>
48+
</uui-toast-notification-layout>`;
49+
50+
SlottedContent.args = {
51+
slot: 'This is the default slot',
52+
};
53+
54+
SlottedContent.parameters = {
55+
controls: {
56+
include: ['headline', 'slot'],
57+
},
58+
};

0 commit comments

Comments
 (0)