BrandAvatar
The PR mock's .bav: a brand's initials on its own colour, a rounded square (people are circles, brands are squares). sm 26 (stacks), md 38, lg 52 (the brand detail title). color is the brand's colour from its record; with none, the ink square. Decorative: the brand's name is always written beside it.
import { BrandAvatar } 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
Design guidance
How the BRICKS design system uses BrandAvatar. Written in docs/content/components/BrandAvatar.md; the props above are read from the code, which wins where the two disagree.
A brand's square avatar: its initials on its own colour, a rounded square (people are circles, brands are squares); use it wherever a brand is named in the PR Portal.
It is the PR mock's .bav. It is decorative: the brand's name is always written beside it (in BrandCell, a row title or a page title). color comes from the brand's record; with none the square is ink.
Anatomy
- Square (
.kit-pr-bav,aria-hidden): initials in the display face oncolor(or--ink), inverted text.
Variants
size | Box / radius / text | Use when |
|---|---|---|
'xs' | 22px / 7px / 9px | Inline mentions. |
'sm' | 28px / 9px / 10px | Small lists; 26px inside BrandStack. |
'md' (default) | 38px / --radius-md / 13px | Table cells, queue leads. |
'lg' | 52px / --radius-lg / 18px | The brand detail title. |
States
Static. No colour → ink square.
Usage
<BrandAvatar name="Glow Lab" color="#C2185B" />
<BrandAvatar name="Nile Threads" size="lg" />// With its name: prefer BrandCell in tables
<BrandCell name="Mira Beauty" color={mira.color} sub="8% of sale" />Where it appears
- PR Portal › Brands table, Programs table, approvals, Home "My brands" and brand alerts (via
BrandCell,BrandLead,BrandStack). Screens: PR · Brands, PR · Home, PR · Affiliate programs. - PR Portal › Brand detail header (
lg). Screen: PR · Brand.
Guidelines
Do
- Always write the brand's name next to it.
- Use the brand's stored colour consistently across screens.
Don't
- Don't use it for people (use
Avatar, a circle). - Don't put a logo image in it; it draws initials.
RTL and Arabic
- No mirroring; initials come from the brand's (usually Latin) name.
Tokens
--ink, --color-text-inverted, --radius-md, --radius-lg, --font-family-display.
Accessibility
aria-hidden: purely decorative. Check the brand colour gives enough contrast for white initials.
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
BrandCell: square + name + sub.BrandStack: overlapping squares with "+N".BrandLead: the queue row lead.Avatar: people.
See also: useLanguage · Pill · AdjustWalletDialog · BrandDetailHeader · BrandFeeDialog
Source
src/pr/BrandAvatar.tsx (line 12) on GitHub.