flexprice/flexprice-front

Add Storybook Stories for Existing React Components

Aberta

#159 aberto em 10 de abr. de 2025

 (3 comentários) (0 reação) (0 responsável)TypeScript (106 forks)auto 404
good first issuehacktoberfestreactstorybook

Métricas do repositório

Stars
 (32 estrelas)
Métricas de merge de PR
 (Mesclagem média 1d 1h) (116 fundiu PRs em 30d)

Description

📚 Description

We are building a React project and want to integrate Storybook to help us visualize and document our UI components in isolation.

This issue is perfect for first-time contributors and those new to open-source. You'll be helping us create *.stories.tsx or *.stories.jsx files for our React components so they can be showcased in Storybook.


🛠️ Task Details

  • Locate components inside the src/components/ directory
  • For each component, create a corresponding Storybook story file in src/stories/ (or alongside the component if our project prefers that)
  • Follow the Component Story Format (CSF) to write your stories
  • Add multiple variations of the component, such as:
    • Default / Primary
    • Secondary
    • Disabled
    • Loading (if applicable)

🧪 Example

If we have a Button.tsx component:

// src/components/Button.tsx
import React from 'react';

type ButtonProps = {
  label: string;
  onClick: () => void;
};

export const Button = ({ label, onClick }: ButtonProps) => (
  <button onClick={onClick}>{label}</button>
);

Guia do colaborador