Components
Center
A layout container that vertically and horizontally centers its children
Overview
Center is a flexbox-based centering container. display: flex, align-items: center, and justify-content: center are applied by default.
- Polymorphic — Render as any HTML element via the
asprop - Sprinkles support — All design token props available (
p,m,bg,rounded, etc.) - Concise — Eliminates centering boilerplate
Basic Usage
Polymorphic Rendering
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
as | ElementType | 'div' | No | Element to render |
children | ReactNode | - | No | Content |
display,alignItems, andjustifyContentare fixed internally and cannot be overridden.
Guidelines
- Use Center instead of Box when simple centering is needed
- For single-axis alignment only, use Stack or Inline instead