BrandStack
The creators table's .bstack: the first max brand squares overlapped, then "+N". The names are the group's accessible name (and its tooltip); no brands shows a dash, read as "None".
import { BrandStack } from '@ergasti/bricks';Examples
Brand marks
A coloured initial tile in four sizes, the brand cell for tables (name, a sub line, a suffix) and an overlapping stack with a "+N" count.
Code
import { BrandAvatar, BrandCell, BrandStack, Pill } from '@ergasti/bricks';
import { brands } from './pr';
function Marks() {
return (
<div style={{ display: 'grid', gap: 14 }}>
<div style={{ display: 'flex', gap: 12, alignItems: 'center' }}>
{(['xs', 'sm', 'md', 'lg'] as const).map((size) => <BrandAvatar key={size} name="Glow Lab" color="#C7325C" size={size} />)}
</div>
<BrandCell name="Glow Lab" color="#C7325C" sub="10% of sale" suffix={<Pill tone="ok">Live</Pill>} />
<BrandStack brands={Object.values(brands)} max={3} />
</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 avatarStack, or with the component's own prop where it has one. A {name} is a value the component fills in.
| Key | English | Arabic |
|---|---|---|
more | and {n} more | و{n} كمان |
separator | , | ، |
Design guidance
How the BRICKS design system uses BrandStack. Written in docs/content/components/BrandStack.md; the props above are read from the code, which wins where the two disagree.
Overlapping brand squares with "+N": the first max brands a creator works with, then a count of the rest; use it in the creators table's Brands column.
It is the PR mock's .bstack. The whole stack is one image to assistive tech named by all the brands' names (also its tooltip); no brands shows a dash, hidden from assistive tech, with visually hidden "None" text, so it is read as "None".
Anatomy
- Stack (
.kit-pr-bstack,role="img",aria-labelandtitle= names joined). - Squares:
BrandAvatarat 26px, radius 8, 2px card-coloured border, overlapping by 7px. - More (
.kit-pr-bstack-more): "+2", 12px 700--ink-3, LTR.
Variants
| Brands | Look |
|---|---|
| 0 | "—", read as "None" / "ولا براند" (visually hidden text; the dash is aria-hidden). |
1…max | That many squares. |
more than max | max squares and "+N". |
States
Static.
Types
StackBrand (brands): { id, name, color? }.
Usage
import { BrandStack, type DataColumn, type StackBrand } from '@ergasti/bricks';
type CreatorRow = { id: number; name: string; brands: StackBrand[] };
// PR Portal › Creators table, Brands column
const brandsColumn: DataColumn<CreatorRow> = { key: 'brands', label: 'Brands', render: (c) => <BrandStack brands={c.brands} max={3} /> };<BrandStack brands={[{ id: 'glow', name: 'Glow Lab', color: '#C2185B' }, { id: 'nile', name: 'Nile Threads' }, { id: 'mira', name: 'Mira Beauty' }, { id: 'kemet', name: 'Kemet Home' }]} />Where it appears
- PR Portal › Creators table › Brands column. Screen: PR · Creators.
Guidelines
Do
- Keep
maxat 3 in tables.
Don't
- Don't use it for one brand with a name; use
BrandCell.
RTL and Arabic
- Overlap direction follows the page (start edge first); "+N" stays LTR.
Tokens
--card (square border), --ink-3; BrandAvatar tokens.
Accessibility
role="img"with every brand name as its label; "+N" isaria-hidden(the label lists all).
Found in the source
- Roles in the markup:
img. - ARIA attributes set:
aria-hidden,aria-label.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
AvatarStack: people.BrandAvatar,BrandCell.
See also: useLanguage · Pill · AdjustWalletDialog · BrandDetailHeader
Source
src/pr/BrandAvatar.tsx (line 61) on GitHub.