LOKE Design System
Layout

Inline

A horizontal layout primitive that arranges children in a row with consistent, responsive gaps. Built on top of Box.

Inline

The Inline component arranges its children in a horizontal row. It extends the Box component’s capabilities, but always renders with display="inline-flex" and a horizontal flow, giving you consistent spacing with a simple API.

Use Inline for horizontal groupings (buttons, tags, meta rows) where consistent spacing and alignment matter. For vertical stacks, use Stack. For grids, use Columns.


Features

  • Horizontal flow with consistent gap
  • Responsive gap values via arrays
  • Extends Box props (e.g., margin, padding, alignItems, justifyContent, etc.)
  • Composable with other layout primitives (Stack, Columns, Box)
  • Supports wrapping if needed via flexWrap="wrap"

Usage

import { Inline } from '@loke/design-system/inline';

export default function Example() {
  return (
    <Inline gap={4}>
      <div className="border border-border bg-card p-3">Item 1</div>
      <div className="border border-border bg-card p-3">Item 2</div>
      <div className="border border-border bg-card p-3">Item 3</div>
    </Inline>
  );
}

Tips:

  • Use responsive arrays to adjust gaps across breakpoints: gap=2468
  • For wrapping content (chips/tags), add flexWrap="wrap"
  • Combine with Box padding or margin props for outer spacing

Props

Inline extends most Box props (spacing, borders, background, alignment). Its horizontal layout enforces display="inline-flex" and flexDirection="row".

Prop

Type


Examples

Default

Block 1
Block 2
Block 3
<DefaultInlineExample />

Many items

Block 1
Block 2
Block 3
Block 4
Block 5
Block 6
Block 7
Block 8
Block 9
Block 10
<Inline gap={2}>
  {Array.from({ length: 10 }).map((_, i) => (
    <div key={i} className="border border-border bg-card p-4">
      Block {i + 1}
    </div>
  ))}
</Inline>

Responsive gap

A
B
C
D
E
F
<ResponsiveGapInlineExample />

Nested inlines

A1
A2
B
C
<NestedInlinesExample />

Wrapped inline (chips/tags)

Add flexWrap="wrap" to wrap content to the next line when horizontal space is limited. Great for chips and tags.

Tag 1
Tag 2
Tag 3
Tag 4
Tag 5
Tag 6
Tag 7
Tag 8
Tag 9
Tag 10
<WrappedInlineExample />

Best practices

  • Use Inline for small, horizontal groupings (controls, tags, indicators)
  • Favor gap over manual margins to keep spacing uniform
  • Use flexWrap="wrap" for chip/tag collections that should wrap gracefully
  • Keep content blocks reasonably sized; for structured grids use Columns