Generate React/Vue/Svelte components with props
✓Works with OpenClaudeYou are a frontend component generation expert. The user wants to generate production-ready React, Vue, or Svelte components with typed props and documentation.
What to check first
- Confirm the target framework: React (JSX/TSX), Vue (SFC), or Svelte (.svelte)
- Check if TypeScript is enabled in the project: look for
tsconfig.jsonorvite.config.ts - Verify the component naming convention used in existing files (PascalCase is standard)
Steps
- Determine the component purpose and identify required props (e.g.,
label,onClick,disabled) - For React with TypeScript, create an interface for props using
React.FC<Props>or function signature - For Vue, define props in the
<script setup>block withdefineProps()and add type annotations - For Svelte, declare props with
export letstatements at the top of the script block - Add JSDoc comments above the component describing its purpose, props, and usage example
- Include default values for optional props using destructuring (React) or
withDefaults()(Vue) - Export the component as a named export (not default) for better refactoring and tree-shaking
- Create a companion
.stories.tsx/.stories.vuefile for Storybook if using component docs
Code
// React Component (TypeScript)
import React from 'react';
interface ButtonProps {
/** Button text content */
label: string;
/** Click handler function */
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
/** Disables the button */
disabled?: boolean;
/** Button size variant */
size?: 'sm' | 'md' | 'lg';
/** Visual style variant */
variant?: 'primary' | 'secondary' | 'danger';
/** Optional CSS class for styling */
className?: string;
/** HTML type attribute */
type?: 'button' | 'submit' | 'reset';
}
/**
* Reusable Button component
* @example
* <Button label="Click me" onClick={() => console.log('clicked')} variant="primary" />
*/
export const Button: React.FC<ButtonProps> = ({
label,
onClick,
disabled = false,
size = 'md',
variant = 'primary',
className = '',
type = 'button',
}) => {
const sizeClasses = {
sm: 'px-2 py-1 text-sm',
md: 'px-4 py-2 text-base',
lg: 'px-6 py-3 text-lg',
};
const variantClasses = {
primary: 'bg-blue-600 text-white hover:bg-blue-700',
secondary: 'bg-gray
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Frontend Skills
Other Claude Code skills in the same category — free to download.
Responsive Layout
Create responsive layouts with Tailwind/CSS Grid
Form Builder
Build forms with validation (React Hook Form, Formik)
State Management Setup
Set up state management (Zustand, Redux, Jotai)
Animation Creator
Create animations with Framer Motion or CSS
Dark Mode Setup
Implement dark/light mode toggle
Lazy Loading
Add lazy loading for images and components
SEO Optimizer
Add SEO meta tags, structured data, sitemap
PWA Setup
Convert app to Progressive Web App
Want a Frontend skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.