Skip to content
Page

Spacer

Flexible gap that pushes siblings apart inside a row or column.

Project
import { Spacer } from "@pelagornis/page/components";

The preview above renders this file. Copy it into src/components/ to start from it.

src/components/SpacerExample.tsx
import { Button, Spacer, Stack, Text } from "@pelagornis/page/components";
export default function SpacerDemo() {
return (
<Stack direction="row" align="center" className="w-full">
<Text variant="subtitleMd">Project</Text>
<Spacer />
<Button variant="primary" size="sm">
New file
</Button>
</Stack>
);
}

Spacer can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.

src/content/docs/example.mdx
---
title: Example
---
import { Button, Spacer, Stack } from "@pelagornis/page/components";
<Stack direction="row">
<span>Project</span>
<Spacer />
<Button size="sm">New file</Button>
</Stack>

pageMarkdoc() registers a stack tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.

src/content/docs/example.mdoc
{% stack direction="row" %}
Project
{% spacer /%}
{% button size="sm" %}New file{% /button %}
{% /stack %}

Attributes use the same names and values as the React props.

Parts of the component and the data-refineui role each one renders.

PartRole
rootspacer