Center

Center is a component that centers its children within itself. It is based on the flex component and therefore inherits all of its props.

Hello World!

rx.center(
    rx.text("Hello World!"),
    border_radius="15px",
    border_width="thick",
    width="50%",
)

API Reference

rx.center

A center component.

Test
PropType | ValuesDefaultInteractive
as_child
bool
direction
"row" | "column" | ...
align
"start" | "center" | ...
justify
"start" | "center" | ...
wrap
"nowrap" | "wrap" | ...
spacing
"0" | "1" | ...

Event Triggers

See the full list of default event triggers