Synertech Web/ui v0.57.5 Site Storybook

Documentation / Hooks & utilities

Translatable labels

Client@synertech/ui

Every string the library writes by itself — visible text, accessible names, placeholders, validation messages, from the pagination of a grid to the help button — is gathered in a UILabels object. Without a provider, they are the English labels of defaultUILabels; frenchUILabels holds their French translation, and any other language is an object with the same keys.

UILabelsProvider applies a set of labels to its whole subtree. Its labels prop is partial and merged with the inherited labels: providers nest, each overriding only what changes.

The order is always the same: the prop of the instance, then the provider, then English. A component that writes up to three strings has one prop per string (closeLabel, removeLabel, searchPlaceholder…); beyond that, a single labels prop taking the very keys the provider takes (UILabelsOf<"dataGrid">).

Labels stay plain strings, so that they can come from a JSON file. What varies is written as a placeholder — "Page {page} of {total}" — that formatUILabel() fills; a translation keeps the same placeholders. useUILabels() reads the current labels for your own components.

Label, Breadcrumb and Avatar render on the server: with no hook, the provider does not reach them, and their label is a prop.

The labels are a language; the way a number or a date is written is a place. So the provider takes a locale too ("fr-CA", "en-US"), read by the charts, Calendar, ChartPeriodPicker, NumberInput and the footer of DataGrid; the locale prop of one instance wins. Without either, those components follow the language of the runtime, which is not the same on the server and in the browser: an application rendered on the server sets the locale, or “1,284.5” becomes “1 284,5” at hydration. useUILocale() reads it for your own components. StatCard, ChartFacets and ChartScaleLegend, rendered on the server, take it as a prop.

Last, the provider carries the link of the application's router, linkComponent: next/link, the Link of next-intl, or a component of your own that renders an <a> with everything it receives. Sidebar and Header render it for every address that stays in the application; without it, they write an <a href>, and a click loads the whole page again. Breadcrumb and FooterLink, rendered on the server, take it as a prop.

Examples

French application

One provider at the root translates every component of the library.

Open in a tab
import { useState } from "react";
import { Button, Modal, UILabelsProvider, frenchUILabels } from "@synertech/ui";

export function FrenchApp() {
  const [open, setOpen] = useState(false);

  return (
    <UILabelsProvider labels={frenchUILabels}>
      <Button onClick={() => setOpen(true)}>Exporter</Button>
      <Modal isOpen={open} onClose={() => setOpen(false)} title="Exporter le rapport" showCancel>
        <p>
          Les boutons affichent « Confirmer » et « Annuler », la croix s’annonce « Fermer la fenêtre
          ».
        </p>
      </Modal>
    </UILabelsProvider>
  );
}

Choosing the language

The label set follows the user’s language; it is memoised so the object is not recreated on every render.

Open in a tab
import { useMemo } from "react";
import { UILabelsProvider, defaultUILabels, frenchUILabels, type UILabels } from "@synertech/ui";

export function LocaleSwitch() {
  const locale: string = "fr";
  const labels = useMemo<UILabels>(
    () => (locale === "fr" ? frenchUILabels : defaultUILabels),
    [locale]
  );

  return (
    <UILabelsProvider labels={labels}>
      <p className="text-sm">Langue active : {locale}</p>
    </UILabelsProvider>
  );
}

Partial override and nesting

A nested provider changes only two labels; the others are inherited from the parent.

Open in a tab
import { useState } from "react";
import { Button, Modal, UILabelsProvider, frenchUILabels, type UILabels } from "@synertech/ui";

const productLabels: Partial<UILabels> = { confirm: "Enregistrer", cancel: "Abandonner" };

export function NestedOverride() {
  const [open, setOpen] = useState(false);

  return (
    <UILabelsProvider labels={frenchUILabels}>
      <UILabelsProvider labels={productLabels}>
        <Button onClick={() => setOpen(true)}>Modifier</Button>
        <Modal isOpen={open} onClose={() => setOpen(false)} title="Modifier le produit" showCancel>
          <p>« Enregistrer » et « Abandonner » ici, « Fermer la fenêtre » hérité.</p>
        </Modal>
      </UILabelsProvider>
    </UILabelsProvider>
  );
}

The instance prop wins

submitLabel and closeLabel take precedence over the provider for this one modal.

Open in a tab
import { useState } from "react";
import { Button, Modal, UILabelsProvider, frenchUILabels } from "@synertech/ui";

export function InstanceOverride() {
  const [open, setOpen] = useState(false);

  return (
    <UILabelsProvider labels={frenchUILabels}>
      <Button onClick={() => setOpen(true)}>Publier</Button>
      <Modal
        isOpen={open}
        onClose={() => setOpen(false)}
        title="Publier l’article"
        submitLabel="Publier"
        closeLabel="Fermer sans publier"
      >
        <p>L’article sera visible de tous.</p>
      </Modal>
    </UILabelsProvider>
  );
}

Several labels for one instance

A component that writes more than three strings takes them in a single labels prop, with the keys of the provider. What it does not set comes from the provider; the {count}, {page} and {total} placeholders are kept.

Open in a tab
import { DataGrid, UILabelsProvider, frenchUILabels, type UILabelsOf } from "@synertech/ui";

const clientGridLabels: UILabelsOf<"dataGrid"> = {
  dataGridNoData: "Aucun client pour l’instant",
  dataGridItemsCount: "{count} clients",
  dataGridPageOf: "Page {page} / {total}",
};

export function InstanceLabels() {
  return (
    <UILabelsProvider labels={frenchUILabels}>
      <DataGrid
        columns={[
          { key: "name", header: "Client" },
          { key: "city", header: "Ville" },
        ]}
        data={[
          { id: "1", name: "Atelier Boréal", city: "Québec" },
          { id: "2", name: "Tremblay & fils", city: "Saguenay" },
          { id: "3", name: "Coop du Lac", city: "Alma" },
        ]}
        rowKey="id"
        searchable
        pagination={{ pageSize: 2 }}
        labels={clientGridLabels}
      />
    </UILabelsProvider>
  );
}

Components rendered on the server

Label, Breadcrumb and Avatar have no hook: the provider does not reach them. Their label is a prop, English by default, and frenchUILabels can be read from a Server Component too.

Open in a tab
import { Breadcrumb, Label, frenchUILabels } from "@synertech/ui";

export function ServerComponents() {
  return (
    <div className="flex flex-col gap-3">
      <Breadcrumb
        aria-label={frenchUILabels.breadcrumbLabel}
        items={[{ label: "Accueil", href: "#" }, { label: "Clients" }]}
      />
      <Label required requiredLabel={frenchUILabels.labelRequired}>
        Courriel
      </Label>
      <Label optional optionalText={frenchUILabels.labelOptional}>
        Téléphone
      </Label>
    </div>
  );
}

Numbers and dates

locale says how numbers and dates are written, beside labels which says the language of the texts: the field shows “1 284,50 $” and the calendar “mars 2026”. Set on the provider, it is the same on the server and in the browser. today freezes the day the calendar marks in the same way.

Open in a tab
import { Calendar, NumberInput, UILabelsProvider, frenchUILabels } from "@synertech/ui";

export function NumbersAndDates() {
  return (
    <UILabelsProvider labels={frenchUILabels} locale="fr-CA">
      <div className="flex flex-col items-start gap-4">
        <NumberInput label="Montant" defaultValue={1284.5} format="currency" currency="CAD" />
        <Calendar
          defaultMonth={new Date(2026, 2, 1)}
          today={new Date(2026, 2, 12)}
          weekStartsOn={0}
          showWeekNumbers
          todayButton
        />
      </div>
    </UILabelsProvider>
  );
}

The locale in your own components

useUILocale() returns the locale of the provider, to hand to Intl: your total is written like the charts beside it. StatCard renders on the server and does not read the provider: it takes locale as a prop.

Open in a tab
import { StatCard, UILabelsProvider, frenchUILabels, useUILocale } from "@synertech/ui";

function OrderTotal({ amount }: { amount: number }) {
  const locale = useUILocale();
  const written = new Intl.NumberFormat(locale, { style: "currency", currency: "CAD" }).format(
    amount
  );
  return <p className="text-sm">Total de la commande : {written}</p>;
}

export function ReadLocale() {
  return (
    <UILabelsProvider labels={frenchUILabels} locale="fr-CA">
      <div className="flex flex-col gap-3">
        <OrderTotal amount={1284.5} />
        <StatCard
          label="Revenu mensuel"
          value={1284.5}
          delta={{ value: 0.124, period: "vs mois dernier" }}
          locale="fr-CA"
        />
      </div>
    </UILabelsProvider>
  );
}

A label with placeholders

formatUILabel() fills the {name} placeholders of a label you render yourself.

Open in a tab
import { UILabelsProvider, formatUILabel, frenchUILabels, useUILabels } from "@synertech/ui";

function PageCaption({ page, total }: { page: number; total: number }) {
  const labels = useUILabels();
  return <p className="text-sm">{formatUILabel(labels.dataGridPageOf, { page, total })}</p>;
}

export function FormattedLabel() {
  return (
    <UILabelsProvider labels={frenchUILabels}>
      <PageCaption page={2} total={9} />
    </UILabelsProvider>
  );
}

In your own components

useUILabels() reuses the translated labels for a home-made component.

Open in a tab
import { Button, UILabelsProvider, frenchUILabels, useUILabels } from "@synertech/ui";

function ClosePanelButton({ onClose }: { onClose: () => void }) {
  const labels = useUILabels();
  return (
    <Button size="sm" onClick={onClose} aria-label={labels.closeDrawer}>
      ×
    </Button>
  );
}

export function ReadLabels() {
  return (
    <UILabelsProvider labels={frenchUILabels}>
      <div className="flex items-center justify-between rounded-md border p-3">
        <span className="text-sm">Panneau de détails</span>
        <ClosePanelButton onClose={() => console.log("Fermé")} />
      </div>
    </UILabelsProvider>
  );
}

API reference

Components

UILabelsProvider

ComponentClient

Translates the strings built into the library.

<UILabelsProvider labels={frenchUILabels} locale="fr-CA">
  <App />
</UILabelsProvider>

labels is the language of the texts, locale the way numbers and dates are written, linkComponent the link of the application's router. Providers can be nested: a subtree only needs to override what differs, and a provider that names no locale or no linkComponent keeps the one above it.

import { UILabelsProvider } from "@synertech/ui";

Props — UILabelsProviderProps

PropTypeDefaultDescription
children• ReactNode —
labels Partial<UILabels> —

Partial overrides merged over the labels inherited from the parent provider.

linkComponent UILinkComponent —

The link of the application's router (next/link, the Link of next-intl), rendered by Sidebar and Header for an address that stays in the application. Without it they write an <a href>, and a click loads the whole page again. Breadcrumb and FooterLink render on the server and are out of its reach: they take the same prop. A component is a function, which React does not hand from a Server Component to a client one: set it in a "use client" file — the one that holds the application's providers — rather than in a server layout.

locale string —

BCP 47 tag the components write their numbers and their dates in ("fr-CA", "en-US"). Without it they follow the language of the runtime, which is not the same on a server and in the browser it renders for: set it in an application that renders on the server.

Hooks

useUILabels

HookClient

Reads the current labels (English defaults when no provider is mounted).

overrides is the labels prop of one instance, laid over what the provider gives: the prop first, then the provider, then the English default. An entry left undefined overrides nothing.

import { useUILabels } from "@synertech/ui";
useUILabels(overrides?: Partial<UILabels>): UILabels

The link a component renders for an address that stays in the application: the linkComponent prop of the instance, then the one of UILabelsProvider, then undefined — an <a href>.

import { useUILinkComponent } from "@synertech/ui";
useUILinkComponent(override?: UILinkComponent): UILinkComponent | undefined

useUILocale

HookClient

The locale a component formats its numbers and its dates with: the locale prop of the instance, then the one of UILabelsProvider, then undefined — which Intl reads as the language of the runtime.

That last step is the one a server and a browser do not take the same way. Never read the runtime language in a component: ask this hook, and hand the answer to Intl.

import { useUILocale } from "@synertech/ui";
useUILocale(override?: string): string | undefined

Functions

Fills the {name} placeholders of a label.

Labels stay plain strings, so that a set of them can be written in JSON and overridden one by one; what varies is written as a placeholder and filled in where the label is rendered.

formatUILabel("Page {page} of {total}", { page: 2, total: 9 }); // "Page 2 of 9"

A placeholder with no matching value is left as written, which shows the mistake instead of hiding it.

import { formatUILabel } from "@synertech/ui";
formatUILabel(template: string, values: Record<string, string | number>): string

Constants

English labels, used when no provider is mounted.

import { defaultUILabels } from "@synertech/ui";
const defaultUILabels: UILabels

Ready-to-use French translation.

import { frenchUILabels } from "@synertech/ui";
const frenchUILabels: UILabels

Types

UILabels

Interface

Every user-facing string the library renders on its own (mostly the aria-label / sr-only text of built-in buttons).

Each component also exposes a matching prop, so a label can be overridden globally (provider) or per instance (prop wins).

interface UILabels
FieldTypeDefaultDescription
avatarAlt• string —

Alternative text of an Avatar image that was given none. Not read from the provider: Avatar renders on the server, pass it as alt.

bannerClose• string —

Accessible name of the Banner close button.

breadcrumbLabel• string —

Accessible name of the Breadcrumb landmark. Not read from the provider: Breadcrumb renders on the server, pass it as aria-label.

calendarClear• string —

Label of the Calendar button clearing the selection.

calendarMonth• string —

Accessible name of the month menu of a Calendar.

calendarNextMonth• string —

Accessible name of the Calendar button going forward a month.

calendarPreviousMonth• string —

Accessible name of the Calendar button going back a month.

calendarToday• string —

Label of the Calendar button jumping to today.

calendarWeekNumber• string —

Screen-reader header of the week-number column of a Calendar.

calendarYear• string —

Accessible name of the year menu of a Calendar.

cancel• string —

Default label of the Modal cancel button.

chartAnnotations• string —

Word the annotation captions are announced under in a chart's name.

chartBrush• string —

Accessible name of the range a pointer drags across a chart's category axis.

chartChange• string —

Header of the gap column of a dumbbell chart's data table.

chartClearSelection• string —

Accessible name of the button dropping the dragged range.

chartClose• string —

Header of the closing-price column of a candlestick's data table.

chartConversion• string —

Header of the "kept from the previous stage" column of a funnel.

chartCount• string —

Header of the observation-count column of a box plot's data table.

chartDecrease• string —

Legend entry and tooltip row for a waterfall step that takes away.

chartDropOff• string —

Header of the "lost since the previous stage" column of a funnel.

chartEnd• string —

Header of the end column of a schedule's data table.

chartError• string —

Shown in place of a chart whose data could not be loaded.

Distinct from chartNoData on purpose: "there is nothing" and "we failed to fetch it" are two different statements, and only the second one asks the reader to do something about it.

chartErrorHint• string —

Second line of a chart's error state, under chartError.

chartExport• string —

Accessible name of a chart's export control.

chartExportCsv• string —

Entry downloading a chart's data table as a CSV file.

chartExportJson• string —

Entry downloading a chart's data table as a JSON file.

chartFall• string —

Legend entry for a candlestick session that closed down.

chartFilters• string —

Accessible name of the filter row above a set of charts.

chartHideTable• string —

Accessible name of the button hiding a chart's data table.

chartHigh• string —

Header of the high column of a candlestick's data table.

chartIncrease• string —

Legend entry and tooltip row for a waterfall step that adds.

chartLoading• string —

Accessible name of the spinner shown while a chart loads its first data.

chartLow• string —

Header of the low column of a candlestick's data table.

chartMax• string —

Header of the maximum column of a box plot's data table, and its tooltip row.

chartMean• string —

Header of the mean column of a box plot's data table, and its tooltip row.

chartMedian• string —

Header of the median column of a box plot's data table.

chartMin• string —

Header of the minimum column of a box plot's data table, and its tooltip row.

chartNoData• string —

Shown in place of a chart that has no data to draw.

chartOpen• string —

Header of the opening-price column of a candlestick's data table.

chartOther• string —

Bucket the smallest slices of a pie chart are folded into.

chartOutliers• string —

Header of the outlier column of a box plot's data table.

chartPeriod• string —

Accessible name of the period picker, and its caption when nothing is set.

chartPeriodCustom• string —

Entry opening the calendar, for a window the presets do not cover.

chartPeriodLast12Months• string —
chartPeriodLast30Days• string —
chartPeriodLast7Days• string —
chartPeriodLast90Days• string —
chartPeriodMonthToDate• string —
chartPeriodQuarterToDate• string —
chartPeriodYearToDate• string —
chartProgress• string —

Header of the completion column of a schedule's data table.

chartRetry• string —

Label of the button that asks a failed chart to load again.

chartRise• string —

Legend entry for a candlestick session that closed up.

chartRunningTotal• string —

Header of the running-total column of a waterfall's data table.

chartShowTable• string —

Accessible name of the button revealing a chart's data table.

chartStart• string —

Header of the start column of a schedule's data table.

chartTarget• string —

Header of the "aimed at" column of a bullet chart's data table.

chartToday• string —

Name of the rule marking today on a schedule.

chartValue• string —

Header of the "reached" column of a bullet chart's data table.

chipRemove• string —

Accessible name of the Chip remove button.

closeDrawer• string —

Accessible name of the Drawer close button.

closeModal• string —

Accessible name of the Modal close button.

closeSidebar• string —

Accessible name of the Sidebar close button (mobile).

collapseSidebar• string —

Accessible name of the Sidebar toggle when it collapses the sidebar.

commandPaletteClose• string —

Hint beside the Escape key at the foot of a CommandPalette.

commandPaletteEscapeKey• string —

The Escape key as its keycap writes it, at the foot of a CommandPalette.

commandPaletteLabel• string —

Accessible name of the dialog of a CommandPalette.

commandPaletteLoading• string —

Shown and announced by a CommandPalette while its entries load.

commandPaletteNavigate• string —

Hint beside the arrow keys at the foot of a CommandPalette.

commandPaletteNoResults• string —

Shown by a CommandPalette that has no entry to offer, before anything is typed.

commandPaletteNoResultsFor• string —

Shown by a CommandPalette when no entry matches what is typed, {query} being that text.

commandPalettePlaceholder• string —

Placeholder of the search field of a CommandPalette.

commandPaletteResult• string —

Announced by a CommandPalette when one entry matches, {count} being 1.

commandPaletteResults• string —

Announced by a CommandPalette when several entries match, {count} being their number.

commandPaletteSearch• string —

Accessible name of the search field of a CommandPalette.

commandPaletteSelect• string —

Hint beside the Enter key at the foot of a CommandPalette.

confirm• string —

Default label of the Modal submit button.

dataGridActiveFilter• string —

An active filter of a DataGrid, in its row. {column} is the column, {condition} what it keeps.

dataGridActiveFilters• string —

Accessible name of the row of a DataGrid that lists its active filters.

dataGridAggregateAvg• string —

Footer of a DataGrid column aggregated as an average. {value} is the result.

dataGridAggregateMax• string —

Footer of a DataGrid column aggregated as a maximum. {value} is the result.

dataGridAggregateMin• string —

Footer of a DataGrid column aggregated as a minimum. {value} is the result.

dataGridAggregateSum• string —

Footer of a DataGrid column aggregated as a sum. {value} is the result.

dataGridBulkActions• string —

Accessible name of the bar of a DataGrid that holds the actions on its selected rows.

dataGridClearFilters• string —

Button of a DataGrid that removes every active filter.

dataGridClearSelection• string —

Button of a DataGrid that clears its selection, in the bar of its actions.

dataGridCollapseRow• string —

Accessible name of the button collapsing a DataGrid row.

dataGridColumnMoved• string —

Said once a DataGrid column has been moved from its menu. {column} is its header, {position} its place and {count} the number of places.

dataGridConditionAfter• string —

An active date filter of a DataGrid: after the day {value}.

dataGridConditionBefore• string —

An active date filter of a DataGrid: before the day {value}.

dataGridConditionBetween• string —

An active filter of a DataGrid between two bounds, both included: {from} and {to}.

dataGridConditionContains• string —

An active text filter of a DataGrid that looks for {value} in a cell.

dataGridConditionEndsWith• string —

An active text filter of a DataGrid that keeps the cells ending with {value}.

dataGridConditionGreaterOrEqual• string —

An active filter of a DataGrid: {value} or more.

dataGridConditionGreaterThan• string —

An active number filter of a DataGrid: greater than {value}.

dataGridConditionIsEmpty• string —

An active filter of a DataGrid that keeps the empty cells.

dataGridConditionIsNotEmpty• string —

An active filter of a DataGrid that keeps the cells holding something.

dataGridConditionLessOrEqual• string —

An active filter of a DataGrid: {value} or less.

dataGridConditionLessThan• string —

An active number filter of a DataGrid: less than {value}.

dataGridConditionStartsWith• string —

An active text filter of a DataGrid that keeps the cells starting with {value}.

dataGridEditCell• string —

Accessible name of the field editing a DataGrid cell.

dataGridEditHint• string —

Tooltip of an editable DataGrid cell.

dataGridExpandRow• string —

Accessible name of the button expanding a DataGrid row.

dataGridExportAs• string —

Tooltip of a DataGrid export button. {format} is CSV or JSON.

dataGridFilterApply• string —

Label of the button applying a DataGrid column filter.

dataGridFilterClear• string —

Label of the button clearing a DataGrid column filter.

dataGridFilterColumn• string —

Accessible name of the filter button of a DataGrid column. {column} is the header of the column.

dataGridFilterValue• string —

Accessible name of the value field of a DataGrid column filter. {column} is the header of the column.

dataGridFilterValuePlaceholder• string —

Placeholder of the value field of a DataGrid column filter.

dataGridFilterValueTo• string —

Accessible name of the second field of a DataGrid "between" filter. {column} is the header of the column.

dataGridFirstPage• string —

Accessible name of the DataGrid button going to the first page.

dataGridItemCount• string —

Number of rows under a DataGrid when there is exactly one. {count} is that number.

dataGridItemsCount• string —

Number of rows under a DataGrid when there is not exactly one. {count} is that number.

dataGridLastPage• string —

Accessible name of the DataGrid button going to the last page.

dataGridMoveColumnDown• string —

Accessible name of the button moving a DataGrid column one place down its menu, towards the end of the table. {column} is the header of the column.

dataGridMoveColumnUp• string —

Accessible name of the button moving a DataGrid column one place up its menu, towards the start of the table. {column} is the header of the column.

dataGridNextPage• string —

Accessible name of the DataGrid button going to the next page.

dataGridNoData• string —

Shown in place of the rows of a DataGrid that has none.

dataGridOperatorAfter• string —

DataGrid filter operator: the date is after that day.

dataGridOperatorBefore• string —

DataGrid filter operator: the date is before that day.

dataGridOperatorBetween• string —

DataGrid filter operator: the number or the date lies between two values, both included.

dataGridOperatorContains• string —

DataGrid filter operator: the cell contains the text.

dataGridOperatorEndsWith• string —

DataGrid filter operator: the cell ends with the text.

dataGridOperatorEquals• string —

DataGrid filter operator: the cell equals the value.

dataGridOperatorGreaterOrEqual• string —

DataGrid filter operator: the number is greater than or equal to the value.

dataGridOperatorGreaterThan• string —

DataGrid filter operator: the number is greater than the value.

dataGridOperatorIsEmpty• string —

DataGrid filter operator: the cell is empty.

dataGridOperatorIsNotEmpty• string —

DataGrid filter operator: the cell is not empty.

dataGridOperatorLessOrEqual• string —

DataGrid filter operator: the number is less than or equal to the value.

dataGridOperatorLessThan• string —

DataGrid filter operator: the number is less than the value.

dataGridOperatorOn• string —

DataGrid filter operator: the date is that day.

dataGridOperatorStartsWith• string —

DataGrid filter operator: the cell starts with the text.

dataGridPageOf• string —

Position in the pages of a DataGrid. {page} is the current page, {total} the number of pages.

dataGridPreviousPage• string —

Accessible name of the DataGrid button going to the previous page.

dataGridRemoveFilter• string —

Accessible name of the button removing an active filter of a DataGrid. {filter} is the filter in words.

dataGridReorderColumns• string —

Accessible name and tooltip of the DataGrid button listing the columns to move them, when it does not hide them.

dataGridResizeColumn• string —

Accessible name of the handle that resizes a DataGrid column, from the pointer or the arrow keys. {column} is the header of the column.

dataGridRowsPerPage• string —

Label of the page-size menu of a DataGrid.

dataGridSearch• string —

Accessible name of the DataGrid search field.

dataGridSearchPlaceholder• string —

Placeholder of the DataGrid search field.

dataGridSelectAllRows• string —

Accessible name of the checkbox selecting every row of a DataGrid.

dataGridSelectedCount• string —

Number of selected rows, above a DataGrid. {count} is that number.

dataGridSelectRow• string —

Accessible name of the checkbox of a DataGrid row. {row} is the key of the row.

dataGridToggleColumns• string —

Accessible name and tooltip of the DataGrid column visibility button.

datePickerAfterMax• string —

Message of a date field holding a day after maxDate, written as {date}.

datePickerBeforeMin• string —

Message of a date field holding a day before minDate, written as {date}.

datePickerDayLetters• string —

The day in the placeholder of a date field: dd in dd/mm/yyyy.

datePickerInvalid• string —

Message of a date field whose text is not a date. {format} is the placeholder, dd/mm/yyyy.

datePickerMonthLetters• string —

The month in the placeholder of a date field: mm in dd/mm/yyyy.

datePickerOpen• string —

Accessible name of the button opening the calendar of a DatePicker.

datePickerUnavailable• string —

Message of a date field holding a day of disabledDates.

datePickerYearLetters• string —

The year in the placeholder of a date field: yyyy in dd/mm/yyyy.

dateRangePickerEnd• string —

Accessible name of the second field of a DateRangePicker, after its label.

dateRangePickerOpen• string —

Accessible name of the button opening the calendar of a DateRangePicker.

dateRangePickerPresets• string —

Accessible name of the list of preset ranges of a DateRangePicker.

dateRangePickerStart• string —

Accessible name of the first field of a DateRangePicker, after its label.

deviceMockupAlt• string —

Alternative text of the image shown on a DeviceMockup screen.

editorClose• string —

Label of the button closing an export dialog of WorkflowEditor and SchemaEditor.

editorExportJson• string —

Tooltip and accessible name of the JSON export button of WorkflowEditor and SchemaEditor.

editorFitToContent• string —

Tooltip and accessible name of the button fitting the view of WorkflowEditor and SchemaEditor to their content.

editorImport• string —

Label of the button confirming the import dialog of WorkflowEditor and SchemaEditor.

editorImportInvalidContent• string —

Message of the import dialog of WorkflowEditor and SchemaEditor when the JSON is not a document the editor can open. {path} is the first thing that does not fit, as tables[2].fields.

editorImportInvalidJson• string —

Message of the import dialog of WorkflowEditor and SchemaEditor when the text pasted is not JSON.

editorImportJson• string —

Tooltip and accessible name of the JSON import button of WorkflowEditor and SchemaEditor.

editorResetView• string —

Tooltip and accessible name of the button resetting the view of WorkflowEditor and SchemaEditor.

editorZoomIn• string —

Tooltip and accessible name of the zoom-in button of WorkflowEditor and SchemaEditor.

editorZoomOut• string —

Tooltip and accessible name of the zoom-out button of WorkflowEditor and SchemaEditor.

enterFullScreen• string —

Accessible name of the Modal "expand" button.

exitFullScreen• string —

Accessible name of the Modal "collapse" button.

expandSidebar• string —

Accessible name of the Sidebar toggle when it expands a collapsed sidebar.

fileSelectorAllFiles• string —

What a FileSelector says it accepts when accept is not set.

fileSelectorAlreadyAdded• string —

Reason handed to onReject by a FileSelector for a file it already holds.

fileSelectorBrowse• string —

Link ending the invitation of a FileSelector drop zone taking files.

fileSelectorBrowseFiles• string —

Button opening the file picker of a FileSelector taking files and folders.

fileSelectorBrowseFolder• string —

Link or button opening the folder picker of a FileSelector.

fileSelectorChangeFile• string —

Button of a FileSelector taking one file, when one is selected.

fileSelectorChangeFiles• string —

Files button of a FileSelector taking files and folders, when something is selected.

fileSelectorChangeFolder• string —

Button of a FileSelector taking a folder, when one is selected.

fileSelectorChooseFile• string —

Button of a FileSelector taking one file, when none is selected.

fileSelectorChooseFiles• string —

Files button of a FileSelector taking files and folders, when nothing is selected.

fileSelectorChooseFolder• string —

Button of a FileSelector taking a folder, when none is selected.

fileSelectorConstraints• string —

What a FileSelector drop zone accepts. {accept} is the list of types, {maxSize} the largest size of a file.

fileSelectorConstraintsMaxFiles• string —

What a FileSelector drop zone accepts when maxFiles is set. {accept} is the list of types, {maxSize} the largest size of a file, {maxFiles} the number of files.

fileSelectorDropFile• string —

Invitation of a FileSelector drop zone taking one file.

fileSelectorDropFiles• string —

Invitation of a FileSelector drop zone taking several files.

fileSelectorDropFilesOrFolders• string —

Invitation of a FileSelector drop zone taking files and folders.

fileSelectorDropFolder• string —

Invitation of a FileSelector drop zone taking a folder.

fileSelectorDropZone• string —

Accessible name of a FileSelector drop zone taking files and folders.

fileSelectorFilesSelected• string —

Shown beside the button of a FileSelector holding several files while its list is hidden. {count} is their number.

fileSelectorNoFile• string —

Shown beside the button of a FileSelector taking files, when none is selected.

fileSelectorNoFileOrFolder• string —

Shown beside the buttons of a FileSelector taking files and folders, when nothing is selected.

fileSelectorNoFolder• string —

Shown beside the button of a FileSelector taking a folder, when none is selected.

fileSelectorRemove• string —

Accessible name of the button removing a file from a FileSelector. {name} is the name of the file.

fileSelectorRemoveAll• string —

Label of the button removing every file from a FileSelector.

fileSelectorTooLarge• string —

Reason handed to onReject by a FileSelector for a file that is too large. {maxSize} is the limit.

fileSelectorTypeNotAccepted• string —

Reason handed to onReject by a FileSelector for a file of the wrong type. {accept} is the list of types.

headerSearchPlaceholder• string —

Placeholder and accessible name of the Header search field.

headerToggleMenu• string —

Accessible name of the button opening the Header menu on a small screen.

helpButtonCancel• string —

Tooltip of the HelpButton button leaving the editor.

helpButtonContent• string —

Accessible name of the plain-text editor of a HelpButton.

helpButtonContentPlaceholder• string —

Placeholder of the plain-text editor of a HelpButton.

helpButtonEdit• string —

Tooltip of the HelpButton button opening the editor.

helpButtonNoSave• string —

Error shown by a HelpButton saved without onSave.

helpButtonReset• string —

Tooltip of the HelpButton button resetting the content.

helpButtonResetConfirm• string —

Question asked by a HelpButton before it resets its content.

helpButtonResetDone• string —

Shown by a HelpButton once its content is reset.

helpButtonResetError• string —

Error shown by a HelpButton whose content could not be reset.

helpButtonSave• string —

Tooltip of the HelpButton button saving the content.

helpButtonSaved• string —

Shown by a HelpButton once its content is saved.

helpButtonSaveError• string —

Error shown by a HelpButton whose content could not be saved.

helpButtonShow• string —

Accessible name of the HelpButton.

imageUploaderChangeButton• string —

Button of an ImageUploader that holds an image.

imageUploaderChoose• string —

Accessible name of the file field of an ImageUploader.

imageUploaderChooseButton• string —

Button of an ImageUploader that holds no image.

imageUploaderHelp• string —

Help line of an ImageUploader that was given none. {formats} is the list of formats, {maxSize} the largest size in megabytes.

imageUploaderLabel• string —

Label of an ImageUploader that was given none.

imageUploaderNotImage• string —

Error shown by an ImageUploader for a file that is not an image.

imageUploaderPreview• string —

Alternative text of the preview of an ImageUploader.

imageUploaderReadError• string —

Error shown by an ImageUploader when the file could not be read.

imageUploaderRemove• string —

Tooltip of the button removing the image of an ImageUploader.

imageUploaderTooLarge• string —

Error shown by an ImageUploader for a file that is too large. {maxSize} is the limit in megabytes.

imageUploaderTypeNotAccepted• string —

Error shown by an ImageUploader for an image in a format its accept leaves out, an SVG by default. {formats} is the list of formats.

imageUploaderUploadError• string —

Error shown by an ImageUploader when onUpload fails without a message.

imageUploaderUploading• string —

Button of an ImageUploader while the image is being sent.

imageUploaderUrlLabel• string —

Label of the URL field of an ImageUploader.

labelOptional• string —

Hint after an optional Label. Not read from the provider: Label renders on the server, pass it as optionalText.

labelRequired• string —

Screen-reader text after a required Label. Not read from the provider: Label renders on the server, pass it as requiredLabel.

markdownEditorPlaceholder• string —

Placeholder of a MarkdownEditor that was given none.

markdownEditorUnavailable• string —

Shown by <HelpButton markdown editable> when no markdownEditor is passed.

mentionInputLoading• string —

Shown in the suggestion list of a MentionInput while it loads.

mentionInputSuggestions• string —

Accessible name of the suggestion list of a MentionInput.

modalDefaultTitle• string —

Title of a Modal that was given none.

openSidebar• string —

Accessible name of the Sidebar toggle when it opens the mobile drawer.

paginationFirst• string —

Accessible name of the Pagination button going to the first page.

paginationLabel• string —

Accessible name of the Pagination landmark.

paginationLast• string —

Accessible name of the Pagination button going to the last page.

paginationNext• string —

Accessible name of the Pagination button going to the next page.

paginationPage• string —

Accessible name of a page button of a Pagination. {page} is its number.

paginationPrevious• string —

Accessible name of the Pagination button going to the previous page.

paginationRange• string —

Range of items shown by a Pagination. {start} and {end} are the first and last item of the page, {total} the number of items.

paginationRowsPerPage• string —

Label of the page-size menu of a Pagination.

popoverClose• string —

Accessible name of a PopoverClose drawn as an icon, without children of its own.

schemaEditorAddField• string —

Label of the button adding a column to a SchemaEditor table.

schemaEditorAddIndex• string —

Tooltip of the button indexing a SchemaEditor column.

schemaEditorAddTable• string —

Tooltip and accessible name of the SchemaEditor button adding a table.

schemaEditorAddUnique• string —

Tooltip of the button making a SchemaEditor column unique.

schemaEditorAutoLayout• string —

Tooltip and accessible name of the SchemaEditor button arranging the tables.

schemaEditorCollapseTable• string —

Accessible name of the button collapsing a SchemaEditor table.

schemaEditorDefaultValue• string —

Tooltip of the default value of a SchemaEditor column. {value} is that value.

schemaEditorDefaultValueFor• string —

Accessible name of the default-value field of a SchemaEditor column. {field} is the name of the column.

schemaEditorExpandTable• string —

Accessible name of the button expanding a SchemaEditor table.

schemaEditorExportDescription• string —

Description of the JSON export dialog of a SchemaEditor.

schemaEditorExportSql• string —

Tooltip and accessible name of the SQL export button of a SchemaEditor, and title of its dialog.

schemaEditorExportTitle• string —

Title of the JSON export dialog of a SchemaEditor.

schemaEditorFieldName• string —

Accessible name of the name field of a SchemaEditor column.

schemaEditorForeignKey• string —

Legend entry of the foreign-key icon of a SchemaEditor.

schemaEditorImportDescription• string —

Description of the import dialog of a SchemaEditor.

schemaEditorImportTitle• string —

Title of the import dialog of a SchemaEditor.

schemaEditorIndex• string —

Legend entry of the index icon of a SchemaEditor.

schemaEditorJsonField• string —

Label of the JSON field in the dialogs of a SchemaEditor.

schemaEditorNotesPlaceholder• string —

Placeholder of the notes field of a SchemaEditor table.

schemaEditorNotNullable• string —

Tooltip of a SchemaEditor column that is not nullable.

schemaEditorNullable• string —

Tooltip of a nullable SchemaEditor column, and its entry in the legend.

schemaEditorPrimaryKey• string —

Legend entry of the primary-key icon of a SchemaEditor.

schemaEditorRedo• string —

Accessible name of the redo button of a SchemaEditor.

schemaEditorRedoTooltip• string —

Tooltip of the redo button of a SchemaEditor.

schemaEditorRemoveField• string —

Tooltip of the button removing a column from a SchemaEditor table.

schemaEditorRemoveIndex• string —

Tooltip of the index button of an indexed SchemaEditor column.

schemaEditorRemovePrimaryKey• string —

Tooltip of the primary-key icon of an editable SchemaEditor column.

schemaEditorRemoveUnique• string —

Tooltip of the unique button of a unique SchemaEditor column.

schemaEditorSetDefaultValue• string —

Tooltip of the button giving a SchemaEditor column a default value.

schemaEditorSetPrimaryKey• string —

Tooltip and accessible name of the button making a SchemaEditor column the primary key.

schemaEditorSqlDescription• string —

Description of the SQL export dialog of a SchemaEditor.

schemaEditorTableName• string —

Accessible name of the name field of a SchemaEditor table.

schemaEditorTableNotes• string —

Accessible name of the notes field of a SchemaEditor table.

schemaEditorUndo• string —

Accessible name of the undo button of a SchemaEditor.

schemaEditorUndoTooltip• string —

Tooltip of the undo button of a SchemaEditor.

schemaEditorUnique• string —

Legend entry of the unique-constraint icon of a SchemaEditor.

selectClear• string —

Accessible name of the button clearing the value of a Select.

selectCreateOption• string —

The entry of a creatable Select that adds the text typed as a value, {label} being that text.

selectMoreValues• string —

Written after the tags of a multiple Select past its maxTagCount, {count} being the values not shown.

selectNoOptions• string —

Shown by a Select whose list is empty.

selectPlaceholder• string —

Shown by a Select that has no value.

selectRemoveValue• string —

Accessible name of the button removing one value of a multiple Select, {label} being the value's label.

selectSearch• string —

Accessible name of the search field of a Select.

selectSearchPlaceholder• string —

Placeholder of the search field of a Select.

sidebar• string —

Accessible name of the mobile Sidebar dialog when no aria-label is given.

toastClose• string —

Accessible name of the Toast close button.

toasterRegion• string —

Accessible name of the region of the Toaster, when it has no hotkey.

toasterRegionHotkey• string —

Accessible name of the region of the Toaster; {hotkey} is the key that sends the focus there.

treeViewLoadError• string —

Shown beside a node of a TreeView whose children could not be loaded.

treeViewLoading• string —

Read with a node of a TreeView while its children load.

wizardFinish• string —

Label of the WizardNext button on the last step.

wizardNext• string —

Label of the WizardNext button before the last step.

wizardOptional• string —

Hint after the title of an optional Wizard step.

wizardPrevious• string —

Label of the WizardPrevious button.

workflowEditorExportDescription• string —

Description of the export dialog of a WorkflowEditor.

workflowEditorExportTitle• string —

Title of the export dialog of a WorkflowEditor.

workflowEditorImportDescription• string —

Description of the import dialog of a WorkflowEditor.

workflowEditorImportTitle• string —

Title of the import dialog of a WorkflowEditor.

workflowEditorJsonField• string —

Label of the JSON field in the dialogs of a WorkflowEditor.

workflowEditorSwitchToHorizontal• string —

Tooltip and accessible name of the WorkflowEditor button laying the workflow out horizontally.

workflowEditorSwitchToVertical• string —

Tooltip and accessible name of the WorkflowEditor button laying the workflow out vertically.

The labels of one component, all optional: the keys of UILabels starting with its prefix.

It is the type of the labels prop of the components that render more than three strings — UILabelsOf<"dataGrid"> — and takes the very keys the provider does, so a label is written the same way for one instance and for the whole application.

type UILabelsOf<Prefix extends string> = Partial<
  Pick<UILabels, Extract<keyof UILabels, `${Prefix}${string}`>>
>

The link of the application's router: next/link, the Link of next-intl, or a component of your own that renders an <a> with every attribute it receives. A link without it is an <a href>, and a click loads the whole page again.

type UILinkComponent = ComponentType<UILinkProps>

What a component hands the link of the application's router: an address, and the attributes of the <a> the component would have written itself (className, children, onClick, aria-current, aria-label…).

type UILinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> & {
  href: string;
}