DecisionTag
Marks something on a screen that waits on a product decision. Put it right after the label it belongs to ("Needs you", a column header, a button's text): it sits on the text's line, after a small gap on the inline-start side. The code is what shows; screen readers hear "Open decision P6" and the question, which is also the tooltip.
import { DecisionTag } from '@ergasti/bricks';Examples
Open decision with its question, focusable
Where a product decision is still open, variant="open" stands in for the value: "Open · R10" on butter with a dashed border. With tip="focus" the tag is a tab stop and shows what the decision is about on hover and keyboard focus (Escape hides it); the same words are its accessible description.
Code
import { DecisionTag } from '@ergasti/bricks';
function WithTitle() {
return (
<p style={{ margin: 0 }}>
Tier bonus <DecisionTag variant="open" tip="focus" id="R10" question="What a tier gives creators" /> · Winners are paid: <DecisionTag variant="open" tip="focus" id="T4" question="When challenge rewards are paid" />
</p>
);
}Plain tag
Without tip="focus" it is text only, not a tab stop (the question, if any, is the browser's tooltip and is read after the words): use it inside another control (a button).
Code
import { DecisionTag } from '@ergasti/bricks';
function Plain() {
return <DecisionTag variant="open" id="S4" />;
}In Arabic
The words come from the provider's labels.prDecisionTag or the labels prop; the code stays as it is.
Code
import { DecisionTag } from '@ergasti/bricks';
function Arabic() {
return (
<p dir="rtl" style={{ margin: 0 }}>
مكافأة المستوى <DecisionTag variant="open" tip="focus" id="R10" question="المستوى بيدّي صنّاع المحتوى إيه" language="ar" />
</p>
);
}Open decisions
DecisionsCard sits in AppShell's sidebarCard slot: the open codes (each one's question is its tooltip) and a switch. The app keeps the switch's state and hands it to a DecisionTagsProvider around the page, so every inline DecisionTag shows or hides with it. variant="open" is the "Open · R10" pill that always shows, in place of a value nobody has decided.
Code
import { useState } from 'react';
import { Card, DecisionTag, DecisionTagsProvider, DecisionsCard } from '@ergasti/bricks';
const OPEN = [
{ id: 'C3', question: 'Can a brand opt out of a TRNDR-wide challenge?' },
{ id: 'R10', question: 'What a tier gives creators' },
{ id: 'S4', question: 'Can PR add or remove tiers?' },
{ id: 'T4', question: 'When challenge rewards are paid' },
{ id: 'GS1', question: 'Damaged or extra units: brand collects within 14 days?' },
{ id: 'GS2', question: 'Can PR launch a gift challenge with fewer gifts than planned?' },
];
function Sidebar() {
const [show, setShow] = useState(true);
return (
<DecisionTagsProvider visible={show}>
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(248px, 1fr))', gap: 16, alignItems: 'start' }}>
<div style={{ maxWidth: 248, padding: 14, borderRadius: 18, background: '#141414' }}>
<DecisionsCard decisions={OPEN} showTags={show} onShowTagsChange={setShow} />
</div>
<Card>
<Card.Header title={<>Needs you<DecisionTag id="S12" /></>} sub="Most urgent first" />
<p style={{ margin: 0 }}>Affiliate program<DecisionTag id="P6" question="Who can change a program?" /></p>
<p>What creators get: <DecisionTag id="R10" question="What a tier gives creators" variant="open" /></p>
</Card>
</div>
</DecisionTagsProvider>
);
}Codes you can focus
tip="focus" makes each code a tab stop that shows its question in its own tooltip on hover and keyboard focus (Escape hides it), so keyboard users can read it too. The default 'title' uses the browser's tooltip, which only a mouse shows.
Code
import { useState } from 'react';
import { DecisionsCard } from '@ergasti/bricks';
const OPEN = [
{ id: 'C3', question: 'Can a brand opt out of a TRNDR-wide challenge?' },
{ id: 'R10', question: 'What a tier gives creators' },
{ id: 'S4', question: 'Can PR add or remove tiers?' },
{ id: 'T4', question: 'When challenge rewards are paid' },
{ id: 'GS1', question: 'Damaged or extra units: brand collects within 14 days?' },
{ id: 'GS2', question: 'Can PR launch a gift challenge with fewer gifts than planned?' },
];
function FocusTips() {
const [show, setShow] = useState(false);
return (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(248px, 1fr))', gap: 16, alignItems: 'start' }}>
{(['title', 'focus'] as const).map((tip) => (
<div key={tip} style={{ maxWidth: 248, padding: 14, borderRadius: 18, background: '#141414' }}>
<DecisionsCard decisions={OPEN.slice(0, 4)} tip={tip} showTags={show} onShowTagsChange={setShow} />
</div>
))}
</div>
);
}Props
Prop
Type
Labels
Every word this component draws, in both languages. Override one per component and language with BricksProvider labels under the key prDecisionTag, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
tag | Open decision {id} | قرار مفتوح {id} |
open | Open · {id} | لسه مفتوح · {id} |
Design guidance
How the BRICKS design system uses DecisionTag. Written in docs/content/components/DecisionTag.md; the props above are read from the code, which wins where the two disagree.
A small marker for something on a PR screen that waits on a product decision: an inline code tag shown only while decision tags are on, or an always-visible "Open · R10" pill standing in for an undecided value.
Design-review aid. Remove before release; never shown to brands. It marks open product decisions while the v3 design is being reviewed; a production build ships without it.
DecisionTag is the PR mock v3's dt() and openTag(). The v3 mock is a design under review, and its open questions are coded (P6, R10, GS1). variant="tag" is a design-review aid: a small sky code after a label, drawn only while the nearest DecisionTagsProvider says so (the sidebar DecisionsCard's "Show decision tags" switch). variant="open" is a butter pill with a dashed edge that always shows, in place of a value nobody has decided (a tier's bonus). Screen readers hear "Open decision P6" and the question, which is also the tooltip. DecisionTagsProvider and useDecisionTagsVisible are documented here too.
Anatomy
- Tag (
tag):<span class="kit-pr-dtag">, the code (aria-hidden), hidden "Open decision P6" and " (question)"; sits on the label's line after a small inline-start gap. - Open pill (
open):<span class="kit-pr-open">"Open · R10", butter fill, butter-ink text, dashed--pr-open-lineedge. - Focus tooltip (
open+tip="focus"+ question): the pill is a tab stop with its ownrole="tooltip"(shown on hover and focus, Escape hides it).
Variants
| Prop | Value | Look | When to use |
|---|---|---|---|
variant | tag (default) | Small sky code, hidden unless tags are on | Mark an undecided label during reviews |
open | Butter "Open · R10" pill, always shown | Stand in for a value nobody has decided | |
tip | title (default) | Browser tooltip; question read after the words | Inside other controls (a button) |
focus | Focusable pill with its own tooltip | Standalone open values (keyboard and touch users) | |
visible | true / false | Forces a tag on or off over the provider | One-off review screens |
States
| State | Trigger |
|---|---|
| Hidden tag | tag with no provider, or provider visible={false} |
| Shown tag | provider visible or visible prop |
| Tooltip open | hover / focus with tip="focus"; Escape hides until blur or leave |
Types
DecisionTagsProvider: visible: boolean, children. useDecisionTagsVisible(): boolean.
Usage
import { DecisionTag } from '@ergasti/bricks';
export function WithTitle() {
return (
<p style={{ margin: 0 }}>
Tier bonus <DecisionTag variant="open" tip="focus" id="R10" question="What a tier gives creators" /> · Winners are paid: <DecisionTag variant="open" tip="focus" id="T4" question="When challenge rewards are paid" />
</p>
);
}// Inline review tags follow the sidebar switch through the provider
<DecisionTagsProvider visible={showTags}>
<DecisionsCard decisions={OPEN} showTags={showTags} onShowTagsChange={setShowTags} />
<Card>
<Card.Header title={<>Needs you<DecisionTag id="S12" /></>} sub="Most urgent first" />
<p>Affiliate program<DecisionTag id="P6" question="Who can change a program?" /></p>
</Card>
</DecisionTagsProvider>// Inside a button: keep the plain title tooltip
<Button onClick={addTier}>Add a tier <DecisionTag variant="open" id="S4" /></Button>Where it appears
- PR Portal › every page while "Show decision tags" is on: Home "Needs you" (S12), join request sources (T2), new creators (T8), Login footnote (P1), programs (P6), gifts (GS1, GS2).
- PR Portal › Tiers › "Open · R10" / "Open · S4" in the ladder; Affiliate programs › Campaigns › a campaign's page (tier bonus).
- Dashboard screens: PrHome, PrTiers.
Guidelines
Do
- Put the tag right after the label it belongs to.
- Always pass the question; it is the only explanation a reader gets.
- Remove tags as decisions close; the sidebar lists what is still open.
Don't
- Don't ship it: remove every tag and the provider before release; brands never see them.
- Don't use
tip="focus"inside another control (no tab stop inside a button). - Don't use
openpills for statuses; they mean "undecided".
RTL and Arabic
The gap moves to the inline start; codes stay Latin; tooltips use dir="auto". Arabic words from labels.prDecisionTag.
Tokens
--butter, --butter-ink, --pr-open-line, --card, --ink, --line, --focus-ring, --lh-ar, --min-touch-target.
Accessibility
Tags read "Open decision P6 (question)"; the open pill reads "Open · R10" plus the question (after it, or as its description with tip="focus"). The focus tooltip is role="tooltip", dismissible with Escape.
Found in the source
- Roles in the markup:
tooltip. - ARIA attributes set:
aria-describedby,aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
DecisionsCard: the sidebar list and switch.TierLadder(open,openTagTip): draws the same "Open · X" pill.
See also: useLanguage · Sidebar · DecisionTagsProvider · Card · DecisionLine · IconSquare · PrCountPill
Source
src/pr/decisions/DecisionTag.tsx (line 72) on GitHub.