Term
The mock's term() for a word that is not a money figure: the label dotted-underlined (.term), its meaning in a small ink tip on hover, focus or tap (MoneyNote is the same look for the money dictionary's figures). The tip's text is also the trigger's description for assistive tech, so it is never only in the drawing. Escape closes it and keeps focus on the term; a click outside, a scroll or a resize close it.
import { Term } from '@ergasti/bricks';Examples
A word with a tip
For a word that is not a money figure (money has MoneyNote). Hover, focus or press the dotted word; Escape closes the tip and keeps focus on the word.
Code
import { Term } from '@ergasti/bricks';
function Tip() {
return (
<p style={{ paddingTop: 70 }}>
Creators earn a <Term tip="Share of each order’s value paid to the creator, once the order is delivered.">commission rate</Term> on every delivered order.
</p>
);
}In a table header
A column's tip draws its label as a Term; a sortable column keeps its sort button beside it.
Code
import { DataTable, type DataColumn } from '@ergasti/bricks';
interface Row { id: number; name: string; orders: number; score: number }
const rows: Row[] = [{ id: 1, name: 'Sara Ali', orders: 54, score: 74 }, { id: 2, name: 'Omar Khaled', orders: 31, score: 68 }];
function InAHeader() {
const columns: DataColumn<Row>[] = [
{ key: 'name', label: 'Creator', render: (r) => r.name },
{ key: 'orders', label: 'Orders', tip: 'Orders placed with a creator coupon in this period, before returns.', sortKey: 'orders', align: 'end', render: (r) => r.orders },
{ key: 'score', label: 'Score', tip: 'TRNDR’s 0–100 rating of a creator.', align: 'end', render: (r) => r.score },
];
return <DataTable label="Creators" columns={columns} rows={rows} rowKey={(r) => r.id} sort={{ key: 'orders', dir: 'desc' }} onSort={() => {}} />;
}Props
Prop
Type
Design guidance
How the BRICKS design system uses Term. Written in docs/content/components/Term.md; the props above are read from the code, which wins where the two disagree.
A dotted-underlined word that explains itself in a small dark tip on hover, focus or tap; use it for a label that is not a money figure but needs a definition ("Orders", "Commission rate", a "Discount" column).
It is the mock's term(): the same look as MoneyNote (which covers the money dictionary's figures), for any other word, with the meaning passed in tip. The tip text is also the trigger's description for assistive tech, so it is never only drawn. Escape closes it and keeps focus on the term; a click outside, a scroll or a resize close it. It opens below the word (as the mock's top:140%), or above when fewer than 120px remain, and stays inside a 16px viewport gutter.
Anatomy
- Wrapper:
span.kit-note.kit-note--term(inline). - Trigger:
button.kit-term, the word with a 1.5px dotted underline; inherits the font, colour and text-transform of its context. - Description: visually hidden
span.kit-srwith the tip (the button'saria-describedby). - Tip:
.kit-note-pop(--above/--below), ink background, white text,aria-hidden(the description already says it).
Variants
One look. Placement is automatic (below by default, above near the window's bottom).
States
| State | Trigger |
|---|---|
| Closed | default. |
| Open (hover) | mouse enters; closes on leave unless clicked. |
| Open (focus) | keyboard focus; closes on blur. |
| Open (click / tap) | toggles. |
| Closed by Escape | focus stays on the term. |
| Focus-visible | ring with --radius-xs. |
Usage
// Brand › Home › Orders metric tile
<Tile size="metric" tone="rasp" deco="star"
label={<Term tip="Orders placed with a creator coupon, last 30 days">Orders</Term>}
value="1,284" delta={<Delta value={7.9} context="vs previous 30 days" />} onSelect={openOrders} />// Brand › Settings › Commission & payouts row
<SettingsSection title="Commission & payouts" tone="lime" rows={[
{ label: <Term tip="Share of each order’s value paid to the creator">Commission rate</Term>, value: '15% of sale' },
]} />// A gauge legend
<Gauge label="Seat usage" max={400} segments={[
{ value: 17, label: 'Reserved', legend: <Term tip="Invited, not joined yet">Reserved</Term>, tone: 'rasp-soft' },
]} />Where it appears
- In the v3 mocks: Brand › Home › "Orders" tile label and the seat gauge legend (BrandHome); Brand › Settings › "Commission rate" (BrandSettings); Brand › Coupons › the "Discount" column header, drawn uppercase by the table head (
DataColumn.tipdraws a Term) (BrandCoupons); Brand › Creators › the "Score" header. - Library:
KpiCardlabels may hold one.
Guidelines
Do
- One short sentence in
tip, saying what is counted and over which period. - Use
MoneyNoteinstead for any money figure.
Don't
- Don't put a Term inside another button (a sortable header button, a clickable card without an overlay hit area).
- Don't hide instructions or actions in the tip.
RTL and Arabic
- In Arabic the tip aligns to the word's right edge and sets
dir="rtl". Example: "الطلبات" with "طلبات بكوبون صانع محتوى، آخر 30 يوم".
Tokens
--ink, --focus-ring, --radius-xs, --min-touch-target, --font-family-sans.
Accessibility
- A real
<button>witharia-expandedandaria-describedbythe tip, so the meaning is read on focus even without opening. - Hover, focus and tap all open it; Escape closes.
- Hit area: 24px tall on desktop (≥1025px, WCAG 2.5.8), 44px on touch tiers (≤1024px), without changing the word's look.
Found in the source
- ARIA attributes set:
aria-describedby,aria-expanded,aria-hidden. - Its tests cover: “opens on focus and on hover, Escape closes it and keeps focus on the term”.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
MoneyNote: the money-figure version with includes / excludes.DataColumn.tip: a Term in a table header.
See also: useLanguage · DataTable · Accordion · Card · HeroCard · KeyValue
Source
src/kit/patterns/term/Term.tsx (line 27) on GitHub.