Data Entry
RelationPicker
Choose a related record, with search and create.
import { RelationPicker } from 'faifo-design'RelationPicker renders the choice of a related record from results the application has already
filtered by permission; it performs no lookup itself. relationSelect is the ketjs-view island for
the same job: it owns its state, searches a manager function as the reader types, and can create a
record in place.
#When to use
- Use it for a field that points at another record: a customer, a product, a warehouse.
- With only
optionsand no manager, the island is a local autocomplete over the options given. - The island debounces, cancels stale requests and shows an error with a retry.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Relation picker
The renderer only receives permission-filtered records from the application adapter.
Show codeHide code
import { RelationPicker } from 'faifo-design'
export const Example = () => (
<RelationPicker
id="partner"
name="partner"
label="Partner"
query="An"
value="an-viet"
results={[
{ id: 'an-viet', name: 'An Việt', city: 'Hà Nội' },
{ id: 'anh-duong', name: 'Ánh Dương', city: 'Đà Nẵng' },
]}
getValue={(partner) => partner.id}
getLabel={(partner) => partner.name}
getDescription={(partner) => partner.city}
open
openHref="#relation-picker"
closeHref="#relation-picker"
/>
)#Relation select
Unlike its neighbors above, this is a ketjs-view island — it owns state and fetches its own results client-side, so it keeps working after this static snapshot only once the page hydrates it. Shown in its default (closed) state with one value already chosen; distinct from RelationPicker below, which is href-driven and receives results pre-fetched by the server.
- 100ml
- 200ml
Show codeHide code
import { Field, Icon, IconButton, Stack, createRelationSelectView } from 'faifo-design'
// relationSelectDemoConfig: a catalogue fixture, packages/faifo-design/src/interactions/relation-select/demo.ts
export const Example = () => (
<Stack
items={[
createRelationSelectView({
id: 'demo-relation-select',
config: relationSelectDemoConfig,
}).view(),
createRelationSelectView({
id: 'demo-dependent-relation',
config: {
...relationSelectDemoConfig,
name: 'locationId',
ariaLabel: 'Location in selected warehouse',
value: null,
options: [],
manager: {
listFunction: 'stock.lookupLocations',
listInputFields: { warehouseId: 'warehouseId' },
searchInDropdown: true,
},
labels: { ...relationSelectDemoConfig.labels, choose: 'Choose a warehouse first' },
},
}).view(),
createRelationSelectView(
{
id: 'demo-relation-add',
config: {
...relationSelectDemoConfig,
value: null,
ariaLabel: 'Add a partner',
labels: { ...relationSelectDemoConfig.labels, choose: 'Add a partner' },
},
},
{
options: () => relationSelectDemoConfig.options,
resetAfterSelect: true,
onCreate: () => {},
},
).view(),
Field({
id: 'demo-relation-validation',
name: 'partnerId',
label: 'Partner',
error: 'Choose an active partner.',
control: createRelationSelectView({
id: 'demo-relation-validation-picker',
config: {
...relationSelectDemoConfig,
name: 'partnerId',
value: null,
triggerId: 'demo-relation-validation',
invalid: true,
describedBy: 'demo-relation-validation-error',
ariaLabel: 'Partner',
},
}).view(),
}),
// Tags: chips inside the control, searched as typed; a row of a product's attributes.
Field({
id: 'demo-relation-tags',
name: 'values[volume]',
label: 'Volume',
type: 'select',
control: createRelationSelectView({
id: 'demo-relation-tags-picker',
config: {
...relationSelectDemoConfig,
name: 'values[volume]',
ariaLabel: 'Volume',
triggerId: 'demo-relation-tags',
multiple: true,
presentation: 'tags',
values: ['100ml', '200ml'],
options: ['30ml', '50ml', '100ml', '200ml', '300ml'].map((value) => ({
value,
label: value,
})),
labels: {
...relationSelectDemoConfig.labels,
choose: 'Search or create a value…',
createTitle: 'Create value',
createNamed: 'Create “{query}”',
},
},
}).view(),
action: IconButton({ label: 'Remove attribute: Volume', icon: Icon({ name: 'x' }) }),
}),
]}
/>
)#Contract
#Relation pickers
When used inside Field, pass its ID as config.triggerId, its validation state as invalid and help/error IDs as describedBy. These apply to the visible keyboard trigger, so the label and refused-submit focus target remain accessible.
manager.listInputFields binds required RPC input names to native field names in the same form (for example { warehouseId: 'warehouse' }). The picker stays disabled until all parents are set. A parent change aborts outstanding reads, clears the dependent selection and results, and preserves unrelated form fields. Inputs are read again for each query; server authorization and validation remain mandatory. No callbacks are serialized.
RelationSelect (createRelationSelectView/relationSelect) is a live client
island, unlike the rest of the package's progressively enhanced controls: it owns
its own state and calls /_ket/fn/<name> itself through RelationSelectConfig.manager
(listFunction, optional saveFunction/removeFunction). A consuming app mounts
it through its own island runtime (defineIsland in @ketvietlab/ketjs-view) and
supplies a JSON-serializable config; nothing about it depends on server-rendered
markup, so it may be cold-mounted anywhere the host places a matching island
element — including inside a view that is itself already client-rendered, such as
a modal a JavaScript runtime opened — not only hydrated from the page's initial HTML.
For a large catalogue, set manager.searchInDropdown: true to search the server
while typing in the inline dropdown (180ms debounce). Results use the manager's
label and description fields, with loading, error/retry and empty states. New
queries abort the previous read and late responses are ignored. Selected values
remain available to the native form. Omit this option for a local picker; the
manager's More dialog remains available in both modes.
Every read sends the typed query and a row limit beside the manager's listInput
and bound fields, as search and limit unless searchParam/limitParam rename
them. The list function declares both as optional inputs: KetJS refuses an input a
function does not declare (E_INVALID_INPUT), which leaves the picker on its error
state. Match without accents or case where the database collation does not fold
Vietnamese letters (company.listBranches is one such function).
A record a manager picker creates in its More dialog, renames there, or picks from
server results joins its options for the rest of the page, keyed by listFunction. A
record form re-mounts its islands from props written before that record existed; the
picker still shows the choice's label, its native select still holds the value it
posts, and every picker of that list offers the new record, without a reload.
After a single selection, focus returns to the visible trigger. If native form reconciliation replaces its island during the change event, resolve the replacement trigger only within the same connected field. Never take focus from another field or from a newly navigated page.
A picker seeded with options and no manager is a local autocomplete: its
dropdown lists every match of the typed text (label and description, ignoring case
and accents, so bong finds "Bông"), not the first seven, and it shows no More footer, because without a manager there is
nothing to browse. Opening the trigger moves focus to the search field, so typing
filters straight away. A record form mounts every relation field (customer,
salesperson, warehouse, SKU) as this picker island rather than a plain <select>,
including the add row of an inline line editor.
A disabled picker (config.disabled or callbacks.disabled) disables its trigger
and draws it as a disabled field control does: the same stroke, fill, ink and
not-allowed cursor. A value locked by the record's state (a recorded asset's
source document, say) must not look like an open choice beside a disabled select.
Its option rows (relation-option, relation-dialog-row) show the current
selection as a trailing mark on the label's own line, never on a line of its own
below a description. The dialog's "more" action is a full-width row like the
options above it, not a chip-sized button; a consumer overriding the footer should
widen it to match, not narrow it to its label's content.
The picker itself fills its field column; only its dialogs are narrow. Browsing,
editing and quick create all open a small sheet (34rem). The browse list keeps one
height while it is searched (--faifo-modal-fixed-height, 36rem at most), with the
search and Create in a band that stays put above the scrolling rows; the form is
as tall as its fields and keeps Cancel and Save in the sheet footer. A row
is the record, its Select action and, when the manager can save or remove, one
"more" button that holds Edit and Remove: a row never grows a button per
command. Remove asks on the row itself (Cancel beside the confirming button)
instead of acting at once, and a refused save or removal is reported in a notice
with the server's reason, while a failed load offers Retry. Escape steps back one
layer at a time: the row menu, then a pending removal, then the dialog.
#Tags presentation
A multiple picker set to presentation: 'tags' is a combobox. Its chips sit
inside the control box before a text input (relation-input, role="combobox",
the Field's ID via triggerId) that searches as it is typed. Chosen records leave
the list. The control box draws the field stroke, focus ring, invalid and disabled
states; the input draws none of its own. Arrow keys move the active option
(aria-activedescendant), Enter picks it and never submits the form, Backspace in
an empty input takes the last chip off, the trailing clear button takes them all,
and Escape closes the list. A choice closes the list and keeps focus in the input,
including when the host answers the change by mounting the picker anew. The
native select still posts the choices joined by a comma.
With a manager that has saveFunction and fields, the footer offers
labels.createNamed ({query} is what was typed) and Enter with no match does the
same: the manager dialog opens small, on the editor alone, its label field filled
with the typed name, its actions in the dialog footer (labels.createTitle names
it). Without a manager, callbacks.onCreate receives the name. The editor's fields
are the design system's own Field. A save function that answers with the record
it made ({ [idField]: ... }) gives the picker that id; otherwise the client id
stands. A record created in the dialog bubbles faifo:relation-created
(detail: { name, option }) from the picker before the choice reaches the form,
so a host can read its own data again: the KetSuite record runtime re-reads the
record quietly, keeping drafts, tab and view state. Created and learned records
are keyed by listFunction and listInput, so the values of one attribute never
join another's picker.
Inside a Field with an action (a remove button, say), a tag picker takes the
row's full width instead of the compact width a short entry keeps.
Its inline dropdown is not a <details>, so the shared outside-click delegator
does not own it. With native Popover support the island places its inline menu
in the browser top layer, preserving its DOM parent, native form and theme while
escaping Surface or modal clipping. The component owns a 4px anchor gap and 8px
viewport inset (--faifo-space-1/--faifo-space-2), start alignment including RTL,
above/below placement and bounded scrolling. Resize, ancestor scroll and visual
viewport changes reposition it; disposal removes listeners and closes the popup.
Without Popover support it retains its existing inline dropdown. Config, labels,
callbacks and form values are unchanged. Escape returns focus to the trigger;
moving focus outside or clicking outside closes the menu.
The shared outside-click delegator
(above) does not see it; the component closes it on an outside click itself,
same contract, different mechanism. Choosing a value also fires a real change
on the hidden native select (bubbling, a microtask after the choice settles) so
a host page's own change-driven wiring keeps working — a second field whose
options depend on this one's choice can key off it exactly as it would a plain
<select>. Rendering the picker itself through each, keyed on whatever the
dependency is, is what a host needs to swap it for a fresh instance when that
key changes: the component holds no update(), so a config change alone (a new
manager.listInput, a new options list) never reaches an already-mounted one.
The app structure is demonstrated with AppNavigation and four practical layouts inside AppShell:
collection (ListPage), record (RecordPage), flow workspace (WorkspacePage
with layout="flow"), and canvas workspace (WorkspacePage with
layout="canvas"). Compatibility adapters remain available for migrated
screens, but new catalogue examples should show one of those practical surfaces
inside the shell.
AppNavigation is the canonical dashboard menu. Supply one grouped item model and
place it in AppShell.sidebar; it is a persistent sidebar at 768px and above and a
mobile drawer below that breakpoint. The markup remains usable without JavaScript.
Items may contain recursive children; a parent expands its submenu directly below
the parent row, and an active descendant opens the complete path on first render.
Only leaf links expose the active state. By default, top-level branches form one
accordion and its open branch stays open until another branch is chosen. A group with
exclusive: false has independently collapsible branches, including keyboard activation.
Use expanded when a branch should start open without an active descendant.
An external NavigationToggle.controls must name the rendered drawer ID, which is
the navigation ID followed by -drawer; the shared runtime owns Escape and focus return.
Sizing, text roles and responsive rules live in the
Faifo Design navigation contract.
Labels and descriptions wrap; rows grow for long translations. Optional leading
content and counts reserve space only when supplied. Consumers do not override
navigation geometry or icon size.
KetSuite's sidebarMain and sidebarNavigationContent accept counts, a map of
authorized personal open-work totals keyed by menu node ID. Only positive safe integers
render through NavigationItemData.count; zero, missing and invalid values hide the badge.
Compute totals within the viewer's company and permissions before passing them to the shell.
List filters do not change these personal totals. Assignment and completion refresh the totals.
For branches with a leading icon, the 1px child guide is centred on the icon slot;
its offset is included in the child inset so parent and child labels stay aligned.
A reference-style menu, where branches are sections of one document rather than app
areas, sets caret: true on its NavigationGroupData: each branch without its own
leading content shows a chevron in the leading column (data-caret="true"), which
turns to point at the children while the branch is open. Give the group's leaf items a
leading icon so their labels align with the caret branches.
The optional interaction adapter adds mobile dialog semantics, Escape/backdrop/link
closing, focus trapping and restoration, background inertness, and scroll locking.
// File: src/ui/workspace.tsx
<AppShell
sidebar={
<AppNavigation
id="main-navigation"
label="Main navigation"
identity="KétSuite"
context="Operations workspace"
groups={[
{
id: 'sales',
label: 'Sales',
items: [
{ id: 'orders', label: 'Orders', href: '/orders', active: true, count: 7 },
{ id: 'customers', label: 'Customers', href: '/customers' },
{
id: 'reports',
label: 'Reports',
children: [
{ id: 'sales-report', label: 'Sales report', href: '/reports/sales' },
{ id: 'stock-report', label: 'Inventory report', href: '/reports/inventory' },
],
},
],
},
]}
/>
}
main={<ListPage title="Orders" body={orders} />}
/>The catalogue is isolated behind faifo-design/catalogue, so the
production entry point does not load its specimen data or catalogue chrome.
Its registry connects every public component to an owner, maturity, supported
states and a rendered specimen. Component implementation and selector-bearing CSS
live below per-component-family directories; consumers still import only from the
package root.
The documentation site in packages/docs renders every specimen with its source and an API
reference generated from this package (npm run docs:dev at the repository root). A host can
also serve the package's own pages from faifo-design/catalogue: CataloguePage for the
specimens and InventoryPage for the governance registry, which lists public exports with
ownership, maturity, evidence posture and promotion decisions. Its filters are URL-owned and
work without client JavaScript.
The registry reads src/catalogue/inventory.generated.{ts,json}, which npm run build and
npm run check derive from source. They are ignored by Git, so branches never conflict on them. Check
that every export has a policy entry, and the governance contract, with:
# Run from: repository root
npm run design:inventory:check
npm run design:governance:checkPass applications to render an AppSwitcher before the primary sidebar.
Single-application hosts can omit applications. The topbar slot then spans the
shell, with the primary sidebar and main below it. In viewport mode the desktop
sidebar sticks below the header and uses the remaining viewport height. A standalone
shell with only location uses it as the full-width header. With both slots, location
renders inside main. rightRail keeps the desktop column and stacks after
main at narrower widths. On mobile, the default AppNavigation trigger sits
between the header and main. For an external trigger, connect NavigationToggle
to the drawer ID and set externalTrigger on AppNavigation.
The drawer uses its full width for navigation, and the sidebar's desktop Collapse
control is hidden because the app switcher normally supplies its reopen control.
See the catalogue's Single-app shell specimen.
With an app switcher, hosts provide the translated navigation
label, optional screen-help label, optional settings: { id, label, items } or settings: { id, label, href, current? } (see Settings directory), active app ID, and { id, label, icon, href?, sameTab?, unavailableLabel? } items. Omit a destination for a coming-soon or unavailable app: the icon stays focusable for its name/status, with aria-disabled and no link action. The public
component owns the 48px graphite rail, 18px Porto Faifo icons, hover/focus names, active
indicator and native same-tab links. Set sameTab: true if the destination needs to load a new
document to replace the shell. The flag adds data-ket-reload to opt out of fragment navigation.
The newTabLabel prop is deprecated. Desktop
items are 36px; mobile items have a 44px touch target. On mobile the rail is hidden
until the application menu opens; the shared runtime moves the same SSR node into
the drawer, keeping it within the dialog's Tab loop, and restores it for desktop
or cleanup. No rail markup belongs in navigation fragments.
Suite apps pass applications.brand for the symbol at the top of the rail and
applications.navigation: { controls, label, tools } for its sidebar opener.
AppBrand.variant="mark" crops the symbol from the start of a three-to-one lockup;
it does not widen the rail. The graphite rail uses the dark brand asset in either theme.
AppNavigation.tools supplies translated search label/placeholder, empty state and
collapse label. Its 44px header names the current app (Sales/Kinh doanh, Website),
has no divider, and stays outside the scrolling menu. Search opens on click, filters
the existing permitted menu including ancestor labels, ignores accents/case, opens
matching branches and restores their prior state when cleared. Escape closes search
before a mobile drawer. Global search remains a separate record/menu launcher.
Desktop collapse hides only the main sidebar and gives its width back to content;
the rail retains a focusable opener. Its state and search draft survive fragment
navigation. Mobile keeps the normal modal drawer and 44px controls; collapse is hidden.
The disposable shared runtime owns filtering, mutation observation, inert and focus;
consumers supply data/labels instead of rebuilding controls or CSS.
The footer renders a question-mark button only when helpLabel is supplied. Activating
it emits the bubbling, cancelable faifo:screen-help-request event with
detail.trigger. This is a screen-owned guide hook only; the shell does not yet
supply guide content. A screen can render one HelpDrawer inside its changing content slot;
the shared runtime resolves the current drawer when opened, including after navigation or record updates replace that slot.
the shared runtime connects the persistent shell button to that guide. Below it, the settings gear uses
the shared Menu with placement="right", aligned to the trigger bottom and
clamped inside the viewport/drawer. It opens on click/touch or keyboard, never
on hover. Escape dismisses the menu before the mobile navigation drawer; outside
click and selection dismiss it too. Hosts supply translated settings entries.
KetSuite's production suiteApplications projects the deployment's permission-filtered menu into Kinh doanh/Sales and Website destinations, plus disabled Accounting, Flow and Chat entries. Phone takes its destination from a phone menu root when a module supplies one (otherwise it stays coming soon) and opens with sameTab: its screens live in this same shell. A screen of such an app asks adminPage/frameOf for app: 'phone', which sets Frame.app; the shell then lights that rail item, names the sidebar after it and fills the sidebar with that menu root alone, while the Sales menu (suiteMainMenu) leaves the root out. Backend frames and Website Studio share the same registry. Accounting and the duplicate Website destination leave the main menu; Website stays in the rail. Administration moves to the rail's click-only settings menu, retaining permitted links. Help is omitted until screen guides are ready. The browser-safe adapter is also exported from @ketvietlab/ketsuite/ui/application-switcher.
The catalogue's placeholderApplications supplies Sales, Stay, Website, Flow and
Accounting examples; hash destinations are placeholders, not a deployment URL
policy. Backend hosts can replace them through Frame.applications. /demo2
uses ?app= destinations with a document reload to show the selected app's shell.
Commerce Atlas uses the backend frame-slot contract. Its AppShell.location
contains AppTopbar inside backend.global-topbar, so record/source navigation
refreshes the current collection search action and identity along with content.
Keep the shell and sidebar owners in place; do not patch the topbar's private
links from the product runtime. This differs from /demo2's content-only slots
and client-owned navigation state below.
/demo2 keeps the same workflow with 18 application modules and the current
KetSuite shell: a symbol AppBrand on the graphite rail, current-app navigation header, organisation context and
global search/theme/account tools in AppShell.location, and no page breadcrumbs.
Global search finds navigation destinations and sample orders; its native GET
fallback preserves the selected appearance. Sidebar links, filters and nested
selection remain URL-owned. /demo retains its original composition.
The first request server-renders the complete shell. KetJS navigation requests use
navigablePage and return only demo.content, demo.overlay and a hidden
demo.navigation-state slot; the topbar and sidebar are never fragment targets.
The client updates active navigation attributes and opens the active branch in
place, with disposable page interactions and relation-island hydration after each
swap. Native links and GET forms remain the fallback when JavaScript is unavailable.
The demo supports grouped and flat presentations. Visual hierarchy, spacing and surface rules are defined only by the skill; API behavior is documented below.
The public entry exports actions, status and feedback objects, fields, navigation,
Tab, Tabs, TabPanel and TabbedView, progress, layout primitives, the responsive application navigation, the
three-region app shell, page/record layouts,
ListChrome with BulkActions and PagerBar, the canonical list and record page
compositions, data tables, forms, and modal sheets. Use ListPage for operational
collections: applications provide translated identity, URL-driven controls and
result content while the pattern keeps header, controls, status, body and footer in
one stable order. DataTable covers the common collection contract: responsive
stacking, row selection, sorting, grouping, visible columns and row links. Do not
place record action buttons inside table rows; link the row to the record instead.
A document's own lines (the lines of an order inside its record) are no exception:
they are edited in a FaifoGrid (see Editable grids: FaifoGrid), never through form
controls in table cells, an add form in the table's last row or a dialog per line.
Where those lines are only read, such as on a page beside the record, the table stays
read-only and links to the record that holds the grid. Give short
values a kind (number, currency, identifier, ...) so a tight table never
breaks an amount or a unit between its characters.
A table needs exactly one name: title frames it in a titled Surface, caption
shows a caption above the rows, and label names it for assistive technology only,
for a table whose Section or Surface heading already says what it is. Do not repeat
that heading as a caption.
A titled table may add description, one line under the title that its Surface
renders (for example how the rows relate); the table itself stays unframed. Without
title the description is not shown.
Use RecordPage for durable subjects, and the compatibility FormPage only for
existing create/edit screens that have not migrated. Form fields support native
controls, custom controls, checkbox/radio groups and nested field groups. Route-owned
ModalSheet instances carry close/backdrop metadata and become fullscreen at the
mobile breakpoint. ConfirmDialog keeps a centred card with a 16px phone gutter and
a scrollable body when needed. When one opens, the runtime focuses its first aria-invalid="true"
control (a step returned from a rejected submit), else its first control, else the dialog.
RecordPage moves its commands below the record's identity when the page itself is narrower
than 48rem, measured on the page container so a sidebar beside it counts: title, status, meta
and path read as one block, then the commands follow 12px away (header gap plus the commands'
own separation). The shared page band (WorkspacePage and its DashboardPage/BoardPage forms, ListPage
and the shell page header) does the same on a phone (below 42rem): its heading unwraps so the meta row joins the title
block, the band owns a 4px identity gap and the commands come last with 8px of their own, as on
ListPage; the compatibility FormPage follows the RecordPage order on a phone. A status or
description therefore never reads as a caption of the buttons. Phone rules use
max-width: 47.9375rem (or width < 48rem); max-width: 48rem also matches the 768px
desktop layout and is not used. The catalogue includes common component states; the page preview
also covers loading, empty, error, validation and read-only states in English and Vietnamese.
FaifoTableColumn.wrap opts a descriptive column into wrapping within the shared
text-width token; rows grow with content. It works in server and island tables.
Identifiers and numeric columns keep the default single-line behavior.
With layout: 'fixed' a single-line cell that runs out of room ends in an ellipsis rather
than painting over the next column; the full text stays in the DOM. A cell that stacks lines
in a Stack (a name over its detail) ends each line in its own ellipsis. A link or button placed
directly in the cell is bounded and truncated itself and draws its focus ring inset, so the
clip never hides focus. Cells holding a Menu or popover stay unclipped, the row link's
overlay belongs to the row, and stacked rows wrap instead. Give long subjects wrap: true.
An outline (the indicators of a financial statement or a tax return) stays one FaifoTable with
the same columns on every row. The server form's rowLevel(row) gives a row's depth: the row
gets data-level and --kt-row-level, and its subject cell (the first cell, or the one after
the selection cell) indents one --faifo-space-4 step per level, capped at 4. rowEmphasis(row)
returns 'group' for a row heading the rows below it or 'total' for a row adding them up:
both read semibold and a total gets a --faifo-border-strong rule above it; any other value is
dropped. A level of 0 or null and no emphasis render the row as before. Stacked rows on a phone
drop the indent and the rule and keep the weight. Product code does not indent with spaces or
padding of its own; see test/design-system-faifo-table-outline.test.tsx.
rowHref provides one keyboard link per row, including the full row pointer target.
The link wraps the first column's cell and takes its text as its name, so the first column
names the row's subject (a title, a person), never a sequence number or a due date.
A row checkbox is named "{selectRow}: {row}". An island table takes the row from the first
column's plain value; a server table renders its cells, so it passes rowName(row) (the
same subject the first column shows). Without either, the checkbox falls back to the row id.
currentRow names the row the reader came back to from its record page: the row gets
data-current="true" and its link aria-current="true", drawn as a 2px accent bar on the
row's start edge (its first cell; the whole stacked row on a phone), so it reads apart from
selection and hover and keeps the row's fill.
A stacked row (responsive: 'stack', below 48rem) leaves priority: 'tertiary' columns to
its record, so a phone row stays a short summary; the cell carrying the row link is always
kept. A stacked cell holding a field or a Progress bar gives it the whole row under the
column label: neither has a width of its own, so beside the label it shrank to its padding
or to the percent next to it. Header and cell alignment use start/end, so align: 'end' numbers and the
current-row bar follow dir="rtl"; component stylesheets never set text-align: left|right.
A stacked row has no header row, and its title cell shows no column name. A Field in
that cell whose label is hidden because the column header names it (labelHidden, as in
a document's entry row) shows its own label above the control there, in the muted small
type of the other cells' names. A column of the row's own commands takes kind: 'actions':
stacked, it shows them at the row's end without the column name.
Linked cells are display-only. Associate selection.form and bulk.form with the
same native form to submit selected IDs and the bulk command. Selection syncing
and select-all remain application runtime responsibilities.
At every width and in every container a form puts each label above its control,
with help and errors below the control on the label's start edge (owner 26/11/2026;
the label-beside layout from tablet width up, #1040, is gone). A label reads 1px
smaller than the input it names on desktop (--faifo-label-font-size: 12px beside a 13px
input); below tablet width, where the input grows to 16px, the label stays 13px. Fields in a two-column
Grid or a default FormGrid get half of the row each; only a grid narrower than 28rem
gives each field a whole row, and below tablet width FormGrid is one column.
FormGrid columns={3} keeps its own breakpoints. A lone checkbox keeps its label
beside the box and a Switch keeps its label beside it from tablet width up. A field
with labelHidden, a field action (entry and command on one row below the label)
and width are unchanged. Native inputs support readOnly,
min and max; choices can be disabled individually, and invalid nested groups
open automatically. Give repeated search/sort controls unique IDs. Loading links
are disabled, and empty query rows do not occupy space.
A number a person types in their own language takes locale on NumberField or
MoneyField. The browser's number input reads "." as a decimal point whatever the language
and shows no grouping, so "28.600" typed by a Vietnamese reader became 28.6. With
locale="vi" the field is a text input with inputmode="decimal" and
data-number-locale="vi"; it shows value grouped as the language writes it
("1.800.000", "1.234,5"), regroups when the reader leaves it, and
attachDesignSystemInteractions puts the plain decimal ("28600") in the form data
when the form is read, including new FormData(form) in a client runtime.
parseLocaleNumber(text, locale) returns that plain decimal, "" for empty text or null
for text that is not a number: grouping marks count only in groups of three, and a single
mark that cannot be grouping ("12.5" in Vietnamese) is read as the other habit's decimal
point. formatLocaleNumber writes a plain decimal for a language and shows anything else
as typed; numberControlValue(control) reads a control as its plain decimal. A server that
also accepts a submit without JavaScript parses the field with parseLocaleNumber.
Without locale both fields keep the native number input.
Route-modal and mobile-navigation focus trapping, background inertness, Escape,
focus restoration, scroll locking, and anchored positioning are provided by the
optional attachDesignSystemInteractions adapter. Route state, unsaved-change
decisions and submit outcomes remain application
responsibilities. Menu, popover, tooltip, dialog, toast, spinner and skeleton renderers
retain native links/forms and useful no-script behavior. See the backend development
guide for the full composition and integration contract.
A toast also reports work that runs in the background (an import) while it runs:
Toast.progress: { value, label } draws a small Progress across the toast, below its
copy and actions. The bar and its label (180 of 450 rows) sit in aria-live="off", so
polling updates are not read out; put what a reader must hear in title and message
(started, finished, failed) and keep counters out of them. One ToastRegion per page owns
the bottom corner; the application polls and keeps the region mounted while empty so the
first toast is announced. While a modal dialog is open the runtime makes the page under it
inert, and a region inside that inert page drops under the dialog layer: a lasting toast
never covers the dialog's actions, and it returns to the top when the dialog closes.
One action (View) sits beside the copy; two or more (View, Dismiss) take their own row
under it, so the title and message keep the toast's width.
Specimen: feedback-runtime.
The shared adapter handles keyboard navigation only inside its attached root and respects keys already handled by an inner layer. Disposing an ordinary island does not move focus or release another overlay's inert lock. Modal Tab loops include native menu summaries and skip negative tab stops, disabled controls, inert/hidden content and the body of closed disclosures, even when the browser retains their layout rectangles.
Typed form exports cover scalar and selection fields, controlled combobox/tag pickers,
civil date and local-time values, native file inputs, and a generic relation renderer.
Applications retain validation, query, permission, timezone, upload, and persistence
ownership; renderers preserve submitted text and expose native fallbacks.
Combobox names its toggle with openLabel/closeLabel and its list's loading and empty
states with loadingLabel/noResultsLabel; the defaults are English, so a page in another
language passes all four.
A server-rendered host that must react to a pick in place (for example a LiveView bridge)
may render the options as <button data-ui="combobox-option"> instead of links; the stylesheet
gives those buttons the link option layout, so the host adds no CSS of its own.
Data-operation exports compose URL-owned search/filter/sort/view state, one-link resource rows, bounded grids, hierarchy, and inline native forms. The package renders state and carries version tokens; application adapters own persistence, conflicts, permissions, cross-page selection, and dataset queries.
Record composition exports cover facts, people, formatted values, one identity summary,
one neutral rail, activity/audit, attachments, and media. Applications pass authorized,
redacted results and retain storage and mutation ownership. Catalogue recipes vary slots
within ListPage, RecordPage, and WorkspacePage; they do not add a fourth page pattern.
RecordRail owns the separation of its sections: one --faifo-layout-gap and a divider
between them, as a divided Stack. Pass sections to it rather than wrapping them in a
Stack or adding margins.
StagePath shows where one record stands in its process, like Salesforce's Path or
an ERP's status bar: each step is complete, current or upcoming, and a closing step
that is current takes the outcome's tone (positive won, danger lost). It carries no
counts or percentages; Pipeline is for how many records sit in each stage. The current
step has aria-current="step", a passed step reads completeLabel after its name as
well as showing a check, and the step's href (for example, a move dialog) is a link on
every step except the current one. Names wrap rather than truncate; once the path is
narrower than 48rem, every step but the current one folds to its check or number. Pass it
as RecordPage path: the header's last row, so the header owns its spacing. controller
stays for a working editor below the header.
Before release, run npm run design:release:check from the repository root. It
requires zero planned components, a specimen and test evidence for every registered
component, and a changelog entry for the version. Publishing remains the owner's
decision, from main.
Button/input dimensions are pinned to Polaris React 13.9.5: default buttons map to large (32px desktop / 36px mobile), matching inputs. Compact is 28/32px. Density does not resize controls. See the dimension matrix and run npm run test:design-system:browser to enforce measured geometry.
#RelationSelect field validation
RelationSelectConfig optionally accepts triggerId, invalid and describedBy. Compose these with a public Field: use its ID as triggerId, set invalid when the server returns a field error, and associate describedBy with the Field error ID. The visible trigger owns aria-invalid and keyboard error focus; the off-tab native select retains submission and required validation. Existing configurations may omit all three properties.
#API
Generated from the package source. A property without a description has none in the source yet.
#createRelationSelectViewFunction
function createRelationSelectView(props: RelationSelectIslandProps, callbacks?: RelationSelectCallbacks): IslandController & { ...; }| Parameter | Type |
|---|---|
propsrequired | RelationSelectIslandProps |
callbacks | RelationSelectCallbacks |
| Returns | IslandController & { getSelectedValues(): string[]; } |
#relationSelectFunction
function relationSelect(props: IslandProps): IslandController| Parameter | Type |
|---|---|
propsrequired | IslandProps |
| Returns | IslandController |
#RelationPickerComponent
The application supplies permission-filtered results; this renderer performs no lookup.
| Property | Description | Type | Default |
|---|---|---|---|
idrequired | – | string | – |
namerequired | – | string | – |
queryName | Name used for the human-readable search text; defaults to ${name}Query. | string | – |
labelrequired | – | string | – |
queryrequired | – | string | – |
value | – | string | null | – |
openrequired | – | boolean | – |
openHrefrequired | – | string | – |
closeHrefrequired | – | string | – |
help | – | string | null | – |
error | – | string | null | – |
issues | – | readonly FieldIssue[] | – |
required | – | boolean | – |
disabled | – | boolean | – |
loading | – | boolean | – |
loadingLabel | – | string | – |
noResultsLabel | – | string | – |
openLabel | Names the toggle that opens the options; the default is English, so a page in another language passes it. | string | – |
closeLabel | Names the toggle that closes the open options. | string | – |
span | – | 'half' | 'full' | – |
width | How long the chosen value is (Field width): a short choice keeps a short control. | 'xs' | 'sm' | 'md' | – |
resultsrequired | – | readonly T[] | – |
getValuerequired | – | (result: T) => string | – |
getLabelrequired | – | (result: T) => string | – |
getDescription | – | (result: T) => string | undefined | – |
#Types
#RelationEditorField
| Property | Description | Type | Default |
|---|---|---|---|
namerequired | – | string | – |
labelrequired | – | string | – |
type | – | 'text' | 'email' | 'tel' | 'select' | – |
required | – | boolean | – |
options | – | RelationOption[] | – |
#RelationManager
| Property | Description | Type | Default |
|---|---|---|---|
listFunctionrequired | – | string | – |
requestQuery | Encoded same-origin RPC context (tenant, branch, locale); supplied by the application. | string | – |
resolveParam | Resolve a selected id absent from primed options through listFunction. | string | – |
searchInDropdown | Read the server while typing in the inline picker, rather than filtering only primed options. | boolean | – |
listInput | – | Record<string, unknown> | – |
listInputFields | Required RPC inputs bound to named controls in the same native form. Changing a parent clears this selection. | Record<string, string> | – |
searchParam | – | string | – |
limitParam | – | string | – |
limit | – | number | – |
idField | – | string | – |
labelField | – | string | – |
descriptionField | – | string | – |
saveFunction | – | string | – |
saveDefaults | – | Record<string, unknown> | – |
removeFunction | – | string | – |
removeDefaults | – | Record<string, unknown> | – |
fields | – | RelationEditorField[] | – |
excludeIds | – | string[] | – |
#RelationOption
| Property | Description | Type | Default |
|---|---|---|---|
valuerequired | – | string | – |
labelrequired | – | string | – |
description | – | string | null | – |
#RelationSelectConfig
| Property | Description | Type | Default |
|---|---|---|---|
namerequired | – | string | – |
ariaLabelrequired | – | string | – |
triggerId | Public field association for enhanced controls; existing callers may omit all three. | string | – |
invalid | – | boolean | – |
describedBy | – | string | null | – |
value | – | string | null | – |
multiple | Several records under one field name, joined by a comma on the way out. A repeated form key would not survive readForm, which builds a Record<string, string> and keeps only the last value — so a multi-valued field posts one comma-separated string, which is also what the routes that take value lists already parse. | boolean | – |
presentation | How a multiple picker shows what it holds. list (the default) keeps a fixed "add another" trigger with the chips beneath it. tags is a combobox: the chips sit inside the control before a text input that searches as it is typed, chosen records leave the list, and a manager with a saveFunction creates the typed name in its dialog. Ignored unless multiple. | 'list' | 'tags' | – |
values | – | string[] | – |
optionsrequired | – | RelationOption[] | – |
required | – | boolean | – |
disabled | – | boolean | – |
labelsrequired | – | RelationSelectLabels | – |
manager | – | RelationManager | – |
#RelationSelectCallbacks
Client-only composition hooks; keep callbacks out of serialized island props.
| Property | Description | Type | Default |
|---|---|---|---|
options | – | () => RelationOption[] | – |
disabled | – | () => boolean | – |
onSelect | – | (option: RelationOption) => void | – |
onCreate | – | (query: string) => void | – |
resetAfterSelect | An add-to-list picker returns to its placeholder after each selection. | boolean | – |
#RelationSelectLabels
| Property | Description | Type | Default |
|---|---|---|---|
chooserequired | – | string | – |
searchrequired | – | string | – |
morerequired | – | string | – |
noRecordsrequired | – | string | – |
loadingrequired | – | string | – |
loadErrorrequired | – | string | – |
dialogTitlerequired | – | string | – |
closerequired | – | string | – |
selectrequired | – | string | – |
createrequired | – | string | – |
editrequired | – | string | – |
saverequired | – | string | – |
cancelrequired | – | string | – |
removerequired | – | string | – |
confirmRemoverequired | – | string | – |
retryrequired | – | string | – |
clearrequired | – | string | – |
chosenrequired | – | string | – |
createTitle | The create dialog's title when it opens straight from a typed name (tags presentation); defaults to create. | string | – |
createNamed | The footer action naming what was typed, {query} standing for it: "Create “{query}”". | string | – |
#RelationPickerProps
The properties of RelationPicker, listed above.
#Hooks
The data-ui values these components render. Select them in tests and behaviour; their look belongs to the design system. See Contract.
relation-pickerrelation-selectrelation-nativerelation-triggerrelation-valuerelation-caretrelation-chipsrelation-chiprelation-chip-clearrelation-controlrelation-inputrelation-clear-allrelation-menurelation-searchrelation-optionsrelation-optionrelation-footerrelation-emptyrelation-editorrelation-dialog-toolbarrelation-search-fieldrelation-search-iconrelation-dialog-listrelation-dialog-rowrelation-dialog-mainrelation-dialog-metarelation-dialog-actionsrelation-dialog-contentrelation-dialog-subjectrelation-row-menurelation-row-more