apps/www/content/docs/components/absolute-center.mdx
The AbsoluteCenter component uses the position: absolute strategy to center
its child element relative to its parent.
The parent element must have
position: relativefor proper positioning.
import { AbsoluteCenter } from "@chakra-ui/react"
<Box position="relative" h="100px">
<AbsoluteCenter>Centered Content</AbsoluteCenter>
</Box>
Control which axis to center on using the axis prop. Options are horizontal,
vertical, or both (default).
Use AbsoluteCenter with various content types like icons, badges, and status
indicators.
Perfect for creating loading overlays or modal-like content that needs to be centered over existing content.
<ExampleTabs name="absolute-center-with-overlay" />AbsoluteCenter automatically handles right-to-left (RTL) layouts by adjusting
the horizontal positioning and transforms appropriately.