Generate boilerplate for new React components following project patterns. Use when creating new UI components.
Generate standardized component boilerplate following project conventions.
Shared Component (src/components/):
src/components/
└── ComponentName/
├── component-name.tsx # Main component
├── component-name.module.css # Styles
└── index.ts # Barrel export
Feature Component ():
src/features/src/features/
└── feature-name/
├── FeatureNamePage.tsx # Page component
├── feature-name.module.css # Styles
├── components/ # Feature-specific components
└── index.ts # Barrel export
// component-name.tsx
import styles from './component-name.module.css';
interface ComponentNameProps {
/** Description of prop */
propName?: string;
}
export function ComponentName({ propName }: ComponentNameProps) {
return (
<div className={styles.wrapper}>
{/* Component content */}
</div>
);
}
/* component-name.module.css */
.wrapper {
display: flex;
flex-direction: column;
gap: var(--spacing-3);
}
// index.ts
export { ComponentName } from './component-name';
export type { ComponentNameProps } from './component-name';