{ComponentName}

June 7, 2026 · View on GitHub

One-line purpose — what this component is for.

Read Component Anatomy first — it defines the shared parts (Container / Content / Slots), the 5-size scale, and the 6-state model that this template assumes.

Contract

Short description of what the component does and what problem it solves. 2-3 sentences.

Anatomy

Container
└─ Content
   ├─ Element 1
   ├─ Element 2
   └─ Element N
  • Container — responsible for: padding, border, radius, background, dimensions
  • Content — responsible for: gap management, child alignment
  • Elements — individual atomic parts (icon, label, etc.)

API

Inputs

NameTypeDefaultDescription
size'xs' | 'sm' | 'md' | 'lg' | 'xl''md'Component size from the sizing scale

Outputs

NamePayloadFires when
valueChangestringUser changes the value

Content projection

  • ng-content — default slot for the label
  • [kpSlotName] — named slot for additional content

Variants

DimensionValuesNotes
Sizexs, sm, md, lg, xlAll 5 unless otherwise specified
Variantdefault, subtle, outline, ghostVisual style
Colorprimary, danger, neutralSemantic role
Staterest, hover, active, focus, disabled, loadingAll interactive components

States

StateBehavior
restDefault idle state
hoverPointer is over the component
activePressed / mid-click
focusKeyboard focus ring visible
disabledNot interactive, reduced contrast, aria-disabled="true"
loadingShows spinner, preserves focus, aria-busy="true", pointer-events disabled

Accessibility

  • Role: button (or the appropriate role)
  • Keyboard: Space and Enter activate the component
  • Focus: visible 2px ring, offset 2px
  • ARIA:
    • aria-busy when loading
    • aria-disabled when disabled
    • aria-label required when no visible text
  • Screen reader: announces role, state, and label

Do / Don't

Do

  • Use MD as the default size
  • Pair components of the same size in forms
  • Use danger color only for destructive actions
  • Always provide a label, even for icon-only variants (via aria-label)

Don't

  • Don't mix sizes in a single row (e.g., MD button next to SM input)
  • Don't use danger for generic errors — it's for destructive user actions
  • Don't override internal padding or radius via custom CSS — use component props
  • Don't nest interactive components (button inside button)

References

Changelog

  • 0.1.0 — Initial component