consolelog.tools logo

Component Library Starter

Generate component library structure with tests and stories

Configuration

Generated Files

Button/Button.tsx

import React from 'react';
import './Button.css';

interface ButtonProps {
  children?: React.ReactNode;
  className?: string;
  variant?: 'primary' | 'secondary' | 'outline';
  size?: 'sm' | 'md' | 'lg';
}

export const Button: React.FC<ButtonProps> = ({
  children,
  className = '',
  variant = 'primary',
  size = 'md',
}) => {
  return (
    <div className={`button ${variant} ${size} ${className}`}>
      {children}
    </div>
  );
};

Generated Structure

Your component library includes:

  • Component implementation
  • Storybook stories for documentation
  • Unit tests
  • Index file for exports
  • README with usage examples
  • Separate style file

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Frequently Asked Questions - Component Library Starter