Skip to content

Interactive Component Demos

This page demonstrates the Storybook iframe embed component for displaying live, interactive component demos within the documentation site.

Here’s a live Button component from our Storybook:

Loading Storybook story...

The same Button component with the Storybook controls panel enabled:

Loading Storybook story...

Interactive form component demonstration:

Loading Storybook story...

Theme switching demonstration:

Loading Storybook story...

The Storybook embed component provides:

  • Live Interaction: Full interactive functionality of components
  • Responsive Design: Adapts to different screen sizes
  • Loading States: Shows loading placeholder while iframe loads
  • Error Handling: Graceful fallback when Storybook is unavailable
  • Accessibility: Proper ARIA labels and keyboard navigation
  • Customizable: Configurable height, width, toolbar, and panel visibility
  • No JavaScript Fallback: Links directly to Storybook when JS is disabled

Import the Astro component and use it in your documentation:

---
import StorybookEmbedAstro from '../components/interactive/StorybookEmbedAstro.astro'
---
<StorybookEmbedAstro
storyId="components-button--primary"
title="Button Demo"
height={350}
showPanel={true}
/>
PropTypeDefaultDescription
storyIdstringrequiredStorybook story ID (e.g., ‘components-button—primary’)
storybookUrlstring'http://localhost:6006'Base URL for Storybook instance
heightnumber400Height of iframe in pixels
widthstring | number'100%'Width of iframe
showToolbarbooleanfalseShow Storybook toolbar
showPanelbooleanfalseShow controls/docs panel
titlestringauto-generatedAccessibility title
classstring''Additional CSS classes