Guide.

How to use it in Astro, React and Liquid, how to build a theme and what a project needs to integrate it. The code is private until v1; what you see here is its real API.

Introduction

Cuenca is CSS on native HTML, with its behavior in small, framework-free modules. Its three wrappers write the same HTML: a button from Astro, one from React and one from Liquid look, move and sound the same.

It isn’t on npm until v1. Until then it lives in a private repo, and Flouvia’s projects bring it in with cuenca:sync, like Gota.

Integrating it

What a project needs to integrate Cuenca:

  1. Bring it in with cuenca:sync: it copies dist/ and src/ from its repo to src/vendor/cuenca/, which is never edited by hand.
  2. Point @flouvia/cuenca at that copy with an alias in tsconfig.json: the code imports the way it will import from the package, and with v1 the alias goes away.
  3. Declare the layer order once, before anything else: Cuenca sits below the project’s components and utilities, as Tailwind v4 expects.
  4. Call guard() once per page, on load: what’s loading doesn’t respond, and the live region for announcements is born (if it were born with the first announcement, screen readers would miss it).
  5. Wire up sound: the button writes data-sound and showDone() requests success with the cuenca:sound event; the surface that runs Onda plays them.
  6. Change the theme, never the craft: the touch target, the focus and the springs are the same in every project.
JSON
{
  "compilerOptions": {
    "paths": {
      "@flouvia/cuenca/*": ["./src/vendor/cuenca/*"]
    }
  }
}
CSS
@layer theme, base, cuenca, components, utilities;
@import '@flouvia/cuenca/cuenca.css';

The CSS

One file brings Cauce, Flouvia’s theme, the foundations, the base and every component. Another theme joins with its own file.

CSS
@import '@flouvia/cuenca/cuenca.css';
@import '@flouvia/cuenca/themes/light-example.css';

You pick a theme with data-cuenca-theme on any container; without it, Flouvia’s applies.

HTML
<section data-cuenca-theme="light-example">…</section>

Everything lives in @layer cuenca, so whatever the project writes outside a layer always wins.

Astro

The wrapper ships as source and Astro compiles it on its own. It renders on the server, with no JavaScript on the page.

See the work Close
Astro
---
import Button from '@flouvia/cuenca/astro/Button.astro';
---
<Button appearance="filled" icon="plus">Create project</Button>
<Button href="/work" trailingIcon="arrow-right">See the work</Button>
<Button icon="close" label="Close" />

React

The same props and the same HTML as in Astro.

Close
React
import { Button } from '@flouvia/cuenca/react';

export function Toolbar() {
  return (
    <>
      <Button appearance="filled" icon="plus" onClick={create}>Create project</Button>
      <Button appearance="plain" destructive>Remove</Button>
      <Button icon="close" label="Close" />
    </>
  );
}
  • It has no state or effects: without loading, it also works in a Server Component.
  • With loading it doesn’t call onClick or submit the form, so it goes in a client component.
  • An icon-only button without label doesn’t compile.
  • In Next.js, transpilePackages: ['@flouvia/cuenca'].

Liquid

In a Shopify theme, copy cu-button.liquid and cu-icon.liquid to snippets/, and cuenca.css to assets/. The props are the same, in snake_case.

Close
Liquid
{% render 'cu-button', label: 'Add to cart', appearance: 'filled', size: 'large', width: 'full', type: 'submit' %}
{% render 'cu-button', label: 'Close', icon: 'close', icon_only: true %}

The same HTML

The three wrappers write exactly this, and a test compares them across 51 combinations of props.

HTML
<button class="cu-button" type="button" data-appearance="filled" data-size="medium">
  <svg class="cu-icon" aria-hidden="true" viewBox="0 0 24 24">…</svg>
  <span class="cu-label">Create project</span>
</button>

Every prop, one by one

The behavior

guard() runs once per page. setLoading shows the spinner, locks the width and tells screen readers; showDone brings in the checkmark, announces it, asks for Onda’s success and releases the width when it ends. Press the button.

JavaScript
import { guard, setLoading, showDone } from '@flouvia/cuenca/behavior';

guard();
setLoading(button, true, 'Saving');
await save();
button.innerHTML = done;
await showDone(button, 'Saved');
button.innerHTML = before;
FunctionWhat it does
guard(root?) Once per page, on load: stops clicks and Enter on whatever is loading (form submission too), creates the live region for announcements and makes iOS respond on press. Returns how to remove it.
setLoading(button, loading, message?) The spinner in place of the content, with the width locked, aria-busy and aria-disabled: it stays in the keyboard order. With false, it goes back to how it was.
showDone(button, message?, hold?) The checkmark comes in with bloom, announces and asks for Onda’s success. It resolves after hold ms (1500 by default), when it releases the width.
announce(message) Tells screen readers through the page’s polite live region.

It’s a dependency-free module: it runs the same in a Shopify theme. In React, loading draws the spinner and blocks the click; the announcement and the done width are requested the same way, with setLoading(ref.current, …) and showDone(ref.current, …).

The sound

Cuenca doesn’t bundle Onda: the button declares which sound it plays and the surface that runs Onda plays it. People can turn the sound off, but not change it.

WhenWhat plays
A click Its data-sound (sound in the wrappers; none is silence). Without it, the surface decides: on the site, tap; in the portal and Ops, nothing.
A toggle on when it turns on and off when it turns off.
Loading and done Nothing while loading and success when done, which showDone() asks for with the cuenca:sound event.
Disabled Nothing.
JavaScript
import { play } from '@flouvia/onda';

document.addEventListener('cuenca:sound', (event) => play(event.detail.sound));

Themes

A theme defines the same roles as Flouvia’s, with the project’s color, type and shape.

Flouvia Dark. The reference.

Light example An example client.

The light theme uses DM Sans. This site loads no external fonts, so here it renders in the system font.

  1. Themes live with the tokens, in flouvia-design. Copy tokens/themes/light-example.json to tokens/themes/<client>.json, put its palette in a group of its own and point each cu.* role at it. Its chart ramp comes from its color, with the same rule.
  2. There, npm run build and npm test: the contrast test measures every promise (4.5:1 for text and 3:1 for the rest) on all four layers, painted in 8 bits. If a color falls short, the color changes, never the test.
  3. Here, npm run tokens:sync and npm run build: out comes dist/themes/<client>.css, with the selector [data-cuenca-theme="<client>"], loaded after cuenca.css.

A theme’s type is the system’s or the client’s. Flouvia Blue and Flouvia’s own typeface belong to the brand: only Flouvia’s theme uses them. What a theme sets and what travels to all of them, in the Open Water Design Themes guide.

The roles of both themes

W3C tokens

The look lives in Open Water Design’s tokens, in the W3C Design Tokens Community Group format (DTCG 2025.10) and on three levels. Their single source is flouvia-design: out of it come the CSS, a TypeScript module, SwiftUI, Jetpack Compose and the Figma variables, and Cuenca copies them with tokens:sync.

  • The scale: the graphites and the colors in OKLCH with their fallback hex, spacing, radii, type, the grid and glass. Nobody uses it directly.
  • The roles of each theme and each density, as --cu-* variables: what a theme or a density changes.
  • Each component’s tokens (cu.button.*, cu.field.*…): they point at the roles and are rarely touched.
FamilyVariables
Layers --cu-layer-sunken, -base, -raised and -overlay; --cu-layer-next, for what rests on something.
Text --cu-text, --cu-text-2, --cu-text-3 and --cu-text-disabled.
Accent, link and focus --cu-accent, --cu-accent-fill with --cu-on-accent, --cu-link and --cu-focus.
Fills and lines --cu-fill-1 to --cu-fill-4, --cu-separator and --cu-border.
Status --cu-success-*, --cu-warning-*, --cu-danger-* and --cu-info-*, each with -text, -text-overlay, -solid, -fill and -fill-hover.
Action and brand --cu-action, --cu-action-hover and --cu-on-action; --cu-danger with --cu-on-danger; --cu-brand and --cu-focus-on-brand.
Depth --cu-veil; --cu-shadow-card, -menu, -sheet and -modal; --cu-glass-thin, -regular and -thick, with --cu-glass-blur and --cu-glass-saturate.
Charts --cu-chart-1 to --cu-chart-8, in their order, and --cu-chart-seq-100 to --cu-chart-seq-900.
Shape and type --cu-radius-small, -inner, -field, -menu, -sheet and -control; --cu-font.
Density --cu-type-<style>-size, -line-height, -weight and -tracking, from large-title to caption2; --cu-row-height, --cu-cell-padding and --cu-touch-target.
Spacing and grid --cu-space-2 to --cu-space-96; --cu-grid-columns, -margin and -gutter, which change at 768, 1024 and 1512.

The container says which layer it’s on and which density it asks for:

HTML
<div class="sheet" data-cuenca-layer="raised">          <!-- inside, --cu-layer-next is overlay -->
  <div class="menu" data-cuenca-layer="overlay">…</div>  <!-- here status text steps up -->
</div>
<main data-density="compact">…</main>                   <!-- one step down, fine pointer only -->

Each theme comes with what changes with the preferences already resolved: with prefers-contrast: more, text 2 and 3 rise; with reduced transparency or without backdrop-filter, glass is its opaque fallback. What each role is and when to use it lives in the Open Water Design foundations: Color, Typography, Spacing and grid, Shape, Elevation and materials, Themes and Data visualization.

A role from Flouvia’s theme, in tokens/themes/flouvia.json:

JSON
"action": {
  "$type": "color",
  "$value": "{color.white}"
}

And the button token that reads it, in tokens/components/button.json:

JSON
"filled": {
  "$type": "color",
  "background": { "$value": "{cu.action}" }
}

Craft isn’t a token: the touch target, the focus ring and Cauce’s springs live in the component’s CSS, and no theme changes them.

Button

Cuenca’s first component and the one used most. Its decisions (what it’s called, how big it is, how it responds) are the basis for the rest.

Available: in use across Flouvia: the site, the portal and Ops. Code in Cuenca, private until v1.

Anatomy

Five parts, always in the same order. The CSS tells them apart by their place, with no extra classes.

  1. Container .cu-button

    A <button> or, with href, an <a>. The capsule belongs to the Flouvia theme; another theme brings its own shape.

  2. Leading icon .cu-icon

    Optional, from Gota. On its side, padding drops by 2 px.

  3. Label .cu-label

    Verb and object, on one line.

  4. Trailing icon .cu-icon

    After the label: the arrow, which moves 3 px on hover.

  5. Focus ring :focus-visible

    Solid, 2 px wide and 2 px apart, keyboard only.

Options

The Astro and React props; in Liquid they share the name unless noted. All three wrappers write exactly the same HTML.

minismallmediumlarge filled tinted plain destructive icon only
PropValuesDefaultNotes
appearance filled · tinted · plaintintedA single filled action per view.
size mini · small · medium · largemediumSee the sizes.
destructive true · falsefalseChanges the color, never the style.
icon a Gota icon—Before the label; on icon-only, its icon.
trailingIconLiquid: trailing_icon a Gota icon—The arrow goes last and moves forward on hover.
childrenAstro: the content · Liquid: label text—The visible text.
labelLiquid: label with icon_only: true text—Icon-only: required, it’s the aria-label. In React it won’t compile without it.
width auto · fullautofull for phones, stacked.
href URL—With href, an <a>: what takes you to another page is a link.
pressed true · false—A toggle, with aria-pressed: on takes the filled style. Only without href.
loading true · falsefalseThe spinner in place of the content, without changing width. In React, the click doesn’t reach onClick or submit the form.
disabled true · falsefalseOn a link: aria-disabled and no href.
sound an Onda sound · noneper surfaceWrites data-sound.
type button · submit · resetbuttonOnly without href. By default it doesn’t submit forms.
classReact: className classes—Added after cu-button.

Sizes

With a finger, the touch target never drops below 44 px, not even on mini. On the icon side padding drops by 2 px; icon-only is a circle as tall as its size.

SizeHeightTypePaddingIconGapIcon onlyFor
mini 2812 / 5001012416Actions inside a table row
small 3213 / 5001214618Rows, dense bars and menus
medium 4414 / 5002016624Almost everything
large 5217 / 5002420828The action of a page or form

States

What it shows at each moment. Loading isn’t disabled: it keeps its color and its place in the keyboard order.

Save Default
Save Hover
Save Pressed
Save Focus
Save Disabled
Save Loading
Saved Done
StateSupportHow it looks
Default YesThe style with the theme’s tokens.
Hover YesOnly with a fine pointer and never when disabled: it grows to 1.04 and shifts tone. Full width, 1.01.
Pressed YesIt gives to 0.95 and, on release, returns with its bounce. Full width, 0.99. On iOS too: guard() wakes it up.
Keyboard focus YesA solid ring, 2 px wide and 2 px apart, keyboard only (:focus-visible). On a brand surface it changes color.
Disabled YesNo opacity: the fill turns to --cu-fill and the text to the tertiary tone; plain has no fill. On a link, aria-disabled and no href.
Loading YesThe spinner in place of the content, with a fixed width, aria-busy and aria-disabled: it stays in the keyboard order and tells screen readers.
Done YesThe check arrives with bloom, tells screen readers and asks for Onda’s success. showDone() sets it, never a prop.
On YesA toggle: with aria-pressed="true" it takes the filled style.

Behaviors

What it does on its own, without the page having to ask.

  • Icon only With a label
    Full width

    Minimum width

    There’s no written number: the label and its padding give the width, and it’s never set by hand. Icon-only is a circle as tall as its size, and width="full" takes it across the whole width.

  • Label overflow

    Always on one line. If it doesn’t fit, an ellipsis, and screen readers read the full text. It’s a sign to write it shorter.

  • Press it: it saves, finishes and comes back, without changing width.

    Loading without changing width

    setLoading() locks the width it had before showing the spinner, and showDone() holds it for 1.5 s with the check. If the done label is longer, the button grows: “Saved” for “Save changes.”

  • With a finger
    44 px
    With a fine pointer
    28 px

    Touch target on touch only

    With a finger, an invisible ::after takes every size to 44 px. With a fine pointer, the target is the button itself, so it never steals a neighbor’s click. On touch, 16 px between two mini and 12 between two small.

Usage

When and how to use it, with an example of what to do and what not to.

Use a single filled action per view

It’s the high-attention one, what matters most right then. The rest step down to tinted or plain.

Do: The action that matters, filled; cancel, plain.
Don’t: Two filled actions compete and neither stands out.

Add an icon only when it clarifies

A Gota icon that says the same as the verb helps people recognize the action. One that only decorates gets in the way.

Do: The + for create and the plane for send say the same as their verb.
Don’t: A bolt says nothing about saving.

On phones, stack them full width

Two actions side by side don’t fit on a phone without getting cut. With width="full", one above the other, each one reads in full.

Do: Stacked, full width.
Don’t: Side by side, the label gets cut.

Content

The label says what will happen, in the words of the person using it.

  • Verb and object

    It says what will happen: “Create project,” “Save changes,” “Delete client.”

  • Short, no period

    One line, no final period or exclamation marks, in sentence case.

  • Destructive says what it destroys

    “Delete client,” never “OK” or “Yes.”

  • In the page’s words

    The button repeats the verb people already read: if the title says “Invite,” the button doesn’t say “Send.”

Do

  • Create project
  • Save changes
  • Delete client

Don’t

  • New project
  • Save the changes.
  • OK

Languages

It’s written in Spanish and English from each page’s copy, never inline.

  • Spanish grows

    The same label usually takes more room in Spanish than in English. That’s why the button never has a fixed width and the label is written short in both languages.

  • Right to left

    In a language read right to left, the button mirrors: the leading icon moves to the right and Gota’s arrow points the other way, because it shows where you’re going. The +, the check and the loading spinner don’t mirror: they have no direction.

Español English
  • 0%
  • +17%
  • +23%
  • +25%
  • +64%
Extra letters in Spanish
Left to right
Right to left

Accessibility

WCAG 2.2 AA is the floor. Contrast is measured from the tokens on every change.

Keyboard

KeyWhat it doesWhere focus goes
Tab · Shift + Tab Moves focus onto or off the button.To the next or previous one in the page order. While loading, it stays in that order.
Enter Activates the button; on a link, follows it.Stays on the button. If it opens a sheet or a dialog, it moves there; when that closes, it comes back.
Space Activates the button. On a link it scrolls the page, like on any link.Same as Enter.
Enter or Space while loading Nothing: guard() stops the click and the form submission.Stays on the button.

WCAG 2.2

Every criterion that touches the component, with its level and how it meets it. The ones not listed don’t apply to it or are handled by the page.

RequirementCriterionLevelMeetsNotes
Non-text Content 1.1.1AYesIcon-only requires label, its accessible name; icons carry aria-hidden.
Info and Relationships 1.3.1AYesA native <button> or <a>, with aria-pressed when it toggles.
Use of Color 1.4.1AYesDestructive is red and also says what it destroys: color is never the only signal.
Contrast (Minimum) 1.4.3AAYes4.5:1 or more in every style, state and theme, measured from the tokens on every change. Disabled is exempt and still reaches 4.6:1.
Resize Text 1.4.4AAYesWith browser zoom it grows whole, up to 200% and beyond.
Non-text Contrast 1.4.11AAYesThe focus ring reaches 3:1 or more on the three surfaces where controls live.
Keyboard 2.1.1AYesEverything works with Tab, Enter and Space, with no timing.
No Keyboard Trap 2.1.2AYesFocus moves in and out with Tab; loading doesn’t trap it.
Animation from Interactions 2.3.3AAAYesWith reduced motion nothing grows, gives or moves: tones fade in 200 ms and the spinner pulses.
Focus Visible 2.4.7AAYesA solid ring, 2 px wide and 2 px apart, with :focus-visible; with forced colors, in Highlight.
Label in Name 2.5.3AYesThe accessible name is the visible text: screen readers read the full label even when it’s cut.
Target Size (Enhanced) 2.5.5AAAPartlyWith a finger, 44 × 44 at every size. With a fine pointer the target is the button itself: mini is 28 px tall.
Target Size (Minimum) 2.5.8AAYesNo size drops below 24 px; on touch, 44 with its spacing.
Name, Role, Value 4.1.2AYesNative role, name and state: disabled, aria-pressed, aria-busy and aria-disabled.
Status Messages 4.1.3AAYesLoading and done are announced through a polite live region, without moving focus.

WCAG 2.2 at the W3C

Motion

It moves on drop, Cauce’s piece for what you touch: it responds on the frame of the click and settles with its firm bounce.

Hover over it and press it.
MomentValueSpringSettles in
Hover Grows to 1.04; full width, 1.01drop447 ms
Press Gives to 0.95 and returns; full width, 0.99drop447 ms
Trailing arrow Moves 3 pxdrop447 ms
Done The check arrivesbloom875 ms
Loading One turn per bloom, linearbloom875 ms

With reduced motion nothing grows, gives or moves: tones fade in 200 ms, linear, and the spinner, as a full circle, pulses instead of spinning.

Motion guidelines

Sound

It sounds with Onda without bundling it: the button declares which sound it plays and the surface plays it.

tap send success
Tap one to hear it.
  • On the site, the click

    Without data-sound, the surface decides: on the site, tap plays on click.

  • Hover, on its own

    data-sound is the click’s sound. The site’s near-subliminal hover is requested with its own attribute, data-sound-hover.

  • In the portal and Ops, only actions

    There the button stays quiet and actions play: send, success, error, open and close.

  • Toggle

    on when it turns on and off when it turns off.

  • Loading

    Nothing while it loads and success when it’s done, unless data-sound="none".

  • It turns off, it doesn’t change

    People using the product can turn sound off, but not change it.

Sound guidelines

Text fields

The text field, search, the text area and the select, with the form that validates them. The label always shows above, the error says what’s missing and how to fix it, and Astro, React and Liquid write the same HTML.

280 of 280 left

Astro
---
import Button from '@flouvia/cuenca/astro/Button.astro';
import Form from '@flouvia/cuenca/astro/Form.astro';
import TextArea from '@flouvia/cuenca/astro/TextArea.astro';
import TextField from '@flouvia/cuenca/astro/TextField.astro';
---
<Form lang="en" method="post" action="/api/contact">
  <TextField label="Email" type="email" name="email" placeholder="name@company.com" lang="en" />
  <TextField label="Phone" type="tel" name="phone" country="US" optional lang="en" />
  <TextArea label="Tell us about the project" name="brief" maxLength={280} optional lang="en" />
  <Button slot="actions" type="submit" appearance="filled" size="large" sound="none">Send</Button>
</Form>
React
import { Button, Form, SearchField, Select, TextField } from '@flouvia/cuenca/react';

<SearchField label="Search clients" name="q" hideLabel size="small" shortcut="k" />
<Form lang="en" onSubmit={save} actions={<Button type="submit" appearance="filled" sound="none">Save</Button>}>
  <TextField label="Code" name="code" autoComplete="one-time-code" />
  <Select label="Time zone" name="timezone" options={zones} />
</Form>

Each type sets its keyboard, its autofill and its format. What the page says wins.

FieldAsked withKeyboardAutofillAlso
Email type="email"emailemailRequires a domain with its dot; no autocorrect.
Phone type="tel" and countryteltel-nationalThe country code, from a list inside the field, is sent separately.
Website type="url"urlurlhttps:// as a prefix, outside the value.
Amount inputMode="decimal"decimaloffTabular figures, with two decimals when present. An amount with its format and currency goes in the number field.
Password type="password"—current-passwordThe eye reveals the value without moving the caret.
Code autoComplete="one-time-code"numericone-time-codeSix digits in a single field; pasted spaces are cleaned up.
Search SearchFieldsearchoffThe ×, Escape and the shortcut, always with ⌘ or Ctrl.

The select is for a few options, up to about twelve. One option among many, or from what lives on the server, goes in the combo box.

The combo box

Three sizes, with a 14 radius on all three and search as a capsule:

SizeHeightTypeFor
small 36 px14 px; 16 px on touchConsole bars and filters, next to a small button.
medium 44 px16 pxPortal bars, filters and tables.
large 52 px16 pxForms: contact, sign-in and account setup.

The rule belongs to the platform (required, type, pattern, minlength and maxlength). Cuenca writes the message and decides when it shows:

  • On leaving a field, if something was typed, and on submit, all of them. Never while typing.
  • The error clears as soon as the value is valid, including one from the server (error or setError()).
  • When submitting with errors, focus moves to the first one and the summary above the actions says how many remain. It’s announced once.
  • Everything is required unless it carries optional, which writes “optional” next to the label.
JavaScript
import { fields, setError } from '@flouvia/cuenca/behavior';

fields();
// An error the server knows and the platform doesn't: it clears on its own once fixed
setError(email, 'That email already has an account.');
  • A real <label for>, always visible. Without label, React doesn’t compile and Astro fails.
  • aria-describedby carries the prefixes, the help, the counter and the error. With an error, aria-invalid.
  • Never color alone: ring, icon and text. Every contrast pair is measured on all four layers and in every theme.
  • Sheets and modals sit on the raised layer (data-cuenca-layer="raised", set by the components); what floats on top of them (a menu, a popover, a select’s list) goes on overlay, and there the error text steps up to reach 4.5:1.
  • Typing never makes a sound. The form does: send on submit and error when validation stops it. Its submit button carries sound="none".

Number field

The field for a figure, an amount of money or a percentage: separators as you type, the currency in view or its picker, the range and the decimals, and the plain figure on submit, with JavaScript and without it. The same HTML in Astro, React and Liquid. Its what and when, in Number field in Open Water Design.

What you plan to invest.

h

Astro
---
import NumberField from '@flouvia/cuenca/astro/NumberField.astro';
---
<NumberField label="Budget" name="budget" format="currency" min={1000} max={50000}
  help="What you plan to invest." lang="en" />
<NumberField label="Price" name="price" format="currency" currencies={['MXN', 'USD']} value={1250} lang="en" />
<NumberField label="Discount" name="discount" format="percent" max={100} optional lang="en" />
<NumberField label="Response time" name="response" min={1} max={168} suffix="h" lang="en" />

It renders on the server with the plain figure in value and a pattern that only accepts plain figures, with its title: without JavaScript, the browser doesn’t submit “1,234.50” and states the rule in its message. fields() writes the figure with its format, removes the pattern, validates the range and, on submit, puts the plain figure back in the FormData.

React
import { NumberField } from '@flouvia/cuenca/react';
import { numberValue } from '@flouvia/cuenca/behavior';

<NumberField label="Budget" name="budget" format="currency" defaultValue={25000} lang="en"
  onChange={(event) => setTotal(numberValue(event.currentTarget))} />   // uncontrolled
<NumberField label="Response time" name="response" min={1} max={168} suffix="h" size="medium" lang="en" />

In React it’s uncontrolled: it takes defaultValue, because a React value would write the old text back over the formatted figure. Read the figure from the FormData or with numberValue(input), in onChange too, which arrives once and with the figure already written.

Liquid
{% render 'cu-number-field', label: 'Budget', name: 'contact[budget]', format: 'currency', max: 50000, lang: 'en' %}
{%- assign price = product.price | divided_by: 100.0 -%}   {%- # Shopify money comes in cents -%}
{% render 'cu-number-field', label: 'Price', name: 'attributes[price]', format: 'currency', currencies: 'MXN|USD', value: price, lang: 'en' %}

In Liquid, currencies is separated by |, and Shopify money comes in cents: divide it by 100 with assign before the render. message_missing and message_format are its messages.

JavaScript
import { fields, isNumberInput, numberValue } from '@flouvia/cuenca/behavior';

fields();   // the fields and the form, the number field included: once per page

// The plain figure, as a number: 1234.5, or null when empty
form.addEventListener('input', (event) => {
  if (isNumberInput(event.target)) recalculate(numberValue(event.target));
});
PropValuesDefaultNotes
label text—Required, as in every field.
id · name text—One of the two; the id comes from the name (contact[budget] → contact-budget).
format number · currency · percentnumberWhat each format sets, below.
currency ISO 4217 (MXN, USD, EUR…)MXN, or the first of currenciesOnly with currency.
currencies two or more—The picker, inside the field. Needs name or currencyName. In Liquid, MXN|USD.
currencyName textthe name with -currencySubmitted apart: budget-currency=USD. In Liquid, currency_name.
min · max figures0 · —A negative min lets you type the “-”.
decimals 0 to 60 · 2 · 1By format: figure, currency and percent.
suffix text—Only with format="number": the unit seen and read after the figure (“h”, “m²”).
value · defaultValue a number—value in Astro and Liquid; defaultValue in React. It goes plain in the HTML (1234.5) and fields() writes it with its format.
size · optional · help · error · messages the fields’ ownlargemessages.format replaces the range message. In Liquid, message_missing and message_format.
placeholder · readOnly · disabled · lang the fields’ own—Read-only has no picker: its currency goes in currency.
autoComplete · enterKeyHint HTML’s ownoff · nextWith transaction-amount, the picker carries transaction-currency.
the rest data-*, aria-*, form, title, onChange, ref…—Goes to the control. type, pattern, min, max, step and value aren’t passed: the field writes them.
FormatDecimalsNext to the figureKeyboardExample
number 0— or its suffixnumeric1,500 · 24 h
currency 2$ before and MXN after; with a picker, only the pickerdecimal$ 1,234.50 MXN
percent 1% afterdecimal12.5%
FunctionWhat it does
fields(options?) Once per page: the fields and the form, the number field included, also those that arrive later. The number field has no call of its own.
numberValue(input) A number field’s figure, as a number (1234.5), or null when empty.
isNumberInput(el) Whether a control is a number field’s.
validate · validateForm · setError The fields’ own: the range joins the same count, the summary and focus on the first error.
  • The HTML is the contract: an input with type="text", never type="number", with the plain figure in value and what describes it in data-format, data-currency, data-decimals, data-min, data-max and data-suffix. The keyboard is decimal with decimals and numeric without; with a negative min, the regular one, because the iPhone’s decimal pad has no “-”.
  • The plain figure is always submitted (1234.50, -250, 12.5), with JavaScript and without it: never 1,234.50, $ or MXN. The currency goes in its own field. A negative shows with the typographic minus, “−1,234.50”.
  • The cursor doesn’t jump: fields() listens to input in the capture phase and writes the figure with the native setter before the page reads it. What it does without a browser input (confirming a composition, undo) dispatches its own.
  • Undo and redo are Cuenca’s: each field keeps its history, by key and by beforeinput (historyUndo and historyRedo), and starts blank when the form resets.
  • Validation is the fields’ own: the range goes through setCustomValidity, on leaving if you typed and on submit, and clears as soon as the figure is valid. Without JavaScript, the server checks the range.
  • It only touches the value, the cursor, validity, the rule’s title and the amount’s text, and never reads a style. What doesn’t go in is said through the live region, once per field and per reason.
  • aria-describedby carries the amount (or a figure’s unit), the help and the error, in that order: screen readers hear the figure and then the amount with its currency in words. The symbol and the code carry aria-hidden, and the picker is named with “Currency” and the field’s label.
  • Onda: typing never sounds; the form does, send and error. Cauce: the fill and the ring with drop, the error with bloom and the currency list with drop. With reduced motion, everything fades in place.

Form

Cuenca’s Form is a <form> with its summary above the actions. fields() validates it on submit; the page only says what to do with what’s already valid.

Astro
---
import Button from '@flouvia/cuenca/astro/Button.astro';
import Form from '@flouvia/cuenca/astro/Form.astro';
import TextField from '@flouvia/cuenca/astro/TextField.astro';
---
<Form id="signup" lang="en" method="post" action="/api/accounts">
  <TextField label="Name" name="name" autoComplete="name" lang="en" />
  <TextField label="Email" type="email" name="email" lang="en" />
  <Button slot="actions" type="submit" appearance="filled" size="large" sound="none">Create account</Button>
</Form>

<script>
  import { setError, setLoading, sound } from '@flouvia/cuenca/behavior';

  const form = document.querySelector('#signup');
  // Only a valid form gets here
  form.addEventListener('submit', async (event) => {
    event.preventDefault();
    const button = form.querySelector('[type="submit"]');
    setLoading(button, true, 'Creating the account…');
    const res = await fetch(form.action, { method: 'POST', body: new FormData(form) });
    setLoading(button, false);
    if (res.ok) return sound(form, 'success');
    // What the server knows goes to its field
    setError(form.querySelector('[name="email"]'), 'That email already has an account.');
    sound(form, 'error');
  });
</script>
  • Only valid submissions arrive: fields() stops the one with errors first, in the capture phase, writes the summary, moves focus to the first and asks for error.
  • The submit button carries sound="none": the form sounds for it, send on submit. What the server answers, the page sounds with sound().
  • While sending, setLoading() locks the button’s width and tells screen readers, and guard() stops another click and Enter in a field.
  • What the server knows goes to its field with setError() and clears on its own as soon as the value is valid.
  • To validate without submitting (a step of a long form), validate(control) does what happens on leaving a field and validateForm(form), what happens on submit.
  • Under a finger, “Next” moves to the next field and the last one submits. If the last one is a text field, the page gives it enterKeyHint="send".
  • In React, onSubmit only arrives when everything is valid; if it returns a promise, success sounds when it resolves and error when it fails.
  • In Shopify, the theme writes the form with the cu-form class and a <p class="cu-form-summary"></p> before the actions: Liquid doesn’t wrap content, so Form has no snippet.

Selection

The checkbox, checkbox, radio and chip groups, the switch, the segmented control and the chip: native checkboxes and radios, every group in its fieldset. The same HTML in Astro, React and Liquid.

How much do you plan to invest?

A rough range is enough.

View
Astro
---
import Checkbox from '@flouvia/cuenca/astro/Checkbox.astro';
import ChipGroup from '@flouvia/cuenca/astro/ChipGroup.astro';
import SegmentedControl from '@flouvia/cuenca/astro/SegmentedControl.astro';
import Switch from '@flouvia/cuenca/astro/Switch.astro';
---
<ChipGroup legend="How much do you plan to invest?" name="budget" selection="single" required options={budgets}
  help="A rough range is enough." messages={{ missing: 'Choose a range or “Not sure yet”.' }} lang="en" />
<Checkbox label="I accept the terms" name="terms" required lang="en" />
<Switch label="Receive news" name="news" />
<SegmentedControl label="View" hideLabel name="view" size="small" options={[
  { value: 'grid', label: 'Grid' },
  { value: 'list', label: 'List' },
]} />

They render on the server, with no JavaScript on the page: the rule is the platform’s and the chosen option paints itself. selection() adds the mixed state, the traveling indicator, the segmented control that doesn’t fit, removing a chip and sound.

React
import { CheckboxGroup, Chip, ChipGroup, RadioGroup, SegmentedControl } from '@flouvia/cuenca/react';

<CheckboxGroup legend="Keep me posted on" name="notify" selectAll="Everything on the project"
  value={alerts} onChange={setAlerts} options={options} />
<RadioGroup legend="Frequency" name="frequency" required defaultValue="instant" options={frequencies} />
<ChipGroup legend="Category" hideLegend name="category" selection="single"
  value={category} onChange={setCategory} options={categories} />
<SegmentedControl label="Language" hideLabel size="small" options={[
  { value: 'es', label: 'ES', href: '/es', lang: 'es' },
  { value: 'en', label: 'EN', href: '/', current: true, lang: 'en' },
]} />
<Chip label="Size M" onRemove={() => remove('M')} />

In React they hold no state. Checkbox and Switch pass everything else to their input (checked or defaultChecked, onChange, ref); groups are controlled with value and onChange, which receives the new value (a list for checkboxes and selection="multiple"), or use defaultValue. Chip with onRemove is removable, and onRemove arrives once the chip has faded out.

Liquid
{% render 'cu-checkbox', label: 'I accept the terms', name: 'contact[terms]', required: true %}
{% render 'cu-switch', label: 'Receive news', name: 'contact[accepts_marketing]' %}
{% render 'cu-segmented-control', label: 'View', hide_label: true, name: 'view', options: 'grid=Grid|list=List' %}
{% assign sizes = product.options_by_name['Size'].values | join: '|' %}
{% render 'cu-chip-group', legend: 'Size', name: 'filter.v.option.size', selection: 'multiple', options: sizes %}
{% render 'cu-chip', label: filter_value.label, remove_url: filter_value.url_to_remove %}

In Liquid, lists are separated by | and each option is value=text, with a third field for the description in groups or the icon in the segmented control; a multiple value is a|b. With remove_url, a chip’s × is a link and works without JavaScript.

JavaScript
import { fields, fitSegmented, guard, placeIndicator, selection, setChoiceError } from '@flouvia/cuenca/behavior';

guard();
fields();      // also the groups’ errors, on submit
selection();   // on a site; in a portal: selection({ surface: 'app' })

// What the page knows or changes on its own
setChoiceError(sizes, 'That size is no longer available.');
placeIndicator(view, true);
fitSegmented(view); // if the rail doesn’t fit, its Select; selection() already does it when the width changes
PropOnValuesNotes
label · legend Checkbox, Switch, SegmentedControl and Chip · the groupstextRequired. They hide from view with hideLabel (the segmented control) and hideLegend (the groups); they’re never removed.
help · messages the groupstext · { missing }A line under the question, where the error appears, which replaces it on screen while it’s there; the error in the screen’s words. In Liquid, help and message_missing.
hideLegend the groupsbooleanThe question leaves the view and still names the group. In Liquid, hide_legend.
description Checkbox, Switch; each option in a grouptextUnder the label, in secondary text.
size allsmall · medium · largelarge by default; medium on SegmentedControl, ChipGroup and Chip.
checked · defaultChecked Checkbox, Switch, filter ChipbooleanLike the native checkbox.
indeterminate CheckboxbooleanThe mixed state; selection() turns it into a property.
options the groups, SegmentedControl{ value, label, description?, icon?, href?, current?, lang?, disabled? }[] or stringsicon, href, current and lang, only on the segmented control.
value · defaultValue the groups, SegmentedControla value; a list for checkboxesNothing is chosen without a real default answer; the segmented control starts on the first.
selectAll CheckboxGrouptextThe checkbox that sums up the others, with its mixed state.
selection ChipGroupsingle · multipleRequired: radios or checkboxes.
required · error the groups, Checkboxboolean · textA group is optional and says so; required asks for one (or at least one). error, the server’s.
orientation the groupsvertical · horizontalHorizontal by default on ChipGroup.
hideLabel · iconOnly SegmentedControlbooleanWith iconOnly, each option carries an icon and its label goes to aria-label.
onRemove · removable · removeHref Chipfunction · boolean · URLThe removable chip: in React, onRemove; in Astro, a button (removable) or a link (removeHref).
sound · lang allan Onda sound or none · es · endata-sound on the control; lang, the language of its own words.
FunctionWhat it does
selection(options?) Once per page: the mixed state, the indicator, the segmented control that doesn’t fit, removing a chip and Onda. With { surface: 'app' }, only the switch sounds.
placeIndicator(segmented, travel?) Places the indicator under the chosen segment; with true, it travels.
fitSegmented(segmented) Measures the radio segmented control against its space: if it doesn’t fit, it shows its Select; when it fits again, its rail. selection() calls it on its own when the width changes.
syncSelectAll(checkbox) Brings the summing checkbox up to date if the page changed the others.
setChoiceError(group, message) · validateChoice(group) An error the page knows (null clears it), or validating a group without submitting.
  • IDs come from name (or id): in a group, each option is {id}-1, {id}-2…, the summing one {id}-all, the help {id}-help and the error {id}-error; in the segmented control, the question is {id}-label, which also names its Select.
  • State lives in the control: :checked, :indeterminate, :disabled (also a disabled fieldset’s), aria-invalid and aria-current. The CSS reads them with :has().
  • A group’s error is handled by fields(), along with the fields’: on submit, every required group with nothing chosen and every unchecked consent show their error (the one in messages, when it has it), the summary counts them and focus goes to the first. The group’s description keeps its help and adds or drops the error.
  • The radio segmented control carries its Select hidden in the HTML, so React and Liquid paint it the same; what’s sent is always the radio. The link one doesn’t swap: if it doesn’t fit, TabNav goes, with “More”.
  • Onda: the switch asks for on and off everywhere; checkboxes, radios, segments and chips, tap only on the site. sound changes it or silences it.
  • Cauce: what changes, with drop; what leaves, with ebb; the error, with bloom. With reduced motion, everything fades in place.

Surfaces

The sheet, the modal, the confirmation, the popover and the menu, built on two platform primitives: <dialog> with showModal() and popover. The same HTML in Astro, React and Liquid.

Astro
---
import Button from '@flouvia/cuenca/astro/Button.astro';
import Sheet from '@flouvia/cuenca/astro/Sheet.astro';
import ConfirmDialog from '@flouvia/cuenca/astro/ConfirmDialog.astro';
import Menu from '@flouvia/cuenca/astro/Menu.astro';
import TextField from '@flouvia/cuenca/astro/TextField.astro';
---
<Sheet title="Edit profile" description="Changes go in the log." action="/ops/clients/lupita/profile"
  done="Profile saved." lang="en">
  <Button slot="trigger">Edit profile</Button>
  <TextField label="Business name" name="name" value="Lupita Bakery" autofocus lang="en" />
  <Button slot="action" appearance="filled" type="submit">Save changes</Button>
</Sheet>

<ConfirmDialog id="void" title="Void invoice F-0123?" description="The client can no longer pay it."
  confirmLabel="Void the invoice" destructive action="/invoices/F-0123/void" lang="en" />

<Menu label="Actions for invoice F-0123" items={[
  { label: 'Download the PDF', icon: 'download', href: '/invoices/F-0123.pdf' },
  { separator: true },
  { label: 'Void the invoice…', icon: 'trash', destructive: true, commandfor: 'void', command: 'show-modal' },
]}>
  <Button slot="trigger" icon="more" label="Actions for invoice F-0123" size="small" appearance="plain" />
</Menu>

The button that opens (slot="trigger") gets commandfor and command: where the browser supports them, it opens without JavaScript. A form with an action submits as always without JavaScript; with it, surfaces() takes it, shows its loading state and closes once it succeeds.

React
import { Button, ConfirmDialog, Dialog, Menu, Sheet } from '@flouvia/cuenca/react';

<Sheet title="Edit profile" lang="en" open={editing} onOpenChange={setEditing} dirty={changed} onSubmit={save}
  done="Profile saved." actions={<Button appearance="filled" type="submit">Save changes</Button>}>…</Sheet>

<Dialog title="Invite someone" lang="en" open={inviting} onOpenChange={setInviting} onSubmit={invite}
  resultTitle={noEmail ? 'The email didn’t go out.' : 'Invite sent.'}
  result={noEmail ? <p>Copy the link and send it yourself.</p> : <p>It expires on Dec 5.</p>}
  actions={<Button appearance="filled" type="submit">Send the invite</Button>}>…</Dialog>
// invite: async (data) => { const r = await send(data); setNoEmail(!r.sent); return { warning: !r.sent }; }

<ConfirmDialog title="Delete Lupita Bakery forever?" confirmLabel="Delete forever" destructive lang="en"
  size="medium" open={deleting} onOpenChange={setDeleting} confirmText="Lupita Bakery" reason
  onConfirm={deleteClient} resultTitle="Client deleted." result={<p>3 accounts and 12 projects were deleted.</p>}>
  <ul>…what gets deleted…</ul>
</ConfirmDialog>
// deleteClient: if the person cancels their passkey, rethrow it in the screen’s words and it lands in the notice:
// throw new DOMException('The passkey was cancelled. Try again to delete.', 'NotAllowedError')

<Menu label="Actions for Ana Vega" lang="en"
  trigger={<Button icon="more" label="Actions for Ana Vega" size="small" appearance="plain" />}
  items={[{ label: 'Remove access…', icon: 'trash', destructive: true, onSelect: () => setRemoving(true) }]} />

In React they open from state (open and onOpenChange); onSubmit and onConfirm return a promise: while it runs, the action shows its loading state and nothing closes. It has three endings: when it resolves, it closes and the page says done (or, with resultTitle, shows its result; with { warning: true }, done with a warning, it sounds error); when it fails, its error goes inside; when the person cancelled it (AbortError or NotAllowedError, what a cancelled passkey throws), its message goes to the neutral notice, with no error and no sound.

Liquid
{% render 'cu-sheet', id: 'cart', title: 'Your cart', action: routes.cart_url, content: cart,
  action_label: 'Check out', trigger_label: 'Cart', lang: 'en' %}
{% render 'cu-confirm', id: 'empty', title: 'Empty the cart?', description: 'The 3 products are removed.',
  confirm_label: 'Empty the cart', destructive: true, action: routes.cart_clear_url, lang: 'en' %}
{% render 'cu-menu', id: 'order', label: 'Order actions', items: 'View the order|-|Cancel the order…',
  hrefs: '/order||', destructive: '||true', trigger_icon: 'more', trigger_icon_only: true, trigger_label: 'Order actions' %}
JavaScript
import { surfaces } from '@flouvia/cuenca/behavior';

surfaces({ surface: 'app' }); // in a portal: popovers and menus stay silent

// Before submitting: cancelable, with the promise the dialog waits for. It resolves (closes and says done, or
// shows its result), fails (its error) or is cancelled (AbortError or NotAllowedError: the neutral notice, silent)
document.querySelector('#edit-profile').addEventListener('cu-submit', (event) => {
  event.detail.respondWith(save(event.detail.data));
});
dialog.addEventListener('close', () => dialog.returnValue); // 'submit', 'confirm' or what its button says
PropOnValuesNotes
title · description dialogs and the sheettextThe title is its name; in a confirmation, a question with its object.
size Dialog · Sheet · ConfirmDialogsmall · medium · large · fullModal at 400, 560 and 720, and full; sheet at 480 and 640; confirmation at 400 and 560.
trigger alla buttonGets commandfor and command; in a menu, also aria-haspopup and its anchor.
action · method dialogs and the sheetURL · post · getThe form submits there.
open · onOpenChange all, in Reactboolean · functionOpen from state and know when it closed.
onSubmit · onConfirm dialogs and the sheet, in Reacta promiseLoading while it runs; when it resolves, it closes or shows its result; the error when it fails; the neutral notice when it was cancelled.
dirty Dialog · Sheet, in ReactbooleanWith changes, closing asks. In Astro and Liquid the component detects it.
dismissible Dialog · SheetbooleanA click outside closes. By default, yes when there’s no form.
busy · error · notice dialogs and the sheetboolean · textThe loading (data-busy on the dialog; aria-busy, only on the button); the error with role="alert" and the notice with role="status", inside.
resultTitle · result dialogs and the sheettext · contentWhen it resolves, what happened and its detail in the same dialog, instead of closing; the title is its name while it’s shown. result requires resultTitle; in Astro, it’s a slot.
done dialogs and the sheettextWhat the page’s region says once the surface has finished leaving after a success: “Profile saved.”
confirmLabel · destructive ConfirmDialogtext · booleanA verb and an object, never “Yes” or “OK”; in red if it destroys.
confirmText · reason ConfirmDialogtext · booleanWhat can’t be undone: the typed name and a reason, which goes in the log.
placement Popover · Menubottom end · bottom start · top end · top startNext to its button; it flips if it doesn’t fit.
items Menu{ label, icon?, href?, destructive?, disabled?, commandfor?, command? } · { separator: true }Up to twelve; in React, also onSelect. A disabled one carries aria-disabled: it takes focus and does nothing.
StateOnWhat it says
open <dialog>Open (showModal() and close(), the platform’s).
data-state="open" · "closed" <dialog> and the panelThe same, as an attribute, to style.
data-busy <dialog>Saving: nothing closes.
aria-busy="true" the submitting buttonThe only thing announced as busy.
data-done-text <dialog>What done says once it has left.
aria-expanded the button that opens a panelIts panel is open; the button stays marked.
data-dirty <dialog>It has changes (React’s dirty prop).
data-nudge · data-result the sheet · dialogs and the sheetThe sheet giving way · the result in view.
data-pointer the menuMoved through with the pointer: the ring only with the keyboard.
  • Focus enters the first field (Cancel in a confirmation, the title in what you only read), Tab never reaches the page and on close it returns to its button, also to a menu’s. The description goes in aria-describedby on all three: screen readers say it on open.
  • Escape, the ×, Cancel, the scrim and the gesture close what has no changes; with changes, the sheet gives way 8, up to its edge, and asks “Discard your changes?” (on the phone, an action sheet at the bottom). Escape is caught on keydown: two in a row never lose what you wrote.
  • On the phone, the sheet and the modal come up from the bottom with their grabber, a button (“Close the sheet” or “Close the dialog”), and their footer in equal halves. A full modal takes the screen, with no grabber.
  • The result: a frame after it resolves, its title becomes the dialog’s name, it’s announced and focus goes to what it asks for or to “Done”. The box changes height with sheet and the content comes in with ebb.
  • The menu moves with ↑ and ↓ (wrapping, through disabled options too), Home, End and a letter; Escape returns to the button and Tab closes and moves on. The popover closes with Tab out.
  • Cauce: the sheet and the modal come in with sheet, the popover and the menu with drop, and all leave with ebb; with reduced motion, they fade in place. Onda: sheets and dialogs ask for open and close; popovers and menus, only with surfaces({ surface: 'site' }).
  • The behavior doesn’t depend on cuenca.css: it never reads a computed style; every state lives in an attribute.

The figure shows them at rest: here they don’t open on top, because this site is still testing its cursor over the top layer in Safari.

Data

The table, the card, the metric, the avatar and the group, with the same HTML in Astro, React and Liquid. In use in the portal and Ops. Their what and when live in Open Water Design’s Table, Card and metric, and Avatar.

Visits: 4,812, 8% more than last week. Over the last 8 weeks it rises, from 3,920 to 4,812.

Orders: 126, 3% fewer than last week. Over the last 8 weeks it falls, from 142 to 126.

AVLOMR+1
Astro
---
import Card from '@flouvia/cuenca/astro/Card.astro';
import Metric from '@flouvia/cuenca/astro/Metric.astro';
import AvatarGroup from '@flouvia/cuenca/astro/AvatarGroup.astro';
---
<Card padding="tight" label="This week" lang="en">
  <Metric label="Visits" value={4812} series={visits} period="week" lang="en"
    change={{ value: 0.08, label: 'more than last week', tone: 'positive' }} />
  <Metric label="Orders" value={126} series={orders} period="week" lang="en"
    change={{ value: -0.03, label: 'fewer than last week', tone: 'negative' }} />
</Card>
<AvatarGroup items={team} max={3} label="Project team" lang="en" />

They render on the server. The server writes the metric’s chart and data() only draws it as it comes in. The table is a native <table>: without JavaScript it reads in full and, with sortHref and pageHref, its sorting and its pages are links.

Astro
---
import Table from '@flouvia/cuenca/astro/Table.astro';
import SearchField from '@flouvia/cuenca/astro/SearchField.astro';
---
<Table caption="Clients" title="All clients" rows={clients} columns={columns} lang="en"
  sort={{ column: 'name', direction: 'ascending' }} sortHref={(c, d) => `?sort=${c}&dir=${d}`}
  selection="multiple" itemName={{ one: 'client', other: 'clients' }} batchActions={batch}
  rowHref={(c) => `/ops/clients/${c.id}`} page={1} pageSize={50} total={3368} pageHref={(p) => `?page=${p}`}>
  <SearchField slot="toolbar" label="Search clients" hideLabel size="small" lang="en" />
</Table>
React
import { Avatar, AvatarGroup, Table } from '@flouvia/cuenca/react';

<Table caption="Clients" hideCaption rows={clients} columns={columns} lang="en"
  sort={sort} onSortChange={setSort} selection="multiple" onSelectionChange={setSelected}
  itemName={{ one: 'client', other: 'clients' }}
  batchActions={[{ label: 'Export', icon: 'download', onAction: exportRows }]}
  rowActions={(c) => actions(c)} onRowOpen={setOpen}
  page={page} pageSize={50} total={3368} onPageChange={setPage}
  state={loading ? 'reloading' : 'idle'} empty={{ title: 'No clients yet' }} />
<Avatar name="Ana Vega" src={photo} size="small" status="online" lang="en" />
<AvatarGroup items={contacts} max={3} size="mini" label="See the contacts" onOpen={openContacts} lang="en" />

In React, the table reports through onSortChange, onPageChange, onRowOpen and onRetry, and onSelectionChange receives { all: false, keys } or { all: true, except, query }. Selection belongs to the behavior: a new selected is applied again and React never fights the range or “Select all N”.

Liquid
{% render 'cu-table', id: 'orders', caption: 'Your orders', hide_caption: true, rows: customer.orders,
  columns: 'name:Order::primary,total:Total:end:value::currency,date:Date::secondary',
  row_href_key: 'customer_url', sortable: 'name,total', sort: params.sort, sort_dir: params.dir,
  sort_href: '?sort={column}&dir={direction}', item_one: 'order', item_other: 'orders', lang: 'en',
  page: paginate.current_page, page_size: 20, total: paginate.items, page_href: '?page={page}' %}
{% render 'cu-metric', label: 'Points', value: customer.metafields.loyalty.points, series: customer.metafields.loyalty.history,
  period: 'month', change_value: 0.08, change_label: 'more than last month', change_tone: 'positive', lang: 'en' %}
{% render 'cu-avatar', name: customer.name, src: customer.image, size: 'small', lang: 'en' %}

In Liquid, columns go in a key:Name:alignment:place:second line:format:unit string, with sortable, row_header, avatar and currency apart. The table requires id and the batch actions, batch_values.

JavaScript
import { data, tableSelection } from '@flouvia/cuenca/behavior';

data({ surface: 'app' }); // in a portal: sorting, paging and opening stay silent

// Without a URL, sorting and pages are buttons: the page fetches the data and paints again
table.addEventListener('cu-sort', (event) => sortBy(event.detail.column, event.detail.direction));
table.addEventListener('cu-page', (event) => goTo(event.detail.page));
// Batch actions, cancelable: if nobody cancels them, they submit the form around the table
table.addEventListener('cu-batch', (event) => {
  event.preventDefault();
  exportRows(event.detail.action, tableSelection(table));
});
PropOnValuesNotes
caption · hideCaption · title Tabletext · boolean · textIt always has a name. With title, the caption hides from view and adds the sort.
columns Table{ key, label, align, sortable, rowHeader, width, format, currency, list, detail, avatar, avatarSrc, unit }list is its place on a phone; unit, the figure’s unit in the list; render, a custom cell.
sort · sortHref · onSortChange Table{ column, direction } · functionWith sortHref, links; otherwise, buttons. The component doesn’t sort: it paints.
selection · selected · onSelectionChange Tablenone · multiple; keys or { all: true, except }The checkboxes, the Shift range and “Select all N”.
itemName · batchActions · rowActions Table{ one, other, feminine? } · actions · Menu optionsUp to three actions in view; what destroys opens its confirmation.
rowHref · onRowOpen TablefunctionThe name is the control and the whole row defers to it.
page · pageSize · total · pageHref · onPageChange Tablenumbers · functionsWith pageHref, links. A page out of range is painted as the last one.
state · empty · error · onRetry Tableidle · loading · reloading · error; { title, text, icon }The empty state is a section EmptyState and the first load, its Skeleton.
striped · stickyHeader · scroll · surface Tablebooleans · card · nonescroll: two directions, the first column fixed and never a list. none: inside a Card, to its edges.
title · description · href · media · padding · label Cardtext · route · { src, alt, ratio } · auto · tightWhole (href) or with actions (action, footer), never both.
as Carddiv · section · articlediv by default: its title is its heading, with no landmark. section when it’s a section of the page; article, what reads on its own.
label · value · format · change · series · period · none Metrictext · number or null · number · currency · percent · { value, label, tone } · up to 30 · day · week · monthWith fewer than two points, “No history yet”. Without value, “—” and its reason. A stretch of fewer than 4 points has no area.
name · src · kind · size · status · decorative · team Avatartext · route · person · organization · mini to large · online · busy · awaysrc is never a Blob URL. Alone, decorative={false}. Each status, with its shape: filled, barred or hollow.
items · max · label · commandfor · onOpen AvatarGrouparray · number · text · id · functionWith commandfor or onOpen, a button.
lang alles · enIts own words and the format of figures and dates: those in the current year, without the year.
EventWhenIn React
cu-sort A header that’s a button: { column, direction }.onSortChange
cu-page Previous or next, when they’re buttons: { page }.onPageChange
cu-rowopen A row that opens without leaving the page: { key }.onRowOpen
cu-retry “Try again”, on the error.onRetry
cu-selectionchange Every change to the selection.onSelectionChange
cu-batch A batch action: { action, selection }. Cancelable; if nobody cancels it, it submits the form around the table.Each action’s onAction
FunctionWhat it does
data(options?) Once per page: selection, batch actions, the row that opens, what stays pinned and its shadow, the list when the columns don’t fit, the chart and the avatar’s image. With { surface: 'app' }, sorting, paging and opening stay silent.
tableSelection(table) What’s selected: { all: false, keys } or { all: true, except, query }.
  • The HTML is the contract: the behavior reads its cu-* classes and attributes, never a computed style, and works without cuenca.css.
  • States live in attributes: data-state on the table, aria-sort, aria-busy, data-selected, the bar’s data-mode and data-layout="list" on a table that becomes a list.
  • The list arrives when the columns don’t fit: data() measures the grid as a table when its width, its rows or its type change. Below 600 it’s always a list, without JavaScript too; a table with scroll keeps sliding.
  • With the whole page selected, the region also says that all can be selected (“5 clients selected. You can select all 80.”), and on the phone “Select all N” goes in the floating bar, next to the count.
  • The table and the card are a raised layer (data-cuenca-layer="raised"): the ring of an avatar inside takes its color.
  • When sorting or paging with links, focus returns to the same control on the new page and the sort or the page is announced.
  • Cauce: the sort arrow turns with drop, the batch bar changes with drop, the fixed column’s shadow comes and goes with ebb and the chart draws with rise. With reduced motion, nothing travels.

Status

The toast and its region, the inline notice, the tooltip and help, the empty state and the missing value, the progress bar, the loading region with its skeleton and the spinner. In use in the portal and Ops. Their what and when live in Open Water Design’s Notices, Tooltip and help, Empty state and missing value, and Progress and loading.

Astro
---
import Notice from '@flouvia/cuenca/astro/Notice.astro';
import EmptyState from '@flouvia/cuenca/astro/EmptyState.astro';
import ProgressBar from '@flouvia/cuenca/astro/ProgressBar.astro';
import Spinner from '@flouvia/cuenca/astro/Spinner.astro';
---
<Notice tone="danger" action={{ label: 'Try again', href: '?retry' }} lang="en">Couldn’t save the draft.</Notice>
<EmptyState size="inline" kind="search" description="Nothing matches “invoice”." />
<ProgressBar id="export" label="Exporting clients" value={42} lang="en" />
<Spinner size="small" />

What goes in the layout: the notifications region, once, and what’s requested from a script. toast() only exists in the browser; what comes from the server travels in initial. An icon-only button brings its tooltip with its label, and one that repeats (each row’s ⋯) carries its id or its tooltipId.

Astro
---
import Toaster from '@flouvia/cuenca/astro/Toaster.astro';
import Button from '@flouvia/cuenca/astro/Button.astro';
import HelpButton from '@flouvia/cuenca/astro/HelpButton.astro';
import LoadingRegion from '@flouvia/cuenca/astro/LoadingRegion.astro';
import Skeleton from '@flouvia/cuenca/astro/Skeleton.astro';
---
<Toaster lang={lang} initial={serverToasts} />                  <!-- once, in the layout -->
<Button icon="archive" label="Archive" shortcut="E" />           <!-- the tooltip comes with the label -->
<HelpButton label="What “No passkey” means" title="No passkey yet" lang="en">Ana signs in with a passkey…</HelpButton>
<LoadingRegion label="Accesses" loading lang="en"><Skeleton slot="fallback" rows={8} columns={4} /> …</LoadingRegion>
<script>
  import { toast } from '@flouvia/cuenca/behavior';
  copy.addEventListener('click', () => toast('Link copied', { icon: 'link', lang: 'en' }));
</script>
React
import { Toaster, toast, Notice, LoadingRegion, Skeleton, EmptyState } from '@flouvia/cuenca/react';

<Toaster lang="en" />                                            // once, at the root
toast('Conversation archived', { description: '“Homepage change”', icon: 'archive',
  action: { label: 'Undo', onAction: restore } });                // 10 s; it can also be undone in Archived
toast.success('Profile saved', { silent: true });                // the button already sounded with showDone
toast.error('Couldn’t send the summary', { action: { label: 'Try again', onAction: send } });  // it stays
<Notice tone="danger" action={{ label: 'Try again', onAction: archive }} onDismiss={dismiss} lang="en">…</Notice>
<LoadingRegion loading={isFetching} label="Accesses" fallback={<Skeleton rows={8} columns={4} />} lang="en">…</LoadingRegion>
<EmptyState size="inline" kind="search" description="Nothing matches “homepage”." />

In React, the inline notice handles its action with action.onAction and its × with onDismiss; the region loads with loading and its fallback goes in fallback; the bar moves with value.

Liquid
{% render 'cu-toaster', toasts: flash_toasts, lang: 'en' %}
<script>Cuenca.toast('Added to cart', { action: { label: 'View cart', href: '/cart' }, lang: 'en' });</script>
{% render 'cu-notice', tone: 'danger', text: 'We couldn’t add size M. Choose another one.', lang: 'en' %}
{% render 'cu-empty-state', icon: 'cart', title: 'Your cart is empty', action_label: 'Keep shopping', action_href: routes.all_products_collection_url %}
{% render 'cu-progress', id: 'shipping', label: 'Free shipping from $75', value: shipping_progress, lang: 'en' %}
{% render 'cu-spinner', size: 'medium' %}

In Liquid, a theme’s scripts call Cuenca.toast(…). cu-help-button and cu-progress require id, and a table’s skeleton takes its shape with column_list and row_height.

JavaScript
import { dismissNotice, setBusy, setProgress, status, toast } from '@flouvia/cuenca/behavior';

status(); // once per page: the tooltip, the inline notice, the loading region and the server's toasts

toast('Conversation archived', { icon: 'archive', action: { label: 'Undo', onAction: restore }, lang: 'en' });
setBusy(region, true);                   // waits 400 ms and paints its fallback
setBusy(region, false, '4 accesses.');   // it arrived: it says so
setProgress(bar, 64);                    // at its maximum, it leaves
dismissNotice(notice);                   // it leaves with ebb and focus moves to what comes next
PropOnValuesNotes
description · icon · action toast · Notice · EmptyStatetext · a Gota icon · { label, onAction | href, hint? }One action. A neutral toast’s icon is its action’s.
duration · key · sound · silent toastms · text · an Onda sound or none · boolean5 s; 10 s with an action; an error stays. silent if the button already sounded.
initial Toastertoasts with their hrefThe server’s, which come out after paint.
tone · dismissible · onDismiss Noticedanger · warning · success · info · neutral · boolean · functiondanger with role="alert"; the others, role="status".
label · shortcut · tooltip · tooltipPlacement · tooltipId Icon-only Buttontext · a key · boolean · top · bottom · idThe tooltip comes with the label; tooltip={false} removes it.
id · label · shortcut · placement TooltiptextFor a custom control, named with aria-labelledby="<id>-label".
label · id · title · placement HelpButtontext · bottom · toplabel says what it explains.
size · kind · title · level EmptyStatepage · section · inline · empty · search · selection · 2 to 6Without size, its container picks. The action, in the action slot. Its text measures 20em.
value · max · label · id ProgressBarnumbers · textWithout real progress there’s no bar.
loading · label · fallback · delay · minDuration LoadingRegionboolean · text · content · ms400 and 500 by default; with no fallback, the spinner with its line at 5 s.
lines · rows · columns · rowHeight · shape · size Skeletonnumbers or a list · line · circlecolumns as a list: each column’s width, side and shape.
size Spinnersmall · medium · large16, 24 and 40.
lang alles · en“Notifications”, “Dismiss notification”, “To undo, press F6.” and “No data”.
FunctionWhat it does
status() Once per page: the tooltip, the inline notice, the loading region and the server’s toasts; it leaves toast() on window.Cuenca.
toast(text, options?) A toast. It works even without status() and creates its region if the layout doesn’t have one.
setBusy(region, busy, message?) Opens and closes the loading region; message is what screen readers hear.
setProgress(bar, value, message?) Moves the bar; at its maximum, it leaves and exits the accessibility tree.
dismissNotice(notice) Dismisses an inline notice and moves focus to what comes next.
  • guard() creates both live regions on load, the polite and the assertive: no toast ever moves focus.
  • The tooltip’s text is its button’s name (aria-labelledby to <id>-label), the same open or closed; the key goes in aria-keyshortcuts.
  • The inline notice’s × sends cu-dismiss, cancelable, and its action without href, cu-action.
  • Timing lives in TIMING, equal to the duration tokens: the behavior doesn’t read the CSS. Without cuenca.js, the button keeps its name, the region shows its content and there are no toasts.
  • The collapsed stack darkens each toast behind one step per layer (--cu-toast-stack-dim, 25%): its layer mixes with the base. Expanded, each one returns to its layer.
  • Onda: a toast asks for its sound with cuenca:sound (success, error, notify); the rest of status doesn’t sound. Cauce: a toast comes in with bloom and leaves with ebb, the stack and its tone settle with sheet, the skeleton pulses with flood and the spinner turns with bloom; with reduced motion, they fade.

Combo box

The field that suggests as you type, to choose one option, or several as chips, among many: from a fixed list, filtered in the browser, or from what the server finds. In use in Ops. The same HTML in Astro, React and Liquid. What it is and when to use it, in Open Water Design’s Combo box.

Astro
---
import ComboBox from '@flouvia/cuenca/astro/ComboBox.astro';
---
<ComboBox label="Client" name="client" source="/api/clients" icon="search"
  placeholder="Search by name" empty="No clients for “{q}”." lang="en" />
<ComboBox label="Tags" name="tags" items={tags} selectionMode="multiple"
  value={['contract', 'urgent']} allowsCustomValue lang="en" />

It renders on the server with its native control: with fixed options (items), a <select> that carries the value and is what shows without JavaScript; with source, the input, which submits with its form. complex() adds the rest: the input and its chevron, the list, the highlight, the chips and the search. The example shows the list open and at rest: here it doesn’t open on top, because this site is still testing its cursor over the top layer in Safari.

React
import { ComboBox } from '@flouvia/cuenca/react';

<ComboBox label="Client" name="client" icon="search" empty="No clients for “{q}”." lang="en"
  search={(q, { signal }) => searchClients(q, { signal })}
  onChange={(value, items) => setClient(items[0] ?? null)} />
<ComboBox label="Owners" items={team} selectionMode="multiple" size="medium" lang="en"
  value={owners} onChange={setOwners} />

In React, the combo box runs on React Aria’s hooks with the contract’s HTML: search queries the server and onChange gives the value and the chosen options. The island loads only on the page that has a complex component (client:idle or client:visible), never from the layout, and the bundler keeps only React Aria’s Spanish and English, without a region:

JavaScript
// astro.config.mjs: React Aria with its Spanish and English, nothing else
import optimizeLocales from '@react-aria/optimize-locales-plugin';

export default defineConfig({
  vite: { plugins: [optimizeLocales.vite({ locales: ['es', 'en'] })] },
});
Liquid
{% render 'cu-combo-box', label: 'Size', name: 'id', options: product.variants, lang: 'en' %}
{% render 'cu-combo-box', label: 'Search', name: 'q', source: routes.predictive_search_url, icon: 'search', empty_text: 'No products for “{q}”.', lang: 'en' %}

In Liquid, options takes product.variants or a list separated by |, and source understands Shopify’s suggest.json for predictive search. empty is a Liquid keyword: the empty state goes in empty_text.

JavaScript
import { comboBox, complex } from '@flouvia/cuenca/behavior';

complex();   // dates, the combo box and file upload: once per page ({ surface: 'app' } in a portal)

// The screen's search, instead of data-source: what was typed and the signal that cancels the old request
const client = comboBox(field, { search: (q, { signal }) => searchClients(q, { signal }) });
field.addEventListener('cu-combochange', (event) => save(event.detail.value));   // also client.value
PropValuesDefaultNotes
label text—Required: the field’s name, always on top.
id · name text—One of the two; the ID comes from the name.
items { value, label, description?, avatar?, keywords?, href?, disabled? }[] or strings—The fixed options, filtered in the browser. In Liquid, options.
source an address—The server search in Astro and Liquid: it answers JSON to ?q=. items or source, never both.
search (q, { signal }) => Promise<items>—The search in React; in cuenca.js, comboBox(el, { search }).
selectionMode single · multiplesingleWith several, chips inside the input. In Liquid, selection.
allowsCustomValue booleanno“Add “…”” at the end, never highlighted on its own. In Liquid, custom.
value · defaultValue · onChange a value or the list—value in Astro and Liquid (with several, separated by | in Liquid). In React, value with onChange(value, items).
placeholder · icon · empty text · a Gota icon · text with {q}—The magnifier with search, the globe for a time zone. In Liquid, empty_text.
size · help · error · optional · disabled · messages · lang the fields’ ownlargemessages.missing is the missing-value message. In Liquid, message_missing.
the rest data-*, form—Goes to the control.
FunctionWhat it does
complex(options?) Once per page: sets up every combo box, date and upload, including the ones that arrive later. With { surface: 'app' }, in a portal or a console, choosing stays silent.
comboBox(el, { search }) Gives a combo box its search, instead of data-source. Returns value (the selection), setItems() (other fixed options) and destroy().
cu-combochange The event that bubbles on choosing or removing: detail.value (the value, or the list with several) and detail.items. With fixed options, also the <select>’s change.
COMBO_TIMING The timings, equal to its tokens: 250 ms to search and 400 for the spinner. The behavior doesn’t read the CSS.
  • The HTML is the contract: the behavior reads its cu-* classes and attributes, never a computed style. With complex(), the <select> leaves the view without hidden: it keeps carrying the value, validates and takes focus for the first error, which it passes to the input.
  • The highlighted option, what Enter takes, goes in data-marked and in the input’s aria-activedescendant; the selected one, in aria-selected, with its checkmark. The first is highlighted on its own only when there’s text, and never “Add”.
  • Escape and Tab don’t choose. The first Escape closes and keeps what you typed; the second clears it; inside a sheet or a dialog, the third closes it. Leaving without choosing, the input goes back to the selection or clears, and says so.
  • It filters regardless of accents and case, also by keywords, with what starts with your text first. The match goes in <mark class="cu-combo-box-match">, at 700 (--cu-combo-box-match), with no color or fill, and underlined in forced colors.
  • With search, it waits 250 ms after the last key and cancels the old request with its AbortSignal. The previous list dims (data-stale), the input carries aria-busy, Enter never chooses a stale result and the spinner arrives at 400 ms. If it fails, Enter or ↓ search again.
  • With several, the chips belong to the combo box alone (selection() doesn’t intercept them): removing one is announced and focus moves to the next ×. The highlight skips what’s already selected.
  • The empty state and the error sit next to the list, outside the listbox. The status region says the count and the highlighted option half a second after the last key.
  • By touch, tapping the input opens the surfaces’ sheet at nearly full height, with the input on top; arriving with Tab never opens it. In React, the phone opens the list in its Popover.
  • Onda: on the site, choosing an option or a chip plays tap; with { surface: 'app' }, it stays silent. Cauce: the list grows from the input with drop and leaves with ebb, and a chip enters from 0.9 with drop. With reduced motion, everything fades in place.

File upload

The drop zone, FileUpload, and the file button, FileButton: what you choose, drop or paste moves to its list, is checked and uploads with its progress. In use in the portal’s Vault. The same HTML in Astro, React and Liquid. What it is and when to use it, in Open Water Design’s File upload.

Drop files here or choose them

PDF, images and Figma, up to 50 MB each.

      Astro
      ---
      import FileButton from '@flouvia/cuenca/astro/FileButton.astro';
      import FileUpload from '@flouvia/cuenca/astro/FileUpload.astro';
      ---
      <FileUpload label="Project files" name="files" multiple accept={['pdf', 'image', 'figma']}
        maxSize="50 MB" lang="en" />
      <FileButton label="Attachments" name="attachments" multiple size="small" optional lang="en" />

      The whole zone is the input: without JavaScript, the browser’s control shows inside it and the file travels with its form. complex() makes it invisible over the zone and adds the list, dropping and pasting; the page provides the upload function. In the example, the upload is a sample: nothing leaves your device.

      React
      import { FileUpload } from '@flouvia/cuenca/react';
      
      <FileUpload label="Vault files" name="files" multiple maxSize="50 MB" lang="en"
        accept={['pdf', 'word', 'excel', 'image', 'figma', 'zip']}
        upload={(file, { signal, onProgress }) => upload(file, { signal, onProgress })}
        onChange={(files) => setRecent(files.filter((f) => f.state === 'done'))} />

      In React, FileUpload doesn’t use React Aria: it writes the contract’s HTML and hands its upload to fileUpload(). onChange gives each file with its state and what the upload returned, and handleRef, the cuenca.js handle.

      Liquid
      {% render 'cu-file-upload', label: 'Your logo', name: 'properties[Logo]', accept: 'image', max_size: '5 MB', lang: 'en' %}
      {% render 'cu-file-upload', variant: 'button', label: 'Attachments', name: 'properties[Attachments]', multiple: true, lang: 'en' %}

      In Liquid, variant: 'button' is the file button, accept is separated by | and max_size goes in words. Without an upload function, the files in the list travel with the product form.

      JavaScript
      import { complex, fileUpload } from '@flouvia/cuenca/behavior';
      
      complex();   // once per page
      
      // The screen's upload: the file, the signal that cancels it and its progress, from 0 to 100
      const files = fileUpload(zone, {
        upload: (file, { signal, onProgress }) => upload(file, { signal, onProgress }),
      });
      zone.addEventListener('cu-filechange', (event) => show(event.detail.files));   // also files.files
      PropValuesDefaultNotes
      label text—Required: the name of the field and of the input.
      id · name text—One of the two; the ID comes from the name.
      multiple booleannoWithout it, choosing another replaces the previous one and says so.
      accept pdf · word · excel · powerpoint · image · figma · zip · video · audio · text, extensions or MIME types—What it accepts, also in the limits in words. In Liquid, separated by |.
      maxSize · maxFiles · hint bytes or “50 MB” · a number · text—The limits, in steps of 1000; hint replaces their sentence. In Liquid, max_size and max_files.
      uploadOn · preview select · submit · booleanselect · yesWith submit, the form uploads on save and waits. preview is the 40 thumbnail for images. In Liquid, upload_on.
      title · buttonLabel · size text · small · medium · largeCuenca’s · mediumThe zone’s title; what the file button says and its size. In Liquid, button_label.
      upload · onChange · handleRef functions—In React: the upload, the list with its states and the cuenca.js handle.
      help · error · optional · disabled · messages · lang the fields’ own—messages.missing is the missing-value message. In Liquid, message_missing.
      the rest data-*, form—Goes to the input.
      FunctionWhat it does
      complex() Once per page: sets up every zone and every button, including the ones that arrive later. A file dropped outside a zone doesn’t open in the tab, and resetting a form clears its list.
      fileUpload(el, { upload }) Gives a zone its upload. Returns files, busy, wait() (waits for what’s uploading), flush() (uploads what waits for save), add(files), setUpload() and destroy().
      upload(file, { signal, onProgress }) The page’s upload: it reports progress from 0 to 100 and cancels with signal. What it returns arrives in result; if it fails, its message is the row’s reason.
      clearFileUpload(el) Clears the list.
      cu-filechange The event that bubbles when the list changes: detail.files, each with its state (uploading, done, error, rejected or waiting), its progress, its reason and its result.
      • The whole zone is the input, invisible over it and the only Tab stop; the zone draws its ring with :has(:focus-visible). Without data-enhanced, the browser’s control shows and the pill doesn’t.
      • Its name is the label plus what its button says: aria-labelledby carries {id}-label and {id}-pick, “Project files Choose files” (on the button, the other way around). Its description is the limits and, with rows, it starts with “2 files in the list.”.
      • What you choose, drop or paste (⌘V or Ctrl+V with focus on the zone) moves to the list and the input clears. Without an upload function, the input carries exactly the files in the list, through DataTransfer, and they travel with the form.
      • Each file is checked on the way in: the type, the size and how many fit. What doesn’t fit stays in its row with its reason, without an alert: the status region counts the batch. Sizes count in steps of 1000, with formatBytes().
      • With an upload, the × cancels through the AbortSignal while it uploads and removes once it’s done; focus moves to the next row or to the zone, and it’s announced. What fails gives its reason in role="alert", with the file’s name, and offers “Try again”.
      • With uploadOn="submit", the row says “Uploads when you save” and the form uploads before it’s sent, with its button in setLoading; with select, the form waits for what’s uploading to finish.
      • Onda: a finished batch plays success once and the region says “3 files uploaded”; what fails or doesn’t fit plays error, once per batch. Cauce: the zone lights up with drop, rows enter with rise, one per choreography step, and leave with ebb; the bar is Progress and loading’s. With reduced motion, everything fades in place.