Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Center

An empty-state composition centered within a surface.

Preview

Live preview

Changes apply to this preview only.

+

No projects yet

Create the first project to start collecting feedback.

Sign-in panel

Centering also works with a full-height section in a page layout.

Welcome backThe panel is centered inside a muted stage; the action stays full width.

Stats row

Inline centers keep icon and label on the same baseline.

12
projects
4.2k
followers
128
reviews

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Both axes

The box stretches to the available width; minHeight gives the centering something to work with.

Open preview

Inline

inline renders an inline-flex box that shrinks to its content and can sit in a line of text.

Open preview

Minimum height

Numbers are pixels; CSS lengths such as 40vh pass through.

Open preview

Usage

Provide enough height for the task and let content expand instead of forcing fixed dimensions.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluCenterProps

Type source
PimoluCenterProps public API
NameTypeDefaultDescription
asElementType | undefined`div`Element rendered by the center box. Defaults to `div`.
inlineboolean | undefinedfalseCenters as `inline-flex` instead of `flex`, so the box shrinks to its content and can sit in a line of text.
minHeightPimoluCenterMinHeight | undefined—Minimum block size. Numbers are pixels.
fullWidthboolean | undefinedfalseFill the available inline size.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
as

ElementType | undefined

Default: `div`

Element rendered by the center box. Defaults to `div`.

inline

boolean | undefined

Default: false

Centers as `inline-flex` instead of `flex`, so the box shrinks to its content and can sit in a line of text.

minHeight

PimoluCenterMinHeight | undefined

No default extracted.

Minimum block size. Numbers are pixels.

fullWidth

boolean | undefined

Default: false

Fill the available inline size.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Keep the semantic reading order intact and avoid clipping at text zoom.
Read the accessibility guide →