Create component

From leboncoin/spark-web · View interactive version

Create component is an AI agent skill from the GitHub repository leboncoin/spark-web. Create a new Spark UI component with complete file structure including component, styles, tests, stories, and documentation. Use when the user wants to create a new component or add a component to the design system.

How to use this skill

Skill file

Create Component

Create a new Spark UI component following the project's standards and file structure.

When to Use

Instructions

  1. Determine component location: Components go in packages/components/src/<component-name>/
  1. Create the file structure:

```

component-name/

├── ComponentName.tsx # Main component

├── ComponentName.styles.tsx # Styling with CVA

├── ComponentName.test.tsx # Unit tests

├── ComponentName.stories.tsx # Storybook stories

├── ComponentName.doc.mdx # Documentation

├── index.ts # Exports

└── variants/ # Style variants (if applicable)

```

  1. Component Implementation:
  1. Styling:
  1. Tests:
  1. Stories:
  1. Documentation:
  1. Exports:
  1. For Compound Components:
  1. Verify:

Examples

Reference existing components in packages/components/src/ for patterns:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.