Center
Puts its content in the middle, both ways: a sign-in box, a single message, an empty place.
import { Center } from '@sypnia/ui/react'
On this page
In the middle
Sign in to see your projects.
Code
import { Button, Center, Says } from '@sypnia/ui/react';
export default function Middle() {
return (
<Center minHeight="14rem">
<div className="sy-stack" style={{ '--gap': 'var(--s-3)', justifyItems: 'center' } as React.CSSProperties}>
<Says size="sm">Sign in to see your projects.</Says>
<Button variant="primary">Sign in</Button>
</div>
</Center>
);
} When to use it
Use it when
- One thing alone on a screen or in a region.
Do not use it when
- Text longer than a few lines: centred paragraphs are hard to read.
For everyone
- Only layout.
Props
| Center | Type | Default |
|---|---|---|
className | string | |
minHeight | string |