Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Spacer

Separate groups of actions in a responsive app bar.

Preview

Live preview

Changes apply to this preview only.

App bar

The brand and the actions stay at opposite ends at every width.

Pimolu

docs

Card footer

A spacer pushes the secondary action away from the primary one.

Changes are saved automatically when the dialog closes.

Divider rhythm

Fixed spacers separate label groups without extra margins.

Profile
Security
Notifications

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.

Flexible

Without size, the spacer absorbs the free space in a row or a column.

Open preview

Fixed size

size uses the spacing scale and flex: 0 0 auto, so it never grows or shrinks.

Open preview

Axis

horizontal sizes the inline axis, vertical the block axis, both (default) does both.

Open preview

Usage

Use flexible space between groups and ordinary gap within related controls.

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.

PimoluSpacerProps

Type source
PimoluSpacerProps public API
NameTypeDefaultDescription
asElementType | undefined`div`Element rendered by the spacer. Defaults to `div`.
sizePimoluSpacerSpace | undefined—Fixed size. Omit it for a flexible spacer (`flex: 1 1 auto`) that absorbs the free space in a Stack or Flex.
axisPimoluSpacerAxis | undefined`both`Axis occupied by a fixed spacer. Defaults to `both`.
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 spacer. Defaults to `div`.

size

PimoluSpacerSpace | undefined

No default extracted.

Fixed size. Omit it for a flexible spacer (`flex: 1 1 auto`) that absorbs the free space in a Stack or Flex.

axis

PimoluSpacerAxis | undefined

Default: `both`

Axis occupied by a fixed spacer. Defaults to `both`.

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

  • Do not hide or push essential controls outside the viewport on small screens.
Read the accessibility guide →