Identity
A person or a team in one line: the avatar, the name and a second line such as the email or the role.
import { Identity, IdentitySkeleton } from '@sypnia/ui/react'
Name and second line
With an email, with a role, and with the name alone.
LMLaura MéndezDRDiego RuizACAna Castaño
Code
import { Identity } from '@sypnia/ui/react';
export default function Basic() {
return (
<div className="sy-stack">
<Identity name="Laura Méndez" meta="laura@northwind.io" />
<Identity name="Diego Ruiz" meta="Editor · joined November 5" />
<Identity name="Ana Castaño" />
</div>
);
} In a table
The first column of a list of members. On a phone it becomes the title of each card.
| Member | Role | Last seen |
|---|---|---|
| LMLaura Méndez | Owner | Today |
| DRDiego Ruiz | Editor | Yesterday |
| ACAna Castaño | Viewer | November 2 |
Code
import { Badge, Identity, Table } from '@sypnia/ui/react';
const members = [
{ name: 'Laura Méndez', email: 'laura@northwind.io', role: 'Owner', seen: 'Today' },
{ name: 'Diego Ruiz', email: 'diego@northwind.io', role: 'Editor', seen: 'Yesterday' },
{ name: 'Ana Castaño', email: 'ana.castano@northwind.io', role: 'Viewer', seen: 'November 2' },
];
export default function InATable() {
return (
<Table label="Team members" rows={members} rowKey={(m) => m.email} columns={[
{ id: 'member', header: 'Member', cell: (m) => <Identity name={m.name} meta={m.email} /> },
{ id: 'role', header: 'Role', cell: (m) => <Badge outline>{m.role}</Badge> },
{ id: 'seen', header: 'Last seen', cell: (m) => m.seen },
]} />
);
} Long names
They are cut, not wrapped.
Owner
MFMaría Fernanda Castaño de la Torre
Billing contact
NTNorthwind Traders Accounting
Code
import { Identity, Panel } from '@sypnia/ui/react';
// In a narrow place the name and the second line are cut with an ellipsis; they never wrap or push the layout.
export default function LongNames() {
return (
<div className="sy-grid">
<Panel title="Owner"><Identity name="María Fernanda Castaño de la Torre" meta="maria.fernanda.castano@northwind-traders.example" /></Panel>
<Panel title="Billing contact"><Identity name="Northwind Traders Accounting" meta="accounts-payable@northwind-traders.example" /></Panel>
</div>
);
} Skeleton
The real piece and its skeleton: the same box, so nothing moves when the data arrives.
LMLaura Méndez
Code
import { Identity, IdentitySkeleton } from '@sypnia/ui/react';
// The person who did something, while their name loads. The skeleton has the same box as the real one, so nothing moves when the data arrives.
export default function Skeleton() {
return (
<div className="sy-stack">
<Identity name="Laura Méndez" meta="laura@northwind.io" />
<IdentitySkeleton />
</div>
);
} When to use it
Use it when
- Lists and tables of people: members, customers, authors.
- Who did something: the owner of a project, the author of a change.
- The account menu: who is signed in.
Do not use it when
- Space only allows the picture: Avatar, with a Tooltip for the name.
- It needs actions or more than two lines: build a row with an Identity inside.
For everyone
- The name is real text beside the avatar, so it can be read, searched and selected.
- Long names and emails are cut with an ellipsis instead of wrapping. Give the full value somewhere reachable (the member’s page) when it matters.
- On phones it keeps one line and never forces a sideways scroll.
Props
| Identity | Type | Default |
|---|---|---|
namerequired | string | |
loadingThe person is on their way: the avatar is a skeleton, and the name and second line are bars as long as the `name` and `meta` given (typical ones, or the last known). | boolean | |
meta | ReactNode | |
src | string |
| IdentitySkeleton | Type | Default |
|---|---|---|
meta | boolean | true |