Skip to content

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'

On this page
  1. Name and second line
  2. In a table
  3. Long names
  4. Skeleton
  5. When to use it
  6. For everyone
  7. Props

Name and second line

With an email, with a role, and with the name alone.

LMLaura Méndezlaura@northwind.ioDRDiego RuizEditor · joined November 5ACAna 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.

MemberRoleLast seen
LMLaura Méndezlaura@northwind.ioOwnerToday
DRDiego Ruizdiego@northwind.ioEditorYesterday
ACAna Castañoana.castano@northwind.ioViewerNovember 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 Torremaria.fernanda.castano@northwind-traders.example

Billing contact

NTNorthwind Traders Accountingaccounts-payable@northwind-traders.example
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éndezlaura@northwind.io
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

IdentityTypeDefault
namerequired string
loading

The 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
IdentitySkeletonTypeDefault
meta boolean true
  1. Name and second line
  2. In a table
  3. Long names
  4. Skeleton
  5. When to use it
  6. For everyone
  7. Props

    Search pages, sections and terms