Components

Inline

Horizontal layout container based on flexbox row

Overview

Inline is a horizontal layout container. display: flex and flex-direction: row are applied by default.

  • Polymorphic — Render as any HTML element via the as prop
  • Interaction States — Supports state-based styling with _hover, _active, _focus, etc.
  • Sprinkles support — All design token props available

Basic Usage

import { Inline } from '@illog/ui'
 
<Inline gap="400" align="center">
  <Icon name="clock" />
  <Text>10:30 AM</Text>
</Inline>

Alignment and Spacing

// Space between
<Inline justify="space-between" width="100%">
  <Text>Left</Text>
  <Text>Right</Text>
</Inline>
 
// Allow wrapping
<Inline gap="300" wrap="wrap">
  {tags.map(tag => <Tag key={tag.id} tag={tag} />)}
</Inline>

Interaction States

<Inline
  as="button"
  gap="300"
  p="400"
  rounded="200"
  bg="backgroundDefaultDefault"
  _hover={{ bg: 'backgroundDefaultSecondary' }}
  _active={{ bg: 'backgroundDefaultTertiary' }}
  _disabled={{ bg: 'backgroundDisabledDefault' }}
  isDisabled={disabled}
>
  <Icon name="plus" />
  <Text>Add item</Text>
</Inline>

Props

PropTypeDefaultDescription
asElementType'div'HTML element to render
gapSprinkles['gap']Gap between child elements
alignSprinkles['alignItems']Cross-axis alignment
justifySprinkles['justifyContent']Main-axis alignment
wrapSprinkles['flexWrap']'nowrap'Whether to wrap
_hoverobjectHover state styles
_activeobjectActive state styles
_focusobjectFocus state styles
_focusVisibleobjectFocus-visible state styles
_disabledobjectDisabled state styles
isActivebooleanForce active state
isDisabledbooleanForce disabled state
...sprinklesSprinklesDesign token props

Guidelines

  • Use Inline for horizontal layouts and Stack for vertical layouts
  • Inline can also be used for simple layouts without interaction states
  • Combining wrap="wrap" with gap creates an auto-wrapping layout