Skip to Content
DocsResourcesPricingShowcase

Center

Used to center its child within itself.

SourceStorybook
This will be centered

import { AbsoluteCenter, Center, Circle, Square } from "@chakra-ui/react"
<Center bg="tomato" h="100px" color="white">
  This is the Center
</Center>

Center can be used to create frames around icons or numbers.

1

Use the inline to change the display to inline-flex.

Visit Chakra UI

Square centers its child given the size (width and height).

Circle centers its child given the size and creates a circle around it.

AbsoluteCenter centers relative to its parent using the position: absolute strategy. Pass the axis prop to change the axis of alignment.

PropDefaultType
axis
'horizontal' | 'vertical' | 'both'

Previous

Box

Next

Container