GroupTag
The v3 mock's .gtag: a creator group's name on a lilac pill. With onOpen it is a button (the creator drawer's Groups section opens the group); otherwise plain text.
import { GroupTag } from '@ergasti/bricks';Examples
Tags
With onOpen the tag is a button (a group a creator belongs to); without it, plain text.
Code
import { useState } from 'react';
import { GroupTag } from '@ergasti/bricks';
function Tags() {
const [opened, setOpened] = useState('');
return (
<div style={{ display: 'grid', gap: 8 }}>
<div style={{ display: 'flex', gap: 8 }}>
<GroupTag name="Top sellers" onOpen={() => setOpened('Top sellers')} />
<GroupTag name="TikTok first" />
</div>
<small>{opened ? `Opened: ${opened}` : 'Press a tag to open its group.'}</small>
</div>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses GroupTag. Written in docs/content/components/GroupTag.md; the props above are read from the code, which wins where the two disagree.
A creator group's name on a lilac pill, optionally a button that opens the group; use it to list the groups a creator belongs to.
GroupTag is the v3 mock's .gtag: 12px 700 lilac-ink text on a --lilac pill, no wrap. With onOpen it becomes a button (the creator drawer's Groups section opens that group's drawer); without it, it is plain text. dir="auto" lets an Arabic group name set its own direction.
Anatomy
- Pill (
span.kit-gtagorbutton.kit-gtag): padding 5px 12px, radius 99px, inline-flex. - Name: the group name.
Variants
| Prop | Look | When |
|---|---|---|
no onOpen | Static pill | Read-only lists |
onOpen | Button pill; hover adds a 1px inset ring in the ink colour | Creator drawer › Groups |
States
| State | Trigger | Look |
|---|---|---|
| Default | — | Lilac pill |
| Hover | pointer on the button | Inset ring |
| Focus-visible | Tab | Shared kit focus ring |
| Long name | long text | Stays one line (nowrap); it can push the row wider |
| Touch | ≤1024px | Button grows to 36px min height |
Usage
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 6 }}>
{groups.length === 0
? <span className="kit-muted">Not in a group</span>
: groups.map((g) => <GroupTag key={g.id} name={g.name} onOpen={() => openGroup(g.id)} />)}
</div><GroupTag name="Ramadan glow squad" />Where it appears
- Brand › Creators › creator drawer (
MyCreatorPanel) › Groups section. - Screen: Creators.
Guidelines
Do
- Wrap several tags in a flex row with a small gap.
- Use
onOpenonly when a group drawer exists.
Don't
- Don't use it for statuses or tiers (use
StatusPill,TierChip). - Don't shorten names; keep group names short at the source instead.
RTL and Arabic
dir="auto"per tag, so mixed-language names keep their own order.
Tokens
--lilac, --lilac-ink.
Accessibility
- As a button: native
type="button", name = the group name, Enter/Space opens. - As text: read inline.
Found in the source
- Its tests cover: “with onOpen it is a button: click, Enter and Space open the group”.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
GroupCommissionPill: a group's special commission.Pill: neutral labels.GroupCard: the group itself.
See also: Avatar · AvatarStack · Button · ButtonLink
Source
src/kit/primitives/GroupTag.tsx (line 7) on GitHub.