Castle logo

CASTLE UI

search

Search

K
group_work

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_copy

Copy

  • 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_copy

Copy

live example

Change the spacing

Pass the spacing prop to apply consistent spacing between each child, even if it wraps.

content_copy

Copy

live example

Contents