Skip to content

An open source design system that's fully customizable and agent ready

TypeScript
1.8 KB
Raw Blame

Create Astryx Component

Create a new Astryx component following the established protocols.

Component Name

$ARGUMENTS

Instructions

Follow the full component lifecycle documented on the Astryx wiki:

Quick reference

  • Read the spec thoroughly — it's the contract
  • Study sibling components in the same family for patterns
  • Create files in packages/core/src/{ComponentName}/:
    • {ComponentName}.tsx — main component
    • {ComponentName}.test.tsx — unit tests
    • {ComponentName}.doc.mjs — typed docs (ComponentDoc)
    • index.ts — public exports
  • Create apps/storybook/stories/{ComponentName}.stories.tsx
  • Create showcase block in packages/cli/templates/blocks/components/{ComponentName}/:
    • {ComponentName}Showcase.tsx — visual preview (renders the component in a representative state)
    • {ComponentName}Showcase.doc.mjs — must set isShowcase: true and componentsUsed: ['{ComponentName}']
  • Wire up: add to packages/core/src/index.ts
  • Run node scripts/sync-exports.js to update package.json exports
  • Run pnpm build && pnpm test && pnpm lint

Key conventions