Skip to Content
Neshel-UI
Layout

Inline

A horizontal flex layout for toolbars, tags and button groups, with wrapping and separators.

Purpose

Inline places children in a row: toolbars, tag lists, button groups, breadcrumbs.

Import

import.tsx
import { Inline } from "@neshel-ui/layout";

Usage

Preview: inline-toolbar
Preview theme
DraftDesignDocs
inline-toolbar.tsx
import { Badge, Button } from "@neshel-ui/components";
import { Inline } from "@neshel-ui/layout";

export default function InlineToolbar() {
  return (
    <Inline space="3" justify="between" align="center" wrap>
      <Inline space="2" wrap>
        <Badge>Draft</Badge>
        <Badge variant="outline">Design</Badge>
        <Badge variant="outline">Docs</Badge>
      </Inline>
      <Inline space="2">
        <Button size="sm" variant="ghost">
          Preview
        </Button>
        <Button size="sm">Publish</Button>
      </Inline>
    </Inline>
  );
}

API

InlineProps

InlineProps
PropTypeDefaultDescription
alignResponsive<MainAxisAlign>——
alignXResponsive<MainAxisAlign>——
alignYResponsive<CrossAxisAlign>——
asLayoutElement——
asChildboolean——
justifyResponsive<Justify>——
refRef<HTMLElement>——
separatorSeparatorProp——
spaceResponsive<SpaceValue>——
spaceXResponsive<SpaceValue>——
spaceYResponsive<SpaceValue>——
wrapResponsive<boolean>——

Also accepts the props of: React DOM attributes.

  • alignX maps to justify-content (start center end), alignY to align-items (start center end stretch baseline).
  • justify="between" spreads groups to the edges.
  • wrap (responsive) lets items wrap onto new lines; it cannot be combined with separator.

Common mistakes

  • Forgetting wrap for content that can overflow on small screens.
  • Using alignX="between": distribution is justify, not an alignment value.

See also Stack separators, which work the same way on Inline.

Edit on GitHub

On this page