Create a new STUIC component named $ARGUMENTS.
Before Starting
- •Read
AGENTS.md- Contains ALL coding conventions for this project - •Read
src/lib/components/Button/as the canonical reference implementation
Files to Create
Create these files at src/lib/components/$ARGUMENTS/:
1. $ARGUMENTS.svelte
Must include:
- •
<script lang="ts" module>block with exported Props interface - •Props extending appropriate HTML element attributes
- •Universal props:
unstyled,class,el = $bindable() - •Svelte 5 runes:
$props(),$derived(),$bindable() - •
twMerge()for class prop merging - •Data attributes for variants/states (not classes)
2. index.ts
ts
export { default as $ARGUMENTS } from "./$ARGUMENTS.svelte";
export type { Props as $ARGUMENTSProps } from "./$ARGUMENTS.svelte";
3. index.css (if component needs theming)
Must follow CSS structure from AGENTS.md:
- •
@theme inlineblock with component tokens - •Tokens reference global tokens as fallbacks
- •Pattern:
--stuic-{component}-{property}-{state} - •NO
-darksuffix (use.dark {}selector)
4. README.md
Include:
- •Component description
- •Props table with types/defaults/descriptions
- •Usage examples
- •CSS variables reference (if applicable)
After Creation
- •Import CSS in component:
import './index.css'; - •Add CSS import to
src/lib/index.css - •Add export to
src/lib/index.ts - •Run
npm run checkto verify no type errors