Skip to content

Commit 436bbfc

Browse files
committed
add alignment controls to Storybook
1 parent cd629f6 commit 436bbfc

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

packages/react-components/src/stories/AlertBanner.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ The `size` prop (defaults to `medium`) controls the vertical height and font siz
5959

6060
<Canvas of={AlertBannerStories.SmallAlertBanner} />
6161

62+
### Alignment
63+
64+
By default, alert banner content is centered. Set `alignment` to `stretch` to make it full-width:
65+
66+
<Canvas of={AlertBannerStories.FullWidthAlertBanner} />
67+
6268
### Alert content
6369

6470
Pass content to the `children` slot to populate an alert banner.

packages/react-components/src/stories/AlertBanner.stories.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ const meta = {
2222
defaultValue: { summary: "medium" },
2323
},
2424
},
25+
alignment: {
26+
options: ["center", "stretch"],
27+
control: { type: "radio" },
28+
description: "Controls whether banner content is centered or full-width",
29+
table: {
30+
defaultValue: { summary: "center" },
31+
},
32+
},
2533
children: {
2634
control: { type: "object" },
2735
description: "Populates the content of the alert",
@@ -72,6 +80,14 @@ export const SmallAlertBanner: Story = {
7280
},
7381
};
7482

83+
export const FullWidthAlertBanner: Story = {
84+
...AlertBannerTemplate,
85+
args: {
86+
alignment: "stretch",
87+
...AlertBannerTemplate.args,
88+
},
89+
};
90+
7591
export const SuccessBanner: Story = {
7692
...AlertBannerTemplate,
7793
args: {

0 commit comments

Comments
 (0)