Create a new React component following project constraints (Tailwind, MUI, or Vanilla).
scaffold-component (Global Fallback)Use this skill when the user asks to "create a component". This skill is designed to be framework-agnostic and will adapt to the current project's stack. Adhere to the following process and development philosophy and approach.
Philosophy & Approach
[ComponentName].spec.md within the component folder before starting implementation.component-architecture.md global rule (Folder-per-Component).src/components/[ComponentName]/[ComponentName].spec.md for substantial components and initialize the Changelog section.package.json for dependencies (e.g., @mui/material, tailwindcss, react version). Adhere to project-specific rules like three-js-react.md if applicable.Box, Typography, Grid).sx prop for custom styling.Grid (v2) if on MUI v6+.div, header, main).className with Tailwind utility classes.sm:, md:, lg:).import React from 'react';
/**
* Props for the [ComponentName] component.
*/
export interface [ComponentName]Props {
/** ARIA label for accessibility */
'aria-label'?: string;
title?: string;
children?: React.ReactNode;
}
/**
* [Brief description of the component]
*/
export const [ComponentName]: React.FC<[ComponentName]Props> = ({
'aria-label': ariaLabel,
title,
children,
...props
}) => {
// IMPLEMENTATION: Adapt based on detected framework (MUI vs Tailwind)
return (
<div className="[component-name-kebab-case]" {...props}>
{title && <h2>{title}</h2>}
<div role="region" aria-label={ariaLabel || "[Default Label]"}>
{children || <p>New component: [ComponentName]</p>}
</div>
</div>
);
};