Center
Renders a flex container that centers its children both horizontally and vertically. Use inline to make it flow inline with surrounding content.
Default
Centered content
<Center style="height:120px">
<Text>Centered content</Text>
</Center>Inline
Text before inline center text after
<Text>
Text before <Center inline><span>inline center</span></Center> text after
</Text>As a different element
Rendered as <section>
<Center component="section" style="height:80px">
<Text>Rendered as <section></Text>
</Center>Props
| Prop | Type | Default | Description |
|---|---|---|---|
inline | boolean | false | Renders as inline-flex instead of flex |
component | string | 'div' | HTML element to render as the root node |
class | string | — | Additional CSS class names |
style | object | — | Inline styles |
children | ReactNode | — | Content to center |