ZUI

Search documentation

Find a page or a heading.

Center

A box that centers its children on both axes, in block or inline flow, with its element swappable through render.

tsx

Installation

bash

Usage

tsx
tsx

The centring is fixed, unlike a plain flex box: reach for flex items-center justify-center directly when the caller needs to change the alignment itself.

API reference

Center

Renders a div and takes every prop a div takes, plus:

Size, spacing and placement (h-screen, gap-2) come from className; inline picks inline flow over block flow, and render swaps the element, whose semantics are then the caller's. It sets data-slot="center".

centerVariants

The inline variant: false (the default) renders flex, true renders inline-flex.