Data Display
Avatar
People and named things with stable fallbacks.
import { Avatar, MediaLabel, AvatarGroup, Person } from 'faifo-design'Avatar shows a person's picture or their initials on a stable colour. AvatarGroup stacks
several, Person pairs an avatar with a name and a second line, and MediaLabel is a readable row
name with optional media.
#When to use
- Use
Avatarfor people. Objects useThumbnail. - A missing image is not an error: initials and a placeholder keep rows aligned.
#Examples
Each example is a specimen of the package catalogue, rendered on the server exactly as shown in its code.
#Avatar and code
Stable fallbacks for people and exact machine-readable values.
tenant-vn-hn-0042Show codeHide code
import { Avatar, Code, Inline, MediaLabel } from 'faifo-design'
export const Example = () => (
<Inline
items={[
<Avatar name="Nguyễn Minh Châu" size="small" />,
<MediaLabel label="Product without an image" />,
<MediaLabel label="Product without a photo" reserveImage />,
<MediaLabel label="Product without a photo" reserveImage placeholder="package" />,
<Avatar name="Nguyễn Minh Châu" />,
<Avatar name="Nguyễn Minh Châu" size="large" />,
<Code value="tenant-vn-hn-0042" context="tenant" />,
]}
/>
)#Record facts and formatted values
Identity, status and locale-aware values remain small, reusable display primitives.
- Delivery date
- Quantity
- 1.200
- Total
- 18.450.000 ₫
Show codeHide code
import { AvatarGroup, DescriptionList, FormattedDate, FormattedMoney, FormattedNumber, Inline, Person, Stack, Status } from 'faifo-design'
export const Example = () => (
<Stack
items={[
<Inline
items={[
<Person name="Ngọc Linh" detail="Sales operations" />,
<AvatarGroup
label="Order collaborators"
people={[
{ id: 'linh', name: 'Ngọc Linh' },
{ id: 'minh', name: 'Minh Anh' },
{ id: 'ha', name: 'Thu Hà' },
{ id: 'nam', name: 'Hoàng Nam' },
{ id: 'vy', name: 'Thảo Vy' },
]}
max={4}
/>,
<Status label="Ready" tone="positive" />,
]}
/>,
<DescriptionList
columns={3}
items={[
{ id: 'date', label: 'Delivery date', value: <FormattedDate value="2026-09-08" /> },
{ id: 'quantity', label: 'Quantity', value: <FormattedNumber value={1200} /> },
{
id: 'total',
label: 'Total',
value: <FormattedMoney value={18450000} currency="VND" />,
},
]}
/>,
]}
/>
)#API
Generated from the package source. A property without a description has none in the source yet.
#AvatarComponent
| Property | Description | Type | Default |
|---|---|---|---|
namerequired | – | string | – |
size | – | 'small' | 'default' | 'large' | 'default' |
src | – | string | – |
decorative | Informative when rendered alone; defaults to decoration beside a name. | boolean | – |
#MediaLabelComponent
A readable row name with optional media. Empty collections do not pay for an unused image column. A reserved slot without an image shows a muted placeholder icon, so a row that has no photo reads as "no photo" rather than as a missing one.
| Property | Description | Type | Default |
|---|---|---|---|
labelrequired | – | string | – |
src | – | string | – |
reserveImage | – | boolean | – |
placeholder | Glyph drawn in a reserved slot that has no image. | IconName | 'image' |
#initialsFunction
function initials(name: string): string| Parameter | Type |
|---|---|
namerequired | string |
| Returns | string |
#AvatarGroupComponent
| Property | Description | Type | Default |
|---|---|---|---|
labelrequired | – | string | – |
peoplerequired | – | readonly { id: string; name: string }[] | – |
max | – | number | 4 |
#PersonComponent
| Property | Description | Type | Default |
|---|---|---|---|
namerequired | – | string | – |
detail | – | JSXChild | – |
href | – | string | – |
size | – | 'small' | 'default' | 'large' | – |
#Types
#AvatarProps
The properties of Avatar, listed above.
#PersonProps
The properties of Person, listed above.