Marigold
Getting StartedFoundationsComponentsPatternsReleases
Discover new Tutorials!

Components

Overview

Application

MarigoldProvider
RouterProvider

Layout

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

Actions

Button
Link
LinkButton
beta

Form

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

Collection

SelectList
Table
Tag

Navigation

Accordion
Breadcrumbs
Pagination
Tabs

Overlay

ContextualHelp
Dialog
Drawer
beta
Menu
Toast
beta
Tooltip

Content

Badge
Card
Divider
Headline
Icon
List
SectionMessage
SVG
Text
VisuallyHidden
XLoader

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useListData
useResponsiveValue
useTheme

Inline

Display children horizontally in a row.

The <Inline> component is a responsive layout component based on CSS Flexbox. It aligns its content horizontally in a row and automatically wraps to a new line when there isn't enough space on the screen.

Use the inline component in combination with other layout components to easily create customized layouts.

Usage

If you have more than two elements you can use the <Inline> component to arrange elements horizontally according to the space required. For adding the space between the elements you need to use the space property and set it to a supported space value.

Preview
Code

Together with a <Split> you can use the <Inline> to create as much space as given between two elements while staying in the inline layout.

Different alignment

The child elements can be positioned differently on their x and y axis. Items of various height can be vertically aligned using the alignY prop. In the following example you can see it.

Preview
Code
Top

Center

Bottom

For horizontally alignment you can use the alignX prop.

Preview
Code
Left

Center

Right

Between

Around

Evenly

Form input alignment

When aligning form inputs with buttons , use alignY={input} to mantain vertically alignment with the input field rectangle. This automatically adjusts when descriptions or error messages appear.

Preview
Code

Prevent line breaks

By default, inline elements will wrap to the next line when there isn't enough horizontal space. In some use cases, such as when using <Inline> inside a table cell, this automatic wrapping can be problematic because tables force content to break or wrap to fit within their columns. To prevent unwanted line breaks and keep all items on a single line, use the noWrap prop.

Preview
Code
VenueAddressTraitsCapacityRating
#1
Main Street Park Amphitheater
123 Main Street
Laughville
500
outdoor
lush
cozy
4.7
#2
Shakytown Comedy Club
456 Comedy Boulevard
Shakytown
300
quirky
urban
3.6
#3
Oak Ridge Barn
789 Oak Road
Hee-Haw City
150
cozy
cheap
2.3
#4
Harborfront Promenade
101 Riverside Drive
Port Funsies
600
quirky
vibey
4.2
#5
Cellar Lounge
202 Buzzington Street
Laughville
250
hype
cheap
3.1

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 Inline stories
alignX?
"left" | "center" | "right" | "between" | "around" | "evenly";
Horizontal alignment of the items inside the element.
alignY?
"center" | "input" | "top" | "bottom";
Vertical alignment of the items inside the element.
aria-describedby?
string;
Identifies the element (or elements) that describes the object.
aria-details?
string;
Identifies the element (or elements) that provide a detailed, extended description for the object.
aria-label?
string;
Defines a string value that labels the current element.
aria-labelledby?
string;
Identifies the element (or elements) that labels the current element.
aria-live?
"off" | "polite" | "assertive";
Indicates the level of importance for updates in the live region.
  • 'off': Updates are not announced unless focused.
  • 'polite': Updates are announced when the user is idle.
  • 'assertive': Updates are announced immediately, interrupting other announcements.
children?
ReactNode;
The children of the component.
id?
string;
The element's unique identifier. See MDN.
noWrap?
boolean;
Prevent the items from wrapping to the next line.
role?
"region" | (string & {});
Identifies the element a significant section of content for easier navigation. When region is used as a role, an aria-label or aria-labelledby must be provided. See MDN.
space?
GapSpaceProp;
The space between the children. You can see allowed tokens here.
Defaults to:
0

Alternative components

  • Columns: Because of the flex layout the <Inline> will wrap its content when there is no more space given to display it in smaller screen sizes, if you still want to have the items in one row, please use our columns component with the fixed column to get this layout.

  • Stack: If you need to display content vertically you should use our stack component.

Related

Building layouts
Learn how to build layouts.
Split
Adds space between two elments in a flex layout.
Last update: 24 days ago
Build with 🥵, 🧡 and
v15.4.3