Skip to content

Contact Item

Get Ritla UI

A person with their avatar, name and one line of context, such as an email or when they were last active. The contact card adds one action: a menu of actions, a radio to pick them, or a link.

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add contact-item

    Also works with shadcn: npx shadcn@latest add @ritla/contact-item

  2. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

contact-item.tsx
import { ContactItem, ContactCard } from "@/components/ui/contact-item";<ContactItem name="Layla Amiriah" supportingText="Active now" status="online" /><ContactCard href="/contacts/layla" name="Layla Amiriah" supportingText="layla@demo-bank.example" action="View" />

Examples

Cards with one action

An icon button opening a menu, named for whose actions they are (“More actions for Layla”). The View card is one link, so the whole card opens the contact.

EnglishMirroredArabic
LTR →

Pick a recipient

ContactRadioCard inside a RadioGroup: the whole card labels the radio, which is named by the name and status and described by the supporting line.

EnglishMirroredArabic
LTR →

Emails and phones stay left to right

The supporting line takes its direction from its text. An email sets it by itself; a phone number has no letters, so put it in <bdi dir="ltr">.

EnglishMirroredArabic
LTR →

API reference

ContactItem

PropTypeDefaultDescription
namestringNoneFigma's Name: the name people know, in the script the person wrote it in.
supportingTextReactNodeNoneFigma's Supporting text: one useful line, such as an email, a role or the last active time.
srcstringNoneThe person's photo. Without one, their initials show.
status"none" | "online" | "away" | "offline" | "verified""none"Figma's Status: a dot or badge on the avatar, read as a word after the name.
size"md" | "lg""lg"Figma's Size: a 40 or 48px avatar.

ContactCard

PropTypeDefaultDescription
actionReactNodeNoneFigma's Action Type: an icon button (Icon Button) or a short word (Text), styled for you when it is a string.
hrefstringNoneMakes the whole card one link that opens the contact.
renderReactElementNoneA router link (<Link>) with the card's look.
…ContactItem propsNoneEvery ContactItem prop.

ContactRadioCard

PropTypeDefaultDescription
valuestringNoneThis person's value in the RadioGroup.
disabledbooleanNoneCan't be picked; the texts take the disabled color.
…ContactItem propsNoneEvery ContactItem prop.

Usage guidelines

A contact item shows a person with their avatar, name and a line that helps tell them apart. Item or card, the name and supporting line, status and privacy, actions, how the row mirrors in Arabic, and the checks before handoff.

1. Item or card

Use a Contact item on its own in lists, headers and chats. Use a Contact card when the row needs one action: open more options, pick the contact, or view their details.

ComponentUse
Contact itemLists of people, chat headers, the account holder on a card.
Contact card, Icon ButtonA person with more actions behind a menu.
Contact card, Radio buttonPicking one person, such as a transfer recipient.
Contact card, TextA person with one clear link, such as View.

2. Name and supporting line

Show the name people know, then one line that helps tell people apart: a role, an email, a phone number or when they were last active. Long names truncate with a tooltip; never cut the supporting line into meaningless pieces.

One useful line

Choosing a colleague to approve a payment.

Do: Name and roleThe role tells people which Layla to pick.
Don't: Everything at onceEmail, role and office in one line make it long, hard to scan and cut off on phones.

Do

  • Show one supporting line that helps people choose.
  • Truncate long names with a tooltip showing the full name.
  • Keep one size, md or lg, per list.

Don't

  • Stack several facts into the supporting line.
  • Show the same supporting text for everyone in the list.
  • Cut a name without a way to read it in full.

3. Status and privacy

Online, Away and Offline show availability; Verified confirms an account. Show availability only where it matters, such as chat, and only for people who agreed to share it. The status is part of the accessible name, not only a colored dot.

Do

  • Show availability only in chat and collaboration contexts.
  • Respect people's choice to hide their status.
  • Use Verified only for confirmed accounts.

Don't

  • Show online status in a payments list.
  • Rely on the dot color alone.

4. Actions

A contact card has exactly one action at its inline end. More actions go behind the Icon Button's menu. When people pick a contact, the radio makes the choice clear; the whole card is the target.

Do

  • Keep one action per card.
  • Name the Icon Button with the person: More actions for Layla Haddad.
  • Let the whole card select the contact in pick lists.

Don't

  • Add several buttons to one row.
  • Hide the only way to reach a contact behind a hover.

5. Arabic and RTL

The RTL variant mirrors the row: the avatar and name start on the right, the action and status sit at the inline end. Emails and phone numbers in the supporting line stay left to right; in code the line takes dir="auto" and numbers get dir="ltr".

The row mirrors, the email doesn't

A contact in an Arabic list.

Do: RTL variantThe avatar and name start on the right; the email reads left to right.
Don't: English row on an Arabic screenThe avatar sits on the left, and the Arabic name keeps a Latin font.

Before handoff

  • Item or card chosen, with one action per card.
  • One useful supporting line; long names have a tooltip.
  • Status is shown only with consent.
  • Arabic screens use the RTL variant, with emails left to right.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabTo a linked card, the action button, or the radio group.
EnterOpens the contact or the actions menu.
ArrowDownArrowUpBetween people in a radio group, selecting the one reached.

ARIA

  • The avatar is decorative because the name is visible next to it, so the name isn't read twice.
  • The status is a word read after the name (“Layla Amiriah, Online”), never the colored dot alone.
  • The action button has its own name that says who it is for (“More actions for Layla”).
  • In a radio card, the name and status name the radio, and the supporting line describes it.

Do

  • The name carries the meaning; hide the avatar next to it.
  • Read the status with the name: “Layla Haddad, online”.
  • Make the whole card one target when it has one action.

Don't

  • Announce the avatar and the name separately.
  • Put the status only in the dot color.

Arabic and RTL notes

Mirrors

  • The avatar and name start on the right; the action sits at the end, on the left.
  • The status dot and verified badge move to the avatar's bottom-left corner.

Does not mirror

  • Emails, phone numbers and account numbers in the supporting line stay left to right.
  • The three-dot icon and the verified badge.
Numerals
Numbers in the text are as you pass them; format times and counts with formatNumber, and leave phone and account numbers as written.
Arabic typography
Name body-18 Semibold and line body-14 at lg; body-14 and body-12 at md. Texts wrap rather than clip, so a longer Arabic name stays whole.
Mixed-direction text
The name and the supporting line are each isolated with dir="auto"; a phone number needs <bdi dir="ltr">.

Do

  • The RTL variant in Arabic lists.
  • Keep emails and phone numbers left to right inside the Arabic row.
  • Show Arabic names in Arabic script when that is how the person wrote them.

Don't

  • An English row on an Arabic screen.
  • Right-align an email so it reads backwards.