Reflex Logo

Intro

Gallery

Hosting

Components

New

Learn

Components

API Reference

Onboarding

Library

/

Layout

/

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%",
)

A center component.

Test
PropTypeDescriptionValues
as_childbool

Change the default rendered element for the one passed as a child, merging their props and behavior.

directionLiteral

How child items are layed out: "row" | "column" | "row-reverse" | "column-reverse"

alignLiteral

Alignment of children along the main axis: "start" | "center" | "end" | "baseline" | "stretch"

justifyLiteral

Alignment of children along the cross axis: "start" | "center" | "end" | "between"

wrapLiteral

Whether children should wrap when they reach the end of their container: "nowrap" | "wrap" | "wrap-reverse"

spacingLiteral

Gap between children: "0" - "9"

Event Triggers

See the full list of default event triggers
← CardCond →

Did you find this useful?

HomeGalleryChangelogIntroductionHosting