Persona
Persona
is a representation of an individual or a group with additional contextual information.![A pointing to the avatar within the persona; B pointing to the name of the individual; C pointing to the optional additional details of the individual](/static/d40f61fb1051be0245d8ac299aac7b1a/fd409/anatomy-individual.png)
Item | Name | Description |
---|---|---|
A | <Avatar /> | The <Avatar /> of the individual |
B | Name | The name of the individual |
C | Details | Any additional details about the individual |
![A pointing to the Perople icon within the persona; B pointing to the name of the group; C pointing to the optional additional details of the group](/static/d60feea8e98e7401e17877bcf2010e6e/fd409/anatomy-group.png)
Item | Name | Description |
---|---|---|
A | <People /> | A <People /> icon representing a group of individuals |
B | Name | The name of the group |
C | Details | Any additional details about the groupPersona |
A
Persona
can be used to represent an individual or a group. At a minimum, a name
is required for both variants.![](https://user-images.githubusercontent.com/428296/110052467-7f138f80-7d0c-11eb-8679-80aac7a19340.jpg)
Maria Mancini
Security
import React from 'react'import { Flex, Persona } from '@gusto/workbench'import type { Department } from './_testData'import { getRandomDepartment, getRandomEmployee } from './_testData'export const Basic = () => {const employee = getRandomEmployee()const department = getRandomDepartment()return (<Flex gap={4} flexDirection="column"><Personavariant="individual"name={employee['Name-FL']}avatarSrc={employee.Avatar}/><Persona variant="group" name={department.Name} /></Flex>)}
Additional details can be provided to give more context to the user or group.
![](https://user-images.githubusercontent.com/428296/110052484-82a71680-7d0c-11eb-9fbc-627f67b78b30.jpg)
Craig Ellis
Office Administrator
Sales
5 employees
import React from 'react'import { Flex, Persona } from '@gusto/workbench'import type { Department } from './_testData'import { getRandomDepartment, getRandomEmployee } from './_testData'export const Basic = () => {const employee = getRandomEmployee()const department = getRandomDepartment()return (<Flex gap={4} flexDirection="column"><Personavariant="individual"name={employee['Name-FL']}avatarSrc={employee.Avatar}/><Persona variant="group" name={department.Name} /></Flex>)}
Persona
comes in three sizes: small
, medium
, and large
.Small
![](https://user-images.githubusercontent.com/428296/110052455-7b800880-7d0c-11eb-944a-e9aca35aa5d1.jpg)
Alexis Muller
IT Specialist
Marketing
4 employees
Medium
![](https://user-images.githubusercontent.com/428296/110052463-7de26280-7d0c-11eb-9418-6c645765ffb8.jpg)
Fabian Lupea
Office Operations
Sales
5 employees
Large
![](https://user-images.githubusercontent.com/428296/110052468-7f138f80-7d0c-11eb-8f41-62ecb2f30839.jpg)
Phillip Carroll
Client Support Director
Security
1 employee
import React from 'react'import { Flex, Heading, Persona } from '@gusto/workbench'import type { Department } from './_testData'import { getRandomDepartment, getRandomEmployee } from './_testData'function formatDepartmentDetails(department: Department) {return `${department.Count} employee${department.Count > 1 ? 's' : ''}`}export const Sizes = () => {const employee1 = getRandomEmployee()const department1 = getRandomDepartment()const employee2 = getRandomEmployee()const department2 = getRandomDepartment()const employee3 = getRandomEmployee()const department3 = getRandomDepartment()return (<Flex gap={12} flexDirection="column"><Flex gap={4} flexDirection="column"><Heading level={3}>Small</Heading><Personaname={employee1['Name-FL']}details={employee1.Title}avatarSrc={employee1.Avatar}size="small"/><Personavariant="group"name={department1.Name}details={formatDepartmentDetails(department1)}size="small"/></Flex><Flex gap={4} flexDirection="column"><Heading level={3}>Medium</Heading><Personaname={employee2['Name-FL']}details={employee2.Title}avatarSrc={employee2.Avatar}size="medium"/><Personavariant="group"name={department2.Name}details={formatDepartmentDetails(department2)}size="medium"/></Flex><Flex gap={4} flexDirection="column"><Heading level={3}>Large</Heading><Personaname={employee3['Name-FL']}details={employee3.Title}avatarSrc={employee3.Avatar}size="large"/><Personavariant="group"name={department3.Name}details={formatDepartmentDetails(department3)}size="large"/></Flex></Flex>)}
If no
avatarSrc
is provided for an individual, a default illustration will be shown. The avatarId
prop ensures that the same illustration is used consistently with the individual across experiences.Mark Brouwer
People Operations
Vinay Katwal
People Operations
Sergio Guevara
People Operations
import React from 'react'import { Flex, Persona } from '@gusto/workbench'import type { Department } from './_testData'import { getRandomEmployee } from './_testData'export const FallbackAvatars = () => {const employee1 = getRandomEmployee()const employee2 = getRandomEmployee()const employee3 = getRandomEmployee()return (<Flex gap={4} flexDirection="column"><Personaid={employee1.Email}name={employee1['Name-FL']}details={employee1.Title}/><Personaid={employee2.Email}name={employee2['Name-FL']}details={employee1.Title}/><Personaid={employee3.Email}name={employee3['Name-FL']}details={employee1.Title}/></Flex>)}
Name | Type | Default | Description |
---|---|---|---|
name Required | string | - | The name of the individual or group that the Persona represents. |
details | ReactNode | - | Additional contextual details about the individual or group that the Persona represents. |
avatarId | string | - | The unique identifier of the Persona (i.e. user ID). This value provided is used to generate a unique fallback illustration for the Avatar . This prop is required if avatarSrc is not provided. |
avatarSrc | string | - | A URL to use for the Avatar image. If this prop is not provided, a fallback illustration will be used. This prop is required if avatarId is not provided. |
size | small medium large | medium | The size and density of the Persona component. |