Create a component based on the given name and options: $ARGUMENTS
- Determine the correct FSD layer based on usage scope:
- Used across multiple features →
src/shared/ui/ - Used within a single feature →
src/widgets/<feature>/orsrc/entities/<domain>/ui/
- Used across multiple features →
- Use
interfacefor Props definition - Default export only
- Use Tailwind CSS for styling — no inline styles
- Use
cn()from@/shared/utils/cnfor conditional className merging - Always accept
className?: stringprop for external style overrides - Server Component by default — add
"use client"only when needed (event handlers, hooks, browser APIs)
// src/shared/ui/ComponentName.tsx
interface ComponentNameProps {
// required props first
// optional props last with ?
className?: string
}
export default function ComponentName({ className }: ComponentNameProps) {
return (
<div className={cn(className)}>
{/* content */}
</div>
)
}"use client"
import { useState } from "react"
import { cn } from "@/shared/utils/cn"
interface ComponentNameProps {
className?: string
}
export default function ComponentName({ className }: ComponentNameProps) {
const [state, setState] = useState(...)
return (
<div className={cn(className)}>
{/* content */}
</div>
)
}- Identify the correct layer and folder for this component
- Create the component file with the template above
- If placed in
shared/ui/, export it fromsrc/shared/ui/index.ts - Confirm file path and export with the user