Skip to content

[Frontend] Set up Storybook for component documentation and visual regression testing #174

Description

@Penielka

Description

The frontend has many reusable components but no visual documentation or isolated development environment. Storybook should be set up to document all shared components, support visual regression testing, and serve as a living style guide.

Definition of Done

  • Storybook 8.x installed and configured for Next.js + Tailwind
  • Stories written for all shared UI components (Button, Card, Badge, Skeleton, etc.)
  • Stories written for form components (Input, Select, Checkbox, etc.)
  • Stories written for composite components (Quiz, Enrollment, Dashboard, etc.)
  • Storybook builds in CI and deploys to GitHub Pages or Chromatic
  • Stories include all component states: default, hover, focus, disabled, loading, error, empty
  • Dark mode toggle in Storybook toolbar
  • Documentation pages for design tokens and usage guidelines

Acceptance Criteria

  1. npm run storybook starts Storybook on port 6006
  2. All shared components have at least one story
  3. Stories cover all visual states of each component
  4. Storybook builds without errors in CI

Files to Modify

  • frontend/package.json — add storybook and related dependencies + scripts
  • New file: frontend/.storybook/main.ts — Storybook config
  • New file: frontend/.storybook/preview.ts — global decorators
  • New file: frontend/src/components/ui/button.stories.tsx — example stories
  • New file: frontend/src/components/ui/card.stories.tsx
  • New file: frontend/src/components/ui/badge.stories.tsx
  • New file: frontend/src/components/Skeleton.stories.tsx
  • New file: frontend/src/components/ErrorBoundary.stories.tsx
  • Multiple story files for other components
  • .github/workflows/ci.yml — add Storybook build step

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaigndocumentationImprovements or additions to documentationenhancementNew feature or requestfrontendFrontend UI/UX issueshelp wantedExtra attention is neededmedium-priority

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions