Marigold
v18.0.0-beta.4
Marigold
v18.0.0-beta.4

Application

MarigoldProvider
RouterProvider

Layout

AppShellbeta
Aside
Aspect
Center
Columns
Container
Grid
Inline
Inset
Pagebeta
Panelbeta
Scrollable
Split
Stack
Tiles

Actions

Buttonupdated
ButtonGroupbeta
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
DateRangePickerbeta
FileField
Form
NumberField
Radio
RangeCalendaralpha
SearchField
SegmentedControlbeta
Select
SelectListupdated
Slider
Switchupdated
TagFieldbeta
TextArea
TextField
TimeField

Collection

Cardupdated
Table
Tag
ActionBaralpha

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Tabs
TopNavigationbeta

Overlay

ActionMenualpha
ContextualHelp
Dialog
Drawer
Menuupdated
Toastbeta
Tooltip

Content

Badge
Descriptionalpha
Divider
EmptyStatebeta
ErrorStatebeta
Headline
Keyboardbeta
List
Loader
SectionMessage
SVG
Text
TextValuealpha
Titlealpha

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useLandmark
useListData
useTheme
VisuallyHidden
Components

Center

Component to center its children horizontally.

The <Center> is a layout component that centers its children horizontally within a container.

Usage

You can use it to center a single child or a list of children. The maxWidth prop sets the maximum width of the container and the space prop adds spacing between the children elements.

The <Center> component can also be used with components like <Text>, <Stack> or <Inline> component.

import { Center } from '@marigold/components';import { Rectangle } from '@/ui/Rectangle';export default () => (  <Center maxWidth="xxlarge" space={1}>    <Rectangle height="50px" width="300px" />    <Rectangle height="50px" width="300px" />    <Rectangle height="50px" width="300px" />  </Center>);

Props

Did you know? You can explore, test, and customize props live in Marigold's storybook. Watch the effects they have in real-time!
View Center stories

Center

Prop

Type

Accessibility props (6)

Prop

Type

Related

Building layouts

Learn how to build layouts.
Last update: 4 months ago

Aspect

Keep media elements at a certain apsect ratio.

Columns

Position content in one row.

On this page

UsagePropsCenterRelated