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 { Inline } from "@neshel-ui/layout";Usage
Preview: inline-toolbar
DraftDesignDocs
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
| Prop | Type | Default | Description |
|---|---|---|---|
| align | Responsive<MainAxisAlign> | — | — |
| alignX | Responsive<MainAxisAlign> | — | — |
| alignY | Responsive<CrossAxisAlign> | — | — |
| as | LayoutElement | — | — |
| asChild | boolean | — | — |
| justify | Responsive<Justify> | — | — |
| ref | Ref<HTMLElement> | — | — |
| separator | SeparatorProp | — | — |
| space | Responsive<SpaceValue> | — | — |
| spaceX | Responsive<SpaceValue> | — | — |
| spaceY | Responsive<SpaceValue> | — | — |
| wrap | Responsive<boolean> | — | — |
Also accepts the props of: React DOM attributes.
alignXmaps tojustify-content(start center end),alignYtoalign-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 withseparator.
Common mistakes
- Forgetting
wrapfor content that can overflow on small screens. - Using
alignX="between": distribution isjustify, not an alignment value.
See also Stack separators, which work the same way on Inline.