react-component-generator

React Component Generator

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "react-component-generator" with this command: npx skills add dexploarer/claudius-skills/dexploarer-claudius-skills-react-component-generator

React Component Generator

Generates modern React components following best practices with TypeScript support.

When to Use

  • "Create a Button component"

  • "Generate a UserProfile component"

  • "Scaffold a DataTable component"

Instructions

  1. Gather Requirements
  • Component name (PascalCase)

  • Component type (functional, with state, with effects)

  • Props needed

  • TypeScript types

  • Styling approach

  1. Generate Component Structure

Functional Component:

import React from 'react'; import styles from './ComponentName.module.css';

interface ComponentNameProps { // Props here }

export const ComponentName: React.FC<ComponentNameProps> = ({ // Destructure props }) => { return ( <div className={styles.container}> {/* Component JSX */} </div> ); };

With State:

import React, { useState } from 'react';

export const ComponentName: React.FC<Props> = () => { const [state, setState] = useState<Type>(initialValue);

return <div>{/* ... */}</div>; };

With Effects:

import React, { useEffect } from 'react';

export const ComponentName: React.FC<Props> = () => { useEffect(() => { // Effect logic return () => { // Cleanup }; }, [dependencies]);

return <div>{/* ... */}</div>; };

  1. Add PropTypes/TypeScript Interfaces

interface ComponentNameProps { title: string; onAction?: () => void; children?: React.ReactNode; className?: string; }

  1. Create Associated Files
  • ComponentName.tsx

  • Component file

  • ComponentName.module.css

  • Styles

  • ComponentName.test.tsx

  • Tests

  • index.ts

  • Barrel export

  1. Add Documentation

/**

  • ComponentName - Brief description
  • @example
  • <ComponentName title="Hello" onAction={handleClick} /> */

Best Practices

  • Use functional components

  • TypeScript for type safety

  • CSS Modules for styling

  • Proper prop destructuring

  • Meaningful names

  • Add tests

  • Export from index.ts

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

threejs-scene-builder

No summary provided by upstream source.

Repository SourceNeeds Review
General

database-query-optimizer

No summary provided by upstream source.

Repository SourceNeeds Review
General

terraform-module-builder

No summary provided by upstream source.

Repository SourceNeeds Review