HTMX UI
Esc

    Type to search pages and sections.

    You're viewing the docs for v0.1.
    The latest version is next. Go to this page in next.

    Components

    Components

    Every component is a set of CSS classes, plus a small behaviour where one is needed. Pick one to see live examples and the full class reference.

    View .md

    Anatomy of a component#

    Each component has its own directory, htmx-ui/components/<name>/ (packages/ui/src/components/<name>/ in the repository), holding:

    • <name>.css: classes in @layer components, built from token utilities with @apply.
    • <name>.ts (optional): an init<Name>(root) function that wires up [data-<name>] elements once each, with <name>.test.ts beside it.
    • <name>.html (optional): a Nunjucks macro for markup that is tedious to write by hand.