Skip to content

API Reference

apps/docs/src/content/docs/api-reference/overview Click to copy
Copied! apps/docs/src/content/docs/api-reference/overview

The WC-2026 API reference is auto-generated from the Custom Elements Manifest (CEM), which serves as the single source of truth for all component APIs.

The CEM is generated from JSDoc comments in component source code using the @custom-elements-manifest/analyzer. This ensures documentation is always in sync with implementation.

Each component’s API reference includes:

SectionDescription
PropertiesAll @property() decorated fields with types and defaults
AttributesHTML attributes with reflection behavior
MethodsPublic methods available on the element
EventsCustom events dispatched by the component
SlotsNamed and default slots for content projection
CSS PartsShadow DOM parts exposed for external styling
CSS PropertiesCSS custom properties for theming
wc-button
=========
Properties:
variant: 'primary' | 'secondary' | 'ghost' (default: 'primary')
size: 'sm' | 'md' | 'lg' (default: 'md')
disabled: boolean (default: false)
Events:
wc-click: { originalEvent: MouseEvent }
Slots:
(default): Button label content
CSS Parts:
button: The inner <button> element
CSS Properties:
--wc-button-bg: Background color
--wc-button-color: Text color
--wc-button-border-radius: Border radius

The API reference will be auto-generated when the component library is implemented in Phase 2. The generation pipeline:

  1. Source code JSDoc comments
  2. CEM Analyzer extracts metadata
  3. Custom Astro plugin renders reference pages
  4. Storybook ArgsTable uses same CEM data

For the planned component list and specifications, see Components Overview.