DecisionsCard
The PR mock's sidebar card "Open decisions": the codes of the product decisions still open as small butter pills (each with its question as the tooltip and in the accessible name), and a switch that shows or hides the inline DecisionTags across the screens. Sits in AppShell's sidebarCard slot (a SidebarCard, so it hides on the icon rail).
import { DecisionsCard } from '@ergasti/bricks';Examples
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 prDecisionsCard, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
title | Open decisions | قرارات مفتوحة |
show | Show decision tags | اعرض علامات القرارات |
none | Nothing open. | مفيش حاجة مفتوحة. |
Design guidance
How the BRICKS design system uses DecisionsCard. Written in docs/content/components/DecisionsCard.md; the props above are read from the code, which wins where the two disagree.
The PR sidebar's "Open decisions" card: the codes of the product decisions still open as small butter pills, and a "Show decision tags" switch that shows or hides the inline DecisionTags across every screen; use it in AppShell's sidebar card slot.
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.
DecisionsCard is the PR mock v3's sidebar card. Each code's question is its tooltip and part of its accessible name; with tip="focus" every code is a tab stop with its own tooltip, so keyboard and touch users can read it too. The app keeps the switch's state and passes it to a DecisionTagsProvider around the page. It is a SidebarCard, so it hides on the icon rail.
Anatomy
- SidebarCard: dark sidebar card with the heading "Open decisions" (or
title). - Codes: a
<ul>labelled by the heading, wrapping butter pills 5px apart ("C3", "R10", "GS1"); withtip="focus"each code is focusable with a tooltip. - Empty: "Nothing open."
- Switch (with
onShowTagsChange): "Show decision tags" label and a kitSwitch.
Variants
| Prop | Value | Effect |
|---|---|---|
tip | title (default) | Browser tooltips; question read after the code |
focus | Focusable codes with their own tooltips (Escape hides) | |
onShowTagsChange | omitted | No switch |
States
| State | Trigger |
|---|---|
| Codes | decisions non-empty |
| Nothing open | decisions=[] |
| Tags on / off | showTags |
| Code focused | tip="focus": focus ring and tooltip |
Types
OpenDecision (decisions): { id, question? } in display order.
Usage
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: 'GS1', question: 'Damaged or extra units: brand collects within 14 days?' },
];
export function Sidebar() {
const [show, setShow] = useState(true);
return (
<DecisionTagsProvider visible={show}>
<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" />
</Card>
</DecisionTagsProvider>
);
}// In the app shell, with focusable codes
<AppShell
brand={{ name: <>TRNDR<span className="kit-shell-accent">.</span></>, label: 'TRNDR', tagline: 'PR Portal' }}
nav={prNav}
activeId="home"
onNavigate={go}
sidebarCard={<DecisionsCard decisions={openDecisions} tip="focus" showTags={showTags} onShowTagsChange={setShowTags} />}
>
{page}
</AppShell>Where it appears
- PR Portal › every page › sidebar, under the nav ("Open decisions" with the switch).
- Dashboard screen: PrHome ("Queue tiles, needs-attention rows, decisions").
Guidelines
Do
- Wrap the whole app in
DecisionTagsProviderwith the switch's state. - Use
tip="focus"so keyboard users can read the questions.
Don't
- Don't ship it: it is a design-review aid; remove it before release, and never show it to brands.
- Don't list closed decisions.
RTL and Arabic
Mirrors with the sidebar; codes stay Latin; tooltips dir="auto".
Tokens
--butter, --butter-ink, --focus-ring, --min-touch-target, plus SidebarCard and Switch tokens.
Accessibility
A labelled list of codes with their questions (tooltip and hidden text, or described-by tooltips with tip="focus"); a labelled switch; focus rings and 44px targets (touch tiers, ≤1024px) on focusable codes.
Found in the source
- Roles in the markup:
tooltip. - ARIA attributes set:
aria-labelledby,aria-describedby.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
DecisionTag/DecisionTagsProvider: the inline tags it controls.SidebarCard(shell): the card it sits in.
See also: Switch · useLanguage · Sidebar · Card · BulkAction · ChangePreview · ChoiceGroup · FigureRow
Source
src/pr/decisions/DecisionsCard.tsx (line 49) on GitHub.