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.
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:
1Bring it in with cuenca:sync: it copies dist/ and src/ from its repo to src/vendor/cuenca/, which is never edited by hand.
2Point @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.
3Declare the layer order once, before anything else: Cuenca sits below the project’s components and utilities, as Tailwind v4 expects.
4Call 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).
5Wire up sound: the button writes data-sound and showDone() requests success with the cuenca:sound event; the surface that runs Onda plays them.
6Change the theme, never the craft: the touch target, the focus and the springs are the same in every project.
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.
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.
When
What 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.
Site sound is off.
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.
1Themes 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.
2There, 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.
3Here, 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 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.
Family
Variables
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:
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.
2 Create project 3415
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.
minismallmediumlargefilledtintedplaindestructiveicon only
Prop
Values
Default
Notes
appearance
filled · tinted · plain
tinted
A single filled action per view.
size
mini · small · medium · large
medium
See the sizes.
destructive
true · false
false
Changes 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 · full
auto
full 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 · false
false
The spinner in place of the content, without changing width. In React, the click doesn’t reach onClick or submit the form.
disabled
true · false
false
On a link: aria-disabled and no href.
sound
an Onda sound · none
per surface
Writes data-sound.
type
button · submit · reset
button
Only 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.
Size
Height
Type
Padding
Icon
Gap
Icon only
For
mini
28
12 / 500
10
12
4
16
Actions inside a table row
small
32
13 / 500
12
14
6
18
Rows, dense bars and menus
medium
44
14 / 500
20
16
6
24
Almost everything
large
52
17 / 500
24
20
8
28
The 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.
SaveDefault
SaveHover
SavePressed
SaveFocus
SaveDisabled
SaveLoading
SavedDone
State
Support
How it looks
Default
Yes
The style with the theme’s tokens.
Hover
Yes
Only with a fine pointer and never when disabled: it grows to 1.04 and shifts tone. Full width, 1.01.
Pressed
Yes
It gives to 0.95 and, on release, returns with its bounce. Full width, 0.99. On iOS too: guard() wakes it up.
Keyboard focus
Yes
A solid ring, 2 px wide and 2 px apart, keyboard only (:focus-visible). On a brand surface it changes color.
Disabled
Yes
No 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
Yes
The 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
Yes
The check arrives with bloom, tells screen readers and asks for Onda’s success. showDone() sets it, never a prop.
On
Yes
A toggle: with aria-pressed="true" it takes the filled style.
Behaviors
What it does on its own, without the page having to ask.
Icon onlySaveWith a label
Create projectFull 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.
Send the client an access link
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.”
SaveWith a finger 44 pxSaveWith 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.
CancelCreate project
Do: The action that matters, filled; cancel, plain.
CancelCreate project
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.
Create projectSend message
Do: The + for create and the plane for send say the same as their verb.
Save changes
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.
Create projectCancel
Do: Stacked, full width.
CancelCreate project
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ñolEnglish
Crear proyectoCreate project0%
Enviar mensajeSend message+17%
Eliminar clienteDelete client+23%
Guardar cambiosSave changes+25%
Agregar al carritoAdd to cart+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
Key
What it does
Where 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.
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.
0/280280 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>
Three sizes, with a 14 radius on all three and search as a capsule:
Size
Height
Type
For
small
36 px
14 px; 16 px on touch
Console bars and filters, next to a small button.
medium
44 px
16 px
Portal bars, filters and tables.
large
52 px
16 px
Forms: 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.
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.
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.
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));
});
Prop
Values
Default
Notes
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 · percent
number
What each format sets, below.
currency
ISO 4217 (MXN, USD, EUR…)
MXN, or the first of currencies
Only with currency.
currencies
two or more
—
The picker, inside the field. Needs name or currencyName. In Liquid, MXN|USD.
currencyName
text
the name with -currency
Submitted apart: budget-currency=USD. In Liquid, currency_name.
min · max
figures
0 · —
A negative min lets you type the “-”.
decimals
0 to 6
0 · 2 · 1
By 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’ own
large
messages.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 own
off · next
With 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.
Format
Decimals
Next to the figure
Keyboard
Example
number
0
— or its suffix
numeric
1,500 · 24 h
currency
2
$ before and MXN after; with a picker, only the picker
decimal
$ 1,234.50 MXN
percent
1
% after
decimal
12.5%
Function
What 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.
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.
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.
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
Prop
On
Values
Notes
label · legend
Checkbox, Switch, SegmentedControl and Chip · the groups
text
Required. They hide from view with hideLabel (the segmented control) and hideLegend (the groups); they’re never removed.
help · messages
the groups
text · { 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 groups
boolean
The question leaves the view and still names the group. In Liquid, hide_legend.
description
Checkbox, Switch; each option in a group
text
Under the label, in secondary text.
size
all
small · medium · large
large by default; medium on SegmentedControl, ChipGroup and Chip.
checked · defaultChecked
Checkbox, Switch, filter Chip
boolean
Like the native checkbox.
indeterminate
Checkbox
boolean
The mixed state; selection() turns it into a property.
icon, href, current and lang, only on the segmented control.
value · defaultValue
the groups, SegmentedControl
a value; a list for checkboxes
Nothing is chosen without a real default answer; the segmented control starts on the first.
selectAll
CheckboxGroup
text
The checkbox that sums up the others, with its mixed state.
selection
ChipGroup
single · multiple
Required: radios or checkboxes.
required · error
the groups, Checkbox
boolean · text
A group is optional and says so; required asks for one (or at least one). error, the server’s.
orientation
the groups
vertical · horizontal
Horizontal by default on ChipGroup.
hideLabel · iconOnly
SegmentedControl
boolean
With iconOnly, each option carries an icon and its label goes to aria-label.
onRemove · removable · removeHref
Chip
function · boolean · URL
The removable chip: in React, onRemove; in Astro, a button (removable) or a link (removeHref).
sound · lang
all
an Onda sound or none · es · en
data-sound on the control; lang, the language of its own words.
Function
What 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.
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.
Actions for invoice F-0123
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.
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
Prop
On
Values
Notes
title · description
dialogs and the sheet
text
The title is its name; in a confirmation, a question with its object.
size
Dialog · Sheet · ConfirmDialog
small · medium · large · full
Modal at 400, 560 and 720, and full; sheet at 480 and 640; confirmation at 400 and 560.
trigger
all
a button
Gets commandfor and command; in a menu, also aria-haspopup and its anchor.
action · method
dialogs and the sheet
URL · post · get
The form submits there.
open · onOpenChange
all, in React
boolean · function
Open from state and know when it closed.
onSubmit · onConfirm
dialogs and the sheet, in React
a promise
Loading 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 React
boolean
With changes, closing asks. In Astro and Liquid the component detects it.
dismissible
Dialog · Sheet
boolean
A click outside closes. By default, yes when there’s no form.
busy · error · notice
dialogs and the sheet
boolean · text
The 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 sheet
text · content
When 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 sheet
text
What the page’s region says once the surface has finished leaving after a success: “Profile saved.”
confirmLabel · destructive
ConfirmDialog
text · boolean
A verb and an object, never “Yes” or “OK”; in red if it destroys.
confirmText · reason
ConfirmDialog
text · boolean
What can’t be undone: the typed name and a reason, which goes in the log.
Up to twelve; in React, also onSelect. A disabled one carries aria-disabled: it takes focus and does nothing.
State
On
What it says
open
<dialog>
Open (showModal() and close(), the platform’s).
data-state="open" · "closed"
<dialog> and the panel
The same, as an attribute, to style.
data-busy
<dialog>
Saving: nothing closes.
aria-busy="true"
the submitting button
The only thing announced as busy.
data-done-text
<dialog>
What done says once it has left.
aria-expanded
the button that opens a panel
Its 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 sheet
The sheet giving way · the result in view.
data-pointer
the menu
Moved 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.
Visits4,8128% more than last week
Orders: 126, 3% fewer than last week. Over the last 8 weeks it falls, from 142 to 126.
Orders1263% fewer than last week
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.
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”.
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));
});
Prop
On
Values
Notes
caption · hideCaption · title
Table
text · boolean · text
It 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 } · function
With sortHref, links; otherwise, buttons. The component doesn’t sort: it paints.
selection · selected · onSelectionChange
Table
none · multiple; keys or { all: true, except }
The checkboxes, the Shift range and “Select all N”.
itemName · batchActions · rowActions
Table
{ one, other, feminine? } · actions · Menu options
Up to three actions in view; what destroys opens its confirmation.
rowHref · onRowOpen
Table
function
The name is the control and the whole row defers to it.
page · pageSize · total · pageHref · onPageChange
Table
numbers · functions
With pageHref, links. A page out of range is painted as the last one.
The empty state is a section EmptyState and the first load, its Skeleton.
striped · stickyHeader · scroll · surface
Table
booleans · card · none
scroll: two directions, the first column fixed and never a list. none: inside a Card, to its edges.
title · description · href · media · padding · label
Card
text · route · { src, alt, ratio } · auto · tight
Whole (href) or with actions (action, footer), never both.
as
Card
div · section · article
div 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
Metric
text · number or null · number · currency · percent · { value, label, tone } · up to 30 · day · week · month
With 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
Avatar
text · route · person · organization · mini to large · online · busy · away
src is never a Blob URL. Alone, decorative={false}. Each status, with its shape: filled, barred or hollow.
items · max · label · commandfor · onOpen
AvatarGroup
array · number · text · id · function
With commandfor or onOpen, a button.
lang
all
es · en
Its own words and the format of figures and dates: those in the current year, without the year.
Event
When
In 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
Function
What 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.
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.
---
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.
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
Prop
On
Values
Notes
description · icon · action
toast · Notice · EmptyState
text · a Gota icon · { label, onAction | href, hint? }
One action. A neutral toast’s icon is its action’s.
duration · key · sound · silent
toast
ms · text · an Onda sound or none · boolean
5 s; 10 s with an action; an error stays. silent if the button already sounded.
initial
Toaster
toasts with their href
The server’s, which come out after paint.
tone · dismissible · onDismiss
Notice
danger · warning · success · info · neutral · boolean · function
danger with role="alert"; the others, role="status".
Without size, its container picks. The action, in the action slot. Its text measures 20em.
value · max · label · id
ProgressBar
numbers · text
Without real progress there’s no bar.
loading · label · fallback · delay · minDuration
LoadingRegion
boolean · text · content · ms
400 and 500 by default; with no fallback, the spinner with its line at 5 s.
lines · rows · columns · rowHeight · shape · size
Skeleton
numbers or a list · line · circle
columns as a list: each column’s width, side and shape.
size
Spinner
small · medium · large
16, 24 and 40.
lang
all
es · en
“Notifications”, “Dismiss notification”, “To undo, press F6.” and “No data”.
Function
What 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.
Navigation and slider
Tabs and tab navigation, the accordion, pagination and the one- and two-value slider, with the same HTML in Astro, React and Liquid. In use across the site, the portal and Ops. Their what and when, in Open Water Design’s Tabs, Accordion, Pagination and Slider.
Summary
Three active projects and one open conversation.
Work
The store, the dealer portal and the app, each with its progress.
They render on the server. The panels are the TabPanel elements inside, one per tab with its id; the ones that aren’t the selected tab’s arrive with hidden, so nothing moves on load. The accordion is the browser’s <details> and the slider, its <input type="range">: without JavaScript they open, close and submit.
Tab navigation is a nav with links and marks the current one with current. Pagination writes real links with href. The two-value slider writes two stacked native inputs, each with its form name (names), and no number field.
In React, tabs are controlled with selected and onChange, or use defaultSelected. Pagination always writes links; with onPageChange, the list changes in place, the URL changes with pushState and Back brings it back. The slider reports with onChange while it moves (with two values, the pair already stopped) and with onChangeEnd on release or with each key.
In Liquid, lists are separated by |: tabs are id=Name, with each panel’s HTML in panels, and the slider’s marks, value=name. cu-pagination takes Shopify’s paginate and cu-range-slider, a collection’s price filter (its cents are divided by 100).
JavaScript
import { guard, navigation, surfaces, toggleAccordionItem } from '@flouvia/cuenca/behavior';
guard();
surfaces(); // the tabs' “More” menu is a Cuenca menu
navigation(); // in a portal: navigation({ surface: 'app' }), the slider stays silent
// Astro and Liquid: the selected tab and the page of a pagination with buttons
sections.addEventListener('cu-tabchange', (event) => load(event.detail.id));
pages.addEventListener('cu-page', (event) => goTo(event.detail.page)); // the page changes the list and its data-page
toggleAccordionItem(document.querySelector('#how-do-i-pay'), true); // opens it and closes the other, without jumps
Prop
In
Values
Notes
label
all
text
Required: the name of the list, the nav or the slider.
countLabel is what screen readers hear after the count.
selected · defaultSelected · onChange
Tabs
the id · function
By default, the first one that can be selected. In Astro, the panels go in the slot.
activation
Tabs
automatic · manual
manual when the panel is fetched from the network.
overflow
Tabs · TabNav
auto · more · scroll
auto: “More” with a mouse and the sliding track by hand.
size
Tabs · TabNav · Pagination
small · medium
small, with a fine pointer only; by hand, 44.
icons
Tabs · TabNav
boolean
Every tab has its own, before the name.
id · title · level
TabPanel
text · text · 2 to 6
The title shows only without JavaScript.
items · current
TabNav
{ label, href, icon?, count?, countLabel? }[] · the path
The section with that href is the current one.
items or AccordionItem
Accordion
{ id?, title, content, open? }[]
content: a text, several paragraphs or content. With an id, its anchor opens it.
exclusive · name
Accordion
boolean · text
One at a time writes name; with exclusive={false}, several.
divider · size
Accordion
separator · fade; small · medium · large
The site, fade and large; the portal, medium; Ops, small.
page · pageCount
Pagination
numbers
pageCount is pages, not rows.
href · onPageChange
Pagination
function · function
Each page’s URL; onPageChange, in React, changes the list in place.
variant
Pagination
numbers · simple
simple: previous, “Page 5 of 68” and next. It’s the table’s footer.
min · max · step · value
Slider · RangeSlider
numbers; a pair in RangeSlider
The step is 1 by default and the value snaps to it.
defaultValue · onChange · onChangeEnd
Slider · RangeSlider, in React
number or pair · functions
onChange while it moves; onChangeEnd on release or with each key.
name · names · thumbLabels
Slider · RangeSlider
text · two texts · two texts
The form names and each thumb’s name. With a feminine Spanish label, thumbLabels.
marks
Slider · RangeSlider
numbers or { value, label }
With twelve steps or fewer.
format · valueText
Slider · RangeSlider
number · currency · percent or a function · function
The bubble’s short text and the screen reader’s long one.
showValue · hideLabel · disabled
Slider · RangeSlider
booleans
showValue: the resting value, on the label’s line.
icons
Slider
two Gota icons
The minimum and the maximum; they replace the names below.
sound
Slider · RangeSlider
marks · none
The marks’ tick, on the site only.
lang
all
es · en
“More”, “Previous page”, “Page 5 of 68”, “Minimum price” and “$500 to $3,000”.
Event
When
In React
cu-tabchange
The selected tab, in Astro and Liquid: { id }.
onChange
cu-page
A page of a pagination with buttons: { page }. The page changes the list and its data-page.
onPageChange
input · change
The native slider’s, as it moves and on release; Page Up and Page Down too.
onChange · onChangeEnd
Function
What it does
navigation(options?)
Once per page: tabs, the accordion, pagination and the slider, including those that arrive later. With { surface: 'app' }, the slider stays silent.
toggleAccordionItem(item, open)
Opens or closes a question from the page; with one at a time, it closes the other without jumps.
The HTML is the contract: the behavior reads its cu-* classes and attributes, never a computed style, and it works without cuenca.css.
States live in attributes: aria-selected and tabindex on the tab, aria-current in tab navigation and on the current page, open on the question, data-page on pagination and aria-valuetext on the slider.
Without JavaScript nothing is lost: the panels go one below the other with their titles, the accordion and the slider are the browser’s and pagination is links. navigation() adds the panel role, its name and its Tab stop.
“More” is Cuenca’s menu: surfaces() opens it, and the page runs it alongside navigation().
A tab takes the radius of the segmented control at its size (--cu-tabs-small-radius and --cu-tabs-medium-radius), and its capsule, that radius minus the rail. Tabs don’t swap for a Select: when they don’t fit, there’s “More” or the sliding rail.
The behavior’s numbers are its tokens’: pagination’s seven places (PAGE_SLOTS) and the tenth of the range for Page Up and Page Down (PAGE_STEP).
Onda: changing tabs, opening a question and changing pages don’t sound by themselves; the slider sounds hover as it crosses a mark, on the site only. Cauce: the capsule travels with drop and the panel fades in with rise; the accordion opens with sheet and closes with ebb; the thumb grows with drop and the track gives like rubber. With reduced motion, everything fades in place.
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.
LDLumen DentalWebsite
LGLucero GroupDistributor portal
LBLupita BakeryOnline store
ContractUrgent
Selected: Contract, Urgent.
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'] })] },
});
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
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 · multiple
single
With several, chips inside the input. In Liquid, selection.
allowsCustomValue
boolean
no
“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’ own
large
messages.missing is the missing-value message. In Liquid, message_missing.
the rest
data-*, form
—
Goes to the control.
Function
What 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.
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.
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.
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
Prop
Values
Default
Notes
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
boolean
no
Without 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 · boolean
select · yes
With 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 · large
Cuenca’s · medium
The 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.
Function
What 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.
We use cookies to measure and improve the site. Learn more