Story Components Reference
This page documents all available components for building Storybook stories.
StoryContainer
Section titled “StoryContainer”A container component for wrapping stories with consistent spacing and styling.
children: React.ReactNode - The content to rendersize: ‘sm’ | ‘md’ | ‘lg’ | ‘full’ - Container size (default: ‘md’)sm: 600px max widthmd: 1200px max widthlg: 1400px max widthfull: no max width
asCard: boolean - Render as a card with background and border (default: false)className: string - Additional CSS classes
Example
Section titled “Example”import { StoryContainer } from '@cratis/arc.react/stories';
export const MyStory: Story = { render: () => ( <StoryContainer size="sm" asCard> <h1>My Component</h1> <MyComponent /> </StoryContainer> ),};Usage Guidelines
Section titled “Usage Guidelines”- Use
size="sm"for focused examples with narrow content - Use
size="md"(default) for most standard stories - Use
size="lg"for complex layouts or multiple columns - Use
size="full"for full-width demonstrations - Add
asCardwhen you want visual separation from the background
StorySection
Section titled “StorySection”A section component for grouping related content with consistent vertical spacing.
children: React.ReactNode - The content to render
Example
Section titled “Example”<StoryContainer> <StorySection> <h2>First Section</h2> <p>Content here</p> </StorySection>
<StorySection> <h2>Second Section</h2> <p>More content</p> </StorySection></StoryContainer>Usage Guidelines
Section titled “Usage Guidelines”- Use sections to separate distinct topics or examples within a story
- Sections provide consistent vertical spacing between content blocks
- Ideal for multi-part demonstrations
StoryGrid
Section titled “StoryGrid”A responsive grid container for displaying multiple items.
children: React.ReactNode - Grid items to render
Example
Section titled “Example”<StoryGrid> <div className="story-card">Card 1</div> <div className="story-card">Card 2</div> <div className="story-card">Card 3</div></StoryGrid>Usage Guidelines
Section titled “Usage Guidelines”- Use grids to showcase variations or multiple states of a component
- Grid automatically adjusts columns based on screen size
- Combine with
.story-cardclass for card-style grid items
StoryDivider
Section titled “StoryDivider”A visual divider between sections.
No props - it’s a simple visual element.
Example
Section titled “Example”<StoryContainer> <p>First section</p> <StoryDivider /> <p>Second section</p></StoryContainer>Usage Guidelines
Section titled “Usage Guidelines”- Use dividers to create clear visual separation
- Automatically adapts color to current theme
- Lighter alternative to separate sections
StoryBadge
Section titled “StoryBadge”A status badge component for displaying colored labels.
children: React.ReactNode - Badge contentvariant: ‘success’ | ‘warning’ | ‘error’ | ‘info’ - Badge color variantclassName: string - Additional CSS classes
Example
Section titled “Example”<p> Build Status: <StoryBadge variant="success">Passing</StoryBadge></p>Variants
Section titled “Variants”success: Green badge for positive stateswarning: Yellow/orange badge for cautionary stateserror: Red badge for error statesinfo: Blue badge for informational states
Usage Guidelines
Section titled “Usage Guidelines”- Use badges to highlight status, state, or metadata
- Keep badge content concise (1-2 words)
- Choose variants that match semantic meaning