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.
Custom Elements Manifest
Section titled “Custom Elements Manifest”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.
Reference Format
Section titled “Reference Format”Each component’s API reference includes:
| Section | Description |
|---|---|
| Properties | All @property() decorated fields with types and defaults |
| Attributes | HTML attributes with reflection behavior |
| Methods | Public methods available on the element |
| Events | Custom events dispatched by the component |
| Slots | Named and default slots for content projection |
| CSS Parts | Shadow DOM parts exposed for external styling |
| CSS Properties | CSS custom properties for theming |
Example Entry
Section titled “Example Entry”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 radiusGenerating the Reference
Section titled “Generating the Reference”The API reference will be auto-generated when the component library is implemented in Phase 2. The generation pipeline:
- Source code JSDoc comments
- CEM Analyzer extracts metadata
- Custom Astro plugin renders reference pages
- Storybook ArgsTable uses same CEM data
Component Catalog
Section titled “Component Catalog”For the planned component list and specifications, see Components Overview.