enes

Persona

A Persona is a visual representation of a person. It wraps an Avatar together with presence information and up to four lines of text: the name plus primary, secondary and tertiary text.

John Doe

Software Engineer

Intranet

Team A

Presence Only

Available

Alex Johnson

Available

Custom Size

Usage

<script>
	import { Persona } from 'fluentui-svelte';
</script>

<Persona
	name="John Doe"
	primaryText="Software Engineer"
	secondaryText="Intranet"
	tertiaryText="Team A"
	presence={{ status: 'available' }}
	avatar={{ color: 'colorful' }}
/>

Text Align

A Persona supports three text alignments, with 'left' as the default position.

Alex Johnson

Available

Alex Johnson

Available

Alex Johnson

Available

Text Position

A Persona supports four text positions: 'top', 'bottom', 'left', and 'right'. The default position is 'right'.

Alex Johnson

Available

Alex Johnson

Available

Alex Johnson

Available

Alex Johnson

Available

Size

A Persona supports custom sizes, with a default of 42px. You can set the size using the size prop. This applies to both the avatar or presence-only display and all text.

John Doe

John Doe

John Doe

Avatar

A Persona wraps an avatar inside it, which can be customized with all the props available to the Avatar component.

John Doe

John Doe

John Doe

Presence

A Persona can display presence information, such as online status or availability. This is controlled through the presence prop, which accepts an object with a status key.

John Doe

John Doe

John Doe

John Doe

John Doe

John Doe

John Doe

John Doe

Component Props

NameTypeDefaultDescription
namestringThe name of the person or entity represented by this Persona. It is also used by the avatar for its initials.
sizenumber42The size of the avatar in pixels. The text scales with it.
primaryTextstringText to display below the name.
secondaryTextstringText to display below the primary text.
tertiaryTextstringText to display below the secondary text.
textAlign'left' | 'center' | 'right''left'How the text block is aligned.
textPosition'top' | 'bottom' | 'left' | 'right''right'Where the text block sits relative to the avatar.
presenceOnlybooleanRenders the presence badge on its own, without the avatar behind it.
avatarAlign'start' | 'center' | 'end''center'How the avatar is aligned against the text block.
element bindableHTMLDivElementThe DOM reference of the persona element.
avatarAvatarPropsThe props to spread on the avatar.
presenceBadgePresenceThe presence badge to display as a status indicator.