Skip to content

Layout

The Layout component provides a set of flexible layout primitives for building consistent UI layouts. It includes Flex, Grid, Horizontal, and Vertical components with a clean, type-safe API.

Flex

The Flex component is a versatile layout container that allows you to arrange items in a row or column with various alignment and spacing options.

Basic flex (row direction)

Flex with column direction

Flex with alignment and justification

Flex with gap

Flex with wrap

Flex with custom element

Grid

The Grid component provides a powerful way to create grid layouts with precise control over columns, rows, and spacing.

Basic grid with equal columns

Grid with different column sizes

Grid with defined rows

Grid with numeric columns

Grid with numeric rows and columns

Grid with alignment and justification

Horizontal

The Horizontal component is a convenient wrapper around Flex that’s pre-configured for row layouts with consistent spacing options.

Horizontal with alignment

Vertical

The Vertical component is a convenient wrapper around Flex that’s pre-configured for column layouts with consistent spacing options.

Vertical with alignment

Two-column layout

Installation

import { Layout } from '@harnessio/ui/components'
// ...
return (
<Layout.Flex gap="md">
{/* children */}
</Layout.Flex>
)