Skip to main content
Hugs
registers the kit’s elements. They follow the Hub’s font, colours (light and dark) and spacing, are keyboard-reachable and labelled, and emit a change event with the new value in event.detail. form and approval are built only from these. The kit is optional — a page can draw everything itself.

<cliq-field>

One field, with its label, help, required mark and problem.

<cliq-fields>

A list of fields, required first, then optional — the layout of form.
change carries { name, value }.

<cliq-choice-group>

Mutually exclusive choices, as segmented buttons — Approve / Reject, OK / Not OK.
Each choice is { value, label?, tone? }; tone: 'danger' draws it red. change carries the chosen value.

<cliq-file>

An upload slot: a button that asks the host for the person to pick a file, the uploaded files, and remove. Under the label it says what the slot takes, from the slot’s definition — “CSV · optional · up to 5 MB”, “Images, PDF or text” — and a refused file says which types are accepted.
Upload errors — too large, the wrong type, too many at once — are shown by the element.

<cliq-attachment>

One file: its name, type and size, Preview and Download.
  • Preview shows text and markdown (the first 200 lines, at most 256 KB) and images inline; other files (PDF, binaries) only download. A Hug’s only previewable attachment opens by itself.
  • preview="none" turns previews off.
  • The file is read through the host, with the viewer’s permissions; a file they may not read says so.

<cliq-markdown>

Sanitized markdown: headings, emphasis, lists, code, quotes, tables (GitHub style, with column alignment), links (opened through the host). Text is only ever text: HTML in markdown is shown, not run.

<cliq-context>

Context blocks — what form shows with its question: markdown, artifact (a file), checks (results), and transcript (an earlier conversation).

<cliq-problems>

A list of problems, each linked to its field.

Theme

The host passes the Hub’s colours, and the kit uses them as CSS variables — use them in your own CSS too, so your page follows light and dark:
The kit embeds the Hub’s font (Geist) as inlined data, so the bundle stays text. A page that doesn’t use the kit can import just the font: @getcliqio/hug-frontend/ui/fonts.css. Layout is fluid from 320 px wide; the frame’s height follows the page.

Accessibility and language

The kit’s elements are reachable by keyboard, have visible focus and labels, and announce problems; each is checked with axe in the Hub’s light and dark themes, and the themes’ colours meet WCAG AA contrast. Your own controls must do the same — label every input, and use role="alert" for problems. cliq hug dev checks your page with axe as you work (see Testing). The viewer’s locale drives date and number formatting in the default view.