Persona

A component for displaying user identity information including avatar, name, presence status, and additional details.

Anatomy

<script>
  import {
    Persona,
    PersonaAvatar,
    PersonaPresenceBadge,
    PersonaDetails,
    PersonaLabel,
    PersonaSecondaryLabel,
    PersonaTertiaryLabel,
  } from "@saas-ui/svelte/components/persona";
</script>

<Persona.Root>
  <PersonaAvatar src="/avatar.jpg" name="John Doe" />
  <PersonaPresenceBadge presence="online" />
  <PersonaDetails>
    <PersonaLabel>John Doe</PersonaLabel>
    <PersonaSecondaryLabel>Software Engineer</PersonaSecondaryLabel>
    <PersonaTertiaryLabel>San Francisco, CA</PersonaTertiaryLabel>
  </PersonaDetails>
</Persona.Root>

Examples

Avatar Only Accessibility

Avatar-only personas without the details section for compact displays.

Basic Accessibility

Basic persona with avatar and user details.

Out Of Office Accessibility

Persona showing out of office status using the outOfOffice prop.

Presence Accessibility

Persona with presence badge indicator showing online, offline, busy, dnd, or away status.

Presence Ring Accessibility

Persona with ring-style presence indicator using variant="ring".

Shapes Accessibility

Persona with different avatar shapes: rounded, square, and full circle.

Sizes Accessibility

Persona in different sizes. Available sizes: 2xs, xs, sm, md, lg, xl, 2xl.

With Ring Accessibility

Persona with a coloured ring around the avatar for visual emphasis.

Props

Prop Type Default Description
size 2xs | xs | sm | md | lg | xl | 2xl md The size of the component.
variant badge | ring badge The variant of the presence indicator.
presence online | offline | busy | dnd | away - The presence status.
outOfOffice boolean false Whether the person is out of office.
children any - The content to be rendered inside the component.
class text - Additional CSS classes to apply.