Character
Nia and Nio, the two characters that keep the light. Nia watches, finds, fixes and celebrates; Nio sleeps until something needs him.
import { Character } from '@sypnia/ui/react'
The eight poses
nia-watchingNia watches: nothing is wrong
nia-foundNia found something
nia-fixingNia is fixing it
nia-celebratingNia celebrates
nio-sleepingNio sleeps: nothing here yet
nio-one-eyeNio opens one eye
nio-startledNio is startled
nio-stretchingNio wakes up
Code
import { Character, type CharacterName } from '@sypnia/ui/react';
const poses: [CharacterName, string][] = [
['nia-watching', 'Nia watches: nothing is wrong'], ['nia-found', 'Nia found something'], ['nia-fixing', 'Nia is fixing it'], ['nia-celebrating', 'Nia celebrates'],
['nio-sleeping', 'Nio sleeps: nothing here yet'], ['nio-one-eye', 'Nio opens one eye'], ['nio-startled', 'Nio is startled'], ['nio-stretching', 'Nio wakes up'],
];
export default function Poses() {
return (
<div className="sy-grid" style={{ '--min': '9rem', '--gap': 'var(--s-5)' } as React.CSSProperties}>
{poses.map(([name, says]) => (
<figure key={name} className="sy-stack" style={{ '--gap': 'var(--s-2)', margin: 0, alignItems: 'center', textAlign: 'center' } as React.CSSProperties}>
<Character name={name} size="6.5rem" />
<figcaption className="sy-text--xs sy-text--muted"><code>{name}</code><br />{says}</figcaption>
</figure>
))}
</div>
);
} In an empty place
The character says the mood; the words say what goes here, and the button fills it.
No problems yet
When your app reports its first error, it shows here, grouped by its cause.
Code
import { Button, Character } from '@sypnia/ui/react';
// In an empty place, the character says the mood; the words say what goes here and the button fills it.
export default function Empty() {
return (
<div className="sy-stack" style={{ '--gap': 'var(--s-3)', alignItems: 'center', textAlign: 'center', padding: 'var(--s-5) 0' } as React.CSSProperties}>
<Character name="nio-sleeping" size="8rem" />
<p className="sy-display sy-display--xs">No problems yet</p>
<p className="sy-text--muted" style={{ maxWidth: '26rem' }}>When your app reports its first error, it shows here, grouped by its cause.</p>
<Button variant="primary">Connect your app</Button>
</div>
);
} When to use it
Use it when
- Empty states, a long wait, a search with no results, a moment worth celebrating.
- At most one character on a screen.
Do not use it when
- Errors that need action now: the words and the button matter, not a mood.
- Decorating every page: they mean something when they appear.
For everyone
- A character is decoration unless it is given a
label; give one only when it says something the words do not.
Props
| Character | Type | Default |
|---|---|---|
namerequiredWho, and in which pose: Nia watches, finds, fixes and celebrates; Nio sleeps, opens one eye, startles and stretches. | "nia-watching" | "nia-found" | "nia-fixing" | "nia-celebrating" | "nio-sleeping" | "nio-one-eye" | "nio-startled" | "nio-stretching" | |
className | string | |
labelWhat the picture says, for screen readers. Leave it out when the words beside it already say it. | string | |
sizeWidth, as CSS. Default 7.5rem. | string |