OrgMark
Hero example
When to use
Reach for OrgMark when you need a compact organisation identity — the sidebar header trigger ("⌘O to switch organisations"), the org-switcher drawer rows, dashboard breadcrumb prefixes, and audit-log activity rows where the actor is an organisation rather than a person. The mark is a rounded square (radius scales with size) carrying two-letter initials in mono on a role-colored background.
Don't reach for OrgMark for individual users — that's an avatar component (consumer responsibility; not in @matter/components yet). Don't use it for non-org identities either; the --role-* token family is org-specific.
accent as a --role-* token name (without the -- prefix). The CSS variable lookup handles the fallback.Anatomy
A single <span class="m-orgmark"> with inline-grid placement that centers the initials inside the swatch. Geometry:
- Width and height equal
size(default 26). - Border radius is
max(4, round(size × 0.18))— keeps the square visually rounded at every size. - Background reads
var(--{accent}, var(--accent, #DDDCD8)). - Foreground reads
var(--paper-50, var(--background, #FAFAF9)). - Initials render in Geist Mono at 40% of size, weight 600.
aria-label="Organisation {name}" makes the swatch accessible without showing the full name visually.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| orgrequired | OrgMarkOrg | — | — |
| size | number | 26 | — |
org.accent is the CSS variable name minus the -- prefix ("role-peach" resolves to var(--role-peach)). If the token isn't defined, the mark falls back to --accent and then to #DDDCD8.
States
Stateless.
Density
OrgMark is sized via the size prop, not via the site density toggle. Typical sizes:
| Use | size |
|---|---|
| Sidebar header trigger | 28 |
| Default (dashboard rows) | 26 |
| Inline (audit log, activity feed) | 20 |
| Drawer row (org switcher) | 32 |
Themes
In dark, the foreground --paper-50 adapts; the role-color background retains saturation. In forced-colors, the swatch collapses to Highlight with HighlightText.
Tokens consumed
Background reads any --role-* token (peach, sage, amber, lavender, etc., depending on which roles the brand has wired). Foreground reads --paper-50. Fallbacks: --accent, --background, #FAFAF9.
Accessibility
- Keyboard interactions. None on the swatch. Wrapper elements supply interactivity.
- ARIA roles and properties.
aria-label="Organisation {name}"carries the accessible identity. Initials are visual only. - Focus order. N/A.
- Screen-reader expectations. Announces the org name (full, not initials). Wrapped buttons announce as "
{org name}, button." - Reduced motion. N/A.
- Forced colors. Accent →
Highlight; initials →HighlightText. - WIG rules.
aria-labelover the swatch (icon-only rule, since the initials are visual).user-select: noneprevents the initials from being draggable text. Role-color choice via token (no inline hex).
Do / Don't
initials from the org's display name. Two characters max.size for inline use cases — <OrgMark size={20}> for audit-log rows, <OrgMark size={32}> for switcher drawers.accent role for the org's lifecycle phase. Peach for create, sage for verified, lavender for read-only.Recipes
This component appears in:
- Dashboard sidebar headers.
- The org-switcher drawer.
- Audit-log activity rows when the actor is an organisation.
Code example
import { OrgMark } from "@matter/components";
export function SidebarOrgTrigger({ org }: { org: Organisation }) {
return (
<button type="button" className="sidebar-org-trigger" onClick={openOrgSwitcher}>
<OrgMark org={{ name: org.legal_name, initials: org.initials, accent: org.role_color }} />
<span>{org.display_name}</span>
</button>
);
}Source
packages/components/src/OrgMark/OrgMarkDisplayHeading
Sized display heading — five sizes (mega → sub) map to V1-aliased CSS recipes so V1 → V2 migration is import-path-only. Visual size is independent of the HTML heading level — pass `as` to set the right semantic element.
CodeBlock
Geist Mono code surface with 5-token syntax coloring. Optional header slot composes any V2 primitive — the V1 CodeCard role. Always translucent white, never dark slate. Bare mode renders <pre>; header mode wraps in <figure>.