Muted
The mock's .muted: secondary text in the muted ink (--ink-3), 12px by default. Inline (a <span>) unless as says otherwise: "(optional)" after a label, "Only delivered orders count" in a card head, "Step 2 of 4". Any other attribute (an id, dir="auto" for free text) goes on the element.
import { Muted } from '@ergasti/bricks';Examples
Muted text and notes
Muted is inline secondary text (12px; size="md" is 13px); Note is the muted paragraph under a figure, 8px down, and flush drops that margin.
Code
import { Card, Muted, Note, TextLink } from '@ergasti/bricks';
function MutedAndNote() {
return (
<div style={{ maxWidth: 380 }}>
<Card title="Leaderboard" actions={<Muted>Only delivered orders count</Muted>}>
<div>
<b>18 confirmed units left</b>
<Note>A challenge with gifts can't go live until its gifts are counted and confirmed. <TextLink href="#gifts" arrow>Gift stock</TextLink></Note>
</div>
</Card>
</div>
);
}After a label
"(optional)" as a field's adornment.
Code
import { FormField, Muted } from '@ergasti/bricks';
function Optional() {
return (
<div style={{ maxWidth: 360 }}>
<FormField label="Message to the brand" adornment={<Muted>(optional)</Muted>}><textarea /></FormField>
</div>
);
}Arabic
Code
import { Note } from '@ergasti/bricks';
function Arabic() {
return <Note dir="auto">الطلبات اللي اتسلمت بس هي اللي بتتحسب.</Note>;
}Props
Prop
Type
Also accepts the react and dom attributes of the element it renders; they are passed through.
Design guidance
How the BRICKS design system uses Muted. Written in docs/content/components/Muted.md; the props above are read from the code, which wins where the two disagree.
Inline secondary text in the muted ink, 12px by default; use it for the short grey words beside a label, in a card head or after a figure ("(optional)", "Only delivered orders count", "Step 2 of 4").
It is the .muted class of both v3 mocks (color: var(--ink-3); font-size: 12px) as a component. Before 0.7 each screen wrote it by hand (<span className="kit-muted">, the PR blocks' .kit-pr-muted, or a screen's own class with an inline font size); use Muted instead so the size steps and the colour stay the kit's. It renders a <span> unless as says otherwise; for a muted paragraph under a figure or list use its sibling Note.
Anatomy
- Element:
<span>(default),<div>or<p>with.kit-muted(--ink-3, 12px), plus.kit-muted--md(13px) or.kit-muted--inherit(the surrounding size). - Children: the words. Any other HTML attribute (
id,dir,style) goes on the element.
Variants
| Prop value | Look | When to use |
|---|---|---|
size="sm" (default) | 12px muted ink | The mock's .muted: card-head notes, "(optional)" after a label, a count beside a heading. |
size="md" | 13px | A muted line under a 15px name. |
size="inherit" | The parent's size, muted ink | Muted words inside a line that already has its size (a 14px row). |
as="span" (default) | Inline | Inside a label, a heading's actions, a row. |
as="div" | Its own line | A detail line under a name in a row. |
as="p" | A paragraph with the browser's margins | A reminder under a table (PR Portal › Approvals). Prefer Note when it sits 8px under a figure or list. |
States
Static text: no interactive states. Long text wraps like any inline text; it has no truncation of its own.
Usage
// A card head note and an optional field (PR Portal › Challenge leaderboard; A brand's campaign › message to the brand)
import { Card, FormField, Muted } from '@ergasti/bricks';
export function MutedExamples({ message, setMessage }: { message: string; setMessage: (v: string) => void }) {
return (
<>
<Card title="Leaderboard" actions={<Muted>Only delivered orders count</Muted>}>
<p style={{ margin: 0 }}>Sara Ali · EGP 12,400</p>
</Card>
<FormField label="Message to the brand" adornment={<Muted>(optional)</Muted>}>
<textarea rows={4} value={message} onChange={(e) => setMessage(e.target.value)} />
</FormField>
</>
);
}// PR Portal › Approvals: the reminder under the join-requests table
import { Muted } from '@ergasti/bricks';
export function ApprovalsReminder() {
return <Muted as="p">Requests never expire. You get a reminder after 2 days and again after 1 week. Brand invites still need your approval.</Muted>;
}// Free text from data keeps its own direction
import { Muted } from '@ergasti/bricks';
export function OwnerLine({ alerts }: { alerts: string }) {
return <Muted as="div" size="md" dir="auto">{alerts}</Muted>;
}Where it appears
- PR Portal › Affiliate programs › Challenges › a challenge › Leaderboard card's "Delivered sales" action (PR · Challenge); PR Portal › Tiers › "Follows the TRNDR score" on Recent automatic moves (PR · Tiers); PR Portal › Brand detail › the owner's alerts line (PR · Brand); PR Portal › Approvals › the reminder under the table (
as="p") (PR · Approvals); PR Portal › Affiliate programs › a brand's campaign › "(optional)" after "Message to the brand" (PR · A brand's campaign). - The Brand dashboard mock uses the same
.mutedlook; any kit screen can use it.
Guidelines
Do
- Use it for secondary words that sit beside or after something more important.
- Put it in
FormField'sadornmentfor "(optional)", so it stays outside the label element. - Pass
dir="auto"when the words come from data (a name, a note).
Don't
- Don't use it for errors or warnings: muted ink says "less important", not "look here". Use the field error or a
Banner. - Don't hand-roll
.kit-muted/.kit-pr-mutedspans or inline greystyles in new screens. - Don't put whole paragraphs under a figure in
Muted as="p"with margin overrides; that isNote.
RTL and Arabic
- Inherits the direction; nothing to mirror. Arabic copy from the stories: "الطلبات اللي اتسلمت بس هي اللي بتتحسب".
- Use
dir="auto"for mixed-language data.
Tokens
--ink-3; sizes are fixed in CSS (12px, 13px, inherit).
Accessibility
- Plain text in a
<span>,<div>or<p>: no role, read in order with its surroundings. --ink-3on white is the kit's secondary text colour; keep it on white or the soft grey, not on tinted tiles.
Found in the source
- No roles, ARIA attributes or key handling are set in this component's own source; it renders native elements and the components it composes.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
Note: the muted paragraph under a figure or list (8px top margin,flush).TextLink: a link at the end of a muted line.Strong: the opposite job, emphasis inside running text.Term/MoneyNote: when the grey words need an explanation.
See also: Card · Leaderboard · FormField · Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/Muted.tsx (line 23) on GitHub.