AbsoluteCenter
Layout
Presentational
Introduction
A utility component for centering content within its parent container.
Usage
Centered Content
import { AbsoluteCenter } from "../components/ui";
export default function MyPage() {
return (
<div
style={{
position: "relative",
height: "200px",
width: "200px",
border: "1px solid black",
}}
>
<AbsoluteCenter axis="both">Centered Content</AbsoluteCenter>
</div>
);
}
CMS Page Builder
This component is available as an absoluteCenter block in the Page Builder (content/pages/*.json):
{
"type": "absoluteCenter",
"axis": "both",
"children": [
{ "type": "badge", "text": "Centered Badge", "colorPalette": "purple", "variant": "solid" }
]
}
Props
| Prop | Type | Description |
|---|---|---|
children | any | Content to be rendered inside the component. |
class | string | Custom CSS classes. |
| axis | `"horizontal" \ | "vertical" \ | "both"` | The axis to center the content on. |