SidebarCard
The mock's .side-card: a bold title, a short note, an optional action (the lime "Contact TRNDR").
import { SidebarCard } from '@ergasti/bricks';Examples
The sidebar by itself
Brand block, grouped navigation (a group can collapse), a card slot and a footer slot. collapsed turns it into the 72px icon rail.
Code
import { useState } from 'react';
import { Avatar, Button, Sidebar, SidebarCard, SidebarUser, useLanguage } from '@ergasti/bricks';
import { brandMark, brandNav } from './nav';
function Expanded() {
const language = useLanguage();
const [active, setActive] = useState('creators');
return (
<div style={{ position: 'relative', height: 580 }}>
<Sidebar
brand={brandMark}
groups={brandNav}
activeId={active}
onSelect={(item) => setActive(item.id)}
card={<SidebarCard title={language === 'ar' ? 'محتاج مساعدة؟' : 'Need a hand?'} action={<Button size="sm">Contact TRNDR</Button>}>Your account manager handles approvals.</SidebarCard>}
footer={<SidebarUser avatar={<Avatar name="Mona Adel" seed={0} size="sm" />} name="Mona Adel" detail="PR team" />}
/>
</div>
);
}Icon rail
Code
import { useState } from 'react';
import { Sidebar } from '@ergasti/bricks';
import { brandMark, brandNav } from './nav';
function Rail() {
const [active, setActive] = useState('home');
return (
<div style={{ position: 'relative', height: 580 }}>
<Sidebar brand={brandMark} groups={brandNav} activeId={active} onSelect={(item) => setActive(item.id)} collapsed />
</div>
);
}PR portal sidebar parts
A Switch in the sidebar is the PR mock's small dark switch (41 × 25, #3A3C45 off track) with no prop: the sidebar sets it. SidebarUser with avatarSize={34} draws the mock's 34px avatar, and the logout icon is its sign-out arrow.
Code
import { useState } from 'react';
import { Avatar, Button, Icon, Sidebar, SidebarCard, SidebarUser, Switch } from '@ergasti/bricks';
import { brandMark, brandNav } from './nav';
function PrParts() {
const [active, setActive] = useState('creators');
const [tags, setTags] = useState(false);
return (
<div style={{ position: 'relative', height: 580 }}>
<Sidebar
brand={brandMark}
groups={brandNav}
activeId={active}
onSelect={(item) => setActive(item.id)}
card={<SidebarCard title="Open decisions"><span style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginTop: 8 }}><label htmlFor="docs-tags">Show decision tags</label><Switch id="docs-tags" label="Show decision tags" checked={tags} onChange={setTags} /></span></SidebarCard>}
footer={<SidebarUser avatar={<Avatar name="Mona Adel" seed={7} />} avatarSize={34} name="Mona Adel" detail="PR team" action={<Button size="sm" variant="ghost" aria-label="Sign out"><Icon name="logout" /></Button>} />}
/>
</div>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses SidebarCard. Written in docs/content/components/SidebarCard.md; the props above are read from the code, which wins where the two disagree.
A small dark card at the bottom of the sidebar: a bold title, a short note and an optional action; use it for the sidebar's one help or status prompt ("Need a hand?" / "Contact TRNDR").
It is the brand mock's .side-card under the nav. The PR Portal's DecisionsCard is built on it (className). The sidebar hides it on the 72px rail.
Anatomy
- Card (
.kit-shell-card): 14px padding, radius 18,#1E1F25fill, grey 12px text. - Title (
<b>): white 13px. - Note (
children). - Action (
.kit-shell-card-act, 10px above): typically a small lime button.
Variants
| Use | Props |
|---|---|
| Help prompt (brand mock) | title="Need a hand?", note, action = lime "Contact TRNDR". |
| Status card (PR) | className for a custom block (DecisionsCard), pills as children, no action. |
States
Static. Long notes wrap; keep to two lines.
Usage
<AppShell
brand={brand} nav={nav} activeId="home"
sidebarCard={
<SidebarCard title="Need a hand?" action={<Button size="sm" variant="lime" onClick={contactTrndr}>Contact TRNDR</Button>}>
Your TRNDR account manager handles approvals, coupons and payouts for you.
</SidebarCard>
}
>…</AppShell>Where it appears
- Brand › every screen › sidebar bottom: "Need a hand?" with "Contact TRNDR". Screens:
Brand*. - PR Portal › sidebar: the open-decisions card (
DecisionsCard, built on this).
Guidelines
Do
- Keep one card, one action.
- Write the note as one sentence.
Don't
- Don't use it for alerts that need attention now; use a
Banneron the page. - Don't place it outside the sidebar or sheet (its colours assume the dark column).
RTL and Arabic
- Text aligns right; Arabic copy: "محتاج مساعدة؟", "كلّم TRNDR".
Tokens
Fixed colours (#1E1F25 fill, #B6B9C3 text, #FFFFFF title); the action uses button tokens. Inherits the sidebar's --kit-sw-* switch sizes.
Accessibility
- Plain content; the title is bold text, not a heading. The action must carry its own visible name.
- Grey text on
#1E1F25is for short notes; keep important words in the white title.
Found in the source
- ARIA attributes set:
aria-label,aria-hidden,aria-expanded.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
Sidebar(cardprop) andAppShell(sidebarCard).SidebarUser: the footer row under it.CalloutCard: the page-level call to action.
See also: NavGroups · useLanguage · Button · Avatar · Switch · Icon · BottomNav · BrandMark · MobileNavSheet
Source
src/shell/Sidebar.tsx (line 75) on GitHub.