Skip to content

components/Avatar

import { … } from 'zidane-ui'ui/src/components/Avatar.tsx

Components#

AvatarComponent#

Renders one person's face.

TypeScript
function Avatar(props: AvatarProps): Element
Parameters
NameTypeDescription
propsAvatarProps

The AvatarProps.

Element
Avatar props
NameTypeDefaultDescription
avatar?string

The photo's URL.

className?string

Extra classes on the root.

namestring

The person's name: its first letter shows without a photo.

online?boolean

true: the online dot.

ring?boolean

A ring in the surface's color around the face (a stack).

size?AvatarSize'sm'

The face's size.

style?CSSProperties

Inline styles on the root.

typing?boolean

true: they type now, the breathing ring. false: the ring's place, faded out. Absent: none.

ui/src/components/Avatar.tsx:60

Interfaces#

AvatarPropsInterface#

Props for Avatar.

TypeScript
interface AvatarProps
AvatarProps properties
NameTypeDefaultDescription
avatar?string

The photo's URL.

className?string

Extra classes on the root.

namestring

The person's name: its first letter shows without a photo.

online?boolean

true: the online dot.

ring?boolean

A ring in the surface's color around the face (a stack).

size?AvatarSize'sm'

The face's size.

style?CSSProperties

Inline styles on the root.

typing?boolean

true: they type now, the breathing ring. false: the ring's place, faded out. Absent: none.

ui/src/components/Avatar.tsx:17

Types#

AvatarSizeType#

The face sizes: sm 20px (a header's stack), md 28px (a card's row).

TypeScript
type AvatarSize = 'sm' | 'md'

ui/src/components/Avatar.tsx:14