Velocity X Components

Bento & Layout

Centred Container

Reliable two-axis centring primitive with a flex or grid method and explicit known-height or min-height sizing.

Free MIT licensed. Install it with the CLI — no account, no key.
bash
$ velocityx add center-box

Built for astro.

Full docs for Centred Container →

astro v1.0.0
Centred Container

method="flex" · knownHeight="220px"

method="grid" · minHeight="220px" (content can grow)

Props

NameTypeRequiredDefaultDescription
as'div' | 'section'No'div'
method'flex' | 'grid'No'flex'
knownHeightstringNo
minHeightstringNo
classNamestringNo''

File this creates

The CLI writes this path into your project, relative to its root — nothing else moves.

text
components/velocity/center-box/CenterBox.astro

Using the Centred Container component

Install it with velocityx add center-box. The CLI writes the source straight into your project — no runtime dependency, no registry lock-in, and it themes itself from the same primary-*/accent-* scale as the rest of the library.

More from Bento & Layout.