Skip to content
HOZUUI0.1.0
Menu

Components · 22 in 13 files

Every piece. Live.

Each one is drawn from the kit’s current source, in the kit’s own theme. Switch between Grain and Joinery to see both. What you see is what lands in your ui/ folder.

Theme

Actions

Button

Use it for the actions of a form or toolbar. The one main action is primary; the rest are secondary or quiet.

ui/button.tsgrain

size sm

size md

size icon

primary

secondary

quiet

destructive

with an icon

busy

disabled

opens a dialog

  • intentvariant

    primary · secondary · quiet · destructive

    default: secondary

  • sizevariant

    sm · md · icon

    default: md

  • typeprop

    button · submit

    default: button

  • name, valueprop

    text, sent with the form

    default: —

  • disabledprop

    true · false

    default: false

  • busyprop

    true · false (aria-busy)

    default: false

  • labelprop

    text for screen readers; needed with size icon

    default: —

  • commandfor, commandprop

    opens a dialog or popover without JavaScript

    default: —

  • iconslot

    an Icon before the text

    default: —

  • pressevent

    on click

    default: —

Lives in
ui/button.ts
Install
npx hozu add component ui Button --from official
With DevTools
Assets → Hozu UI → Button, then Place it next to the part you selected.

Forms

Input

Use it for one line of text, an email, a number or a date. Put it in a Field so it has a label.

ui/input.tsgrain

size sm

size md

size lg

invalid

disabled

type date

  • sizevariant

    sm · md · lg

    default: md

  • nameprop

    the form field name

    default: required

  • typeprop

    text · email · password · number · search · url · tel · date

    default: text

  • id, value, placeholder, autocompleteprop

    text

    default: —

  • required, disabledprop

    true · false

    default: false

  • minlength, maxlengthprop

    a number

    default: —

  • invalidprop

    true · false (aria-invalid)

    default: false

  • describedbyprop

    the id of the hint or error

    default: —

  • labelprop

    text for screen readers, when no Field labels it

    default: —

  • inputevent

    on every keystroke

    default: —

Lives in
ui/input.ts
Install
npx hozu add component ui Input --from official
With DevTools
Assets → Hozu UI → Input, then Place it next to the part you selected.

Forms

Field

Use it for a labelled control with a hint and an error message that screen readers announce.

ui/field.tsgrain

with a hint

Shown on invoices.

with an error

Use an address with an @.

  • forprop

    the control’s id

    default: required

  • labelprop

    text

    default: required

  • hintprop

    text under the control

    default: ""

  • errorprop

    text, or null for none

    default: null

  • errorIdprop

    the id the control’s describedby points to

    default: required

  • controlslot

    an Input, a select, a textarea

    default: —

Lives in
ui/field.ts
Install
npx hozu add component ui Field --from official
With DevTools
Assets → Hozu UI → Field, then Place it next to the part you selected.

Data display

Badge

Use it for a status word next to a row or a title. Its tone is a prop, so it can come from your data.

ui/badge.tsgrain

shape pill · every tone

DraftShippedPaidOverdueFailedNew

shape square

v0.1.0LiveBeta
  • shapevariant

    pill · square

    default: pill

  • toneprop

    neutral · info · success · warning · danger · accent (may come from data)

    default: neutral

  • labelprop

    text

    default: required

Lives in
ui/badge.ts
Install
npx hozu add component ui Badge --from official
With DevTools
Assets → Hozu UI → Badge, then Place it next to the part you selected.

Data display

Card

Use it for a boxed group with a title: a settings block, a summary, a table with its header.

ui/card.tsgrain

title, description, actions

Team

3 people

Ada, Grace and Linus can edit every page of this project.

no title

Free plan

3 of 5 projects used.

  • padvariant

    normal · none (for a table inside)

    default: normal

  • titleprop

    text; no header when empty

    default: ""

  • descriptionprop

    text under the title

    default: ""

  • actionsslot

    buttons in the header

    default: —

  • footerslot

    a row under the body

    default: —

  • childrencontent

    the body

    default: —

Lives in
ui/card.ts
Install
npx hozu add component ui Card --from official
With DevTools
Assets → Hozu UI → Card, then Place it next to the part you selected.

Data display

Metric

Use it for a number that matters, with a label and how it changed.

ui/metric.tsgrain

trend up

Revenue

$48,210

+12.4%vs last month

trend down

Open orders

27

−3since Monday

flat, no delta

Customers

1,204

  • labelprop

    text

    default: required

  • valueprop

    text, e.g. ui.format.number(…)

    default: required

  • deltaprop

    text, e.g. +12.4%

    default: ""

  • trendprop

    up · down · flat

    default: flat

  • periodprop

    text after the delta

    default: ""

  • sparkslot

    a small chart under it

    default: —

Lives in
ui/metric.ts
Install
npx hozu add component ui Metric --from official
With DevTools
Assets → Hozu UI → Metric, then Place it next to the part you selected.

Data display

Table · Tr · Th · Td

Use it for rows and columns of records. Numbers align to the end; the first column can be strong.

ui/table.tsgrain

Orders

This week

OrderCustomerStatusTotal
#1042Ada LovelacePaid$1,280.00
#1041Grace HopperShipped$342.50
#1040Linus TorvaldsOverdue$96.00
  • headslot (Table)

    one Tr of Th

    default: —

  • childrencontent (Table)

    Tr rows, usually ui.each

    default: —

  • alignvariant (Th, Td)

    start · end (numbers)

    default: start

  • emphasisvariant (Td)

    normal · strong · muted

    default: normal

Lives in
ui/table.ts
Install
npx hozu add component ui Table --from official
npx hozu add component ui Tr --from official
npx hozu add component ui Th --from official
npx hozu add component ui Td --from official
With DevTools
Assets → Hozu UI → Table, then Place it next to the part you selected.

Feedback

Notice

Use it for a short message after an action: “Saved.” As a toast it sits at the bottom right of the window.

ui/states.tsgrain

inline · tone info

Saved. Your changes are live.

inline · tone danger

Could not save. Try again.

  • placementvariant

    toast (fixed, bottom right) · inline

    default: toast

  • messageprop

    text

    default: required

  • toneprop

    info · danger

    default: info

  • closeLabelprop

    text for the close button

    default: Dismiss

  • dismissevent

    the close button

    default: —

Lives in
ui/states.ts
Install
npx hozu add component ui Notice --from official
With DevTools
Assets → Hozu UI → Notice, then Place it next to the part you selected.

Feedback

EmptyState · Problem

Use it for a list with nothing in it yet, and a part of the page that could not load.

ui/states.tsgrain

EmptyState · size inline

No orders yet

New orders show up here as soon as they are placed.

Problem

  • sizevariant (EmptyState)

    inline · page

    default: inline

  • titleprop

    text

    default: required

  • bodyprop

    text

    default: ""

  • actionslot

    what to do next

    default: —

Lives in
ui/states.ts
Install
npx hozu add component ui EmptyState --from official
npx hozu add component ui Problem --from official
With DevTools
Assets → Hozu UI → EmptyState, then Place it next to the part you selected.

Navigation

Pagination

Use it for previous and next pages of a long list, as plain links that work without JavaScript.

ui/nav.tsgrain

first page

a middle page

  • summaryprop

    text, e.g. 1–10 of 42

    default: required

  • prevHref, nextHrefprop

    a link, or null when there is none

    default: required

  • prevLabel, nextLabelprop

    text

    default: Previous, Next

  • labelprop

    the navigation’s name

    default: Pagination

Lives in
ui/nav.ts
Install
npx hozu add component ui Pagination --from official
With DevTools
Assets → Hozu UI → Pagination, then Place it next to the part you selected.

Overlays

Dialog

Use it for a question or a short form on top of the page. A destructive action asks here first.

ui/dialog.tsgrain

try it: opens as a modal, no JavaScript needed

Delete this project?

This cannot be undone.

Its pages, data and members are removed. On this page nothing is deleted.

  • sizevariant

    sm · md · lg

    default: md

  • idprop

    what a button’s commandfor names

    default: required

  • titleprop

    text

    default: required

  • descriptionprop

    text under the title

    default: ""

  • openprop

    bound to the machine: opens as a modal

    default: —

  • footerslot

    the buttons

    default: —

  • closeevent

    Escape, the backdrop, a close button

    default: —

Lives in
ui/dialog.ts
Install
npx hozu add component ui Dialog --from official
With DevTools
Assets → Hozu UI → Dialog, then Place it next to the part you selected.

Icons

Icon

Use it for an icon in a button, a menu or a list. Lucide’s paths and Hozu’s own, copied as data: no icon library ships.

ui/icon.tsgrain

ui/icons/lucide.ts

  • arrowDown
  • arrowUp
  • check
  • chevronDown
  • chevronLeft
  • chevronRight
  • chevronUp
  • circleAlert
  • download
  • ellipsis
  • externalLink
  • funnel
  • inbox
  • info
  • lock
  • menu
  • minus
  • packageIcon
  • pencil
  • plus
  • search
  • trash
  • x

ui/icons/hozu.ts

  • tenon
  • machine
  • contract
  • request
  • island
  • sizevariant

    sm · md

    default: sm

  • dprop

    an SVG path from ui/icons/lucide.ts or ui/icons/hozu.ts

    default: required

Lives in
ui/icon.ts
Install
npx hozu add component ui Icon --from official
With DevTools
Assets → Hozu UI → Icon, then Place it next to the part you selected.