Marigold
Marigold

Application

MarigoldProvider
RouterProvider

Layout

AppLayoutbeta
Aside
Aspect
Breakout
Center
Columns
Container
Grid
Inline
Inset
Scrollable
Split
Stack
Tiles

Actions

ActionBaralpha
Button
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
FileField
Form
Multiselectdeprecated
NumberField
Radio
SearchField
Select
Slider
Switch
TagFieldbeta
TextArea
TextField
TimeField

Collection

SelectList
Table
Tag

Navigation

Accordion
Breadcrumbsupdated
Pagination
Sidebarbeta
Tabsupdated
TopNavigationbeta

Overlay

ContextualHelp
Dialog
Drawer
Menu
Toastbeta
Tooltip

Content

Badge
Card
Divider
EmptyStatebeta
Headline
Icon
List
Loader
SectionMessage
SVG
Text

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useListData
useResponsiveValue
useTheme
VisuallyHidden
Components

Inset

Adds space around its children.

The <Inset> component is a layout component that acts as a container which adds spacing around its children.

Usage

The component should be used whenever you need to add some whitespace around elements. For example, around a <Form> or inside a <Card>.

Equal spacing

In order to add equal spacing to all sides use the space property like shown below. You can see that the rectangle has a distance of 2rem to the parent div.

import { Inset } from '@marigold/components';import { Rectangle } from '@/ui/Rectangle';export default () => (  <div className="bg-bg-surface-sunken">    <Inset space={8}>      <Rectangle height="80px" />    </Inset>  </div>);

Horizontal and vertical spacing

A common use case is to give children of a content component some space, you can do this for example with wrapping an <Inset> around the card content like shown below.

To set only horizontal or vertical spacing, or to define different values for each, use the spaceX property for horizontal spacing and the spaceY property for vertical spacing.

Main Street Park Amphitheater

Laughville | Outdoor Venue
An open-air amphitheater in the town park with lawn seating and a covered stage, ideal for community performances and summer comedy nights.
import { venueTypes, venues } from '@/lib/data/venues';import { Card, Headline, Inline, Inset, Text } from '@marigold/components';export default () => {  return (    <Card>      <Inset spaceX={4} spaceY={8}>        <Headline level={3}>{venues[0].name}</Headline>        <Inline>          <Text fontStyle="italic">            {venues[0].city} | {venueTypes[venues[0].type]}          </Text>        </Inline>        <Text>{venues[0].description}</Text>      </Inset>    </Card>  );};

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 Inset stories

Inset

Prop

Type

Related

Building layouts

Learn how to build layouts.
Last update: a month ago

Inline

Display children horizontally in a row.

Scrollable

Lets the content scroll.

On this page

UsageEqual spacingHorizontal and vertical spacingPropsInsetRelated