Wrap is a layout component used to add space between elements and wraps automatically if there isn't enough space.
Usage
Import
import { Wrap, WrapItem } from '@passfort/castle'content_copyCopy
- Wrap: Wrap composes the Box component and renders a
<ul>
tag - WrapItem: WrapItem composes the Box component and renders the HTML
<li>
tag
Example
Think of Wrap component as a flex box container with flex-wrap and spacing support. It works really well with things like dialog buttons, tags, and chips.
In the example below, you see that the last Box wrapped to the next line..
content_copyCopy
live example
Change the spacing
Pass the spacing prop to apply consistent spacing between each child, even if it wraps.
content_copyCopy
live example