pageweave/resources

Component Authoring

Write reusable HTML components in daisyUI semantics — self-contained, theme-aware, documented.

· .md · source ↗

Author components worthy of a library: each one is a self-contained HTML block that renders correctly inside any daisyUI theme and teaches the reader something.

Anatomy of a library component

  1. Name — concrete, not cute ("Editorial Hero", not "Hero Deluxe").
  2. Subtitle — what it is in one line.
  3. Code — complete HTML, no external dependencies beyond Tailwind/daisyUI.
  4. Preview — the same markup rendered live.
  5. Notes — usage, rules, variations.

Code rules

Preview rules

The preview renders inside the live site's theme — which is exactly the point: if your component looks wrong in the preview frame, it will look wrong in users' themes. Keep previews compact (constrain widths, trim list lengths) but never alter the structure between code and preview_html.

Notes rules

Anti-patterns