DocsBlog
  • 1.0.0

  • light

    dark

    system

    Switch mode
  • Cerberus

    Acheron

    Elysium

Get Started
Components
Data Grid
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridGroupNewLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPaginationNewPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFrameHighlightJSON Tree ViewLocaleLocal StoragePortalPresenceShowsplitPropsTheme

Wrap

Used to add space between elements and wraps automatically if there isn't enough space.

  • Panda
import { Wrap, WrapItem } from "styled-system/jsx"

Usage

By default, Wrap applies display: flex, flex-wrap: wrap, and gap: 8px to its children.

Gap or Spacing

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

Alignment

Pass the align prop to change the alignment of the child along the cross axis.

Justify

Pass the justify prop to change the alignment of the child along the main axis.

Row and Column Gap

Pass the rowGap and columnGap props to apply a consistent spacing between the rows and columns.

Props

PropTypeDescription
rowGapnumber | stringGap between rows
columnGapnumber | stringGap between columns
justifyCSSProperties['justify-content']Justify content
gapnumber | stringGap between children

On this page

  • Edit this page on Github
Cerberus Design System | Docs
Copy
import { DecorativeBox } from '@/app/components/decorative-box'
import { Wrap } from 'styled-system/jsx'

export function BasicDemo() {
  return (
    <Wrap w="3/4">
      <DecorativeBox h="20" />
      <DecorativeBox h="20" w="calc(50% - 4px)" />
      <DecorativeBox h="20" w="calc(50% - 4px)" />
    </Wrap>
  )
}
Copy
Box 1
Box 2
Box 3
Box 4
Box 5
Copy
Copy
Box 1
Box 2
Box 3
Box 4
Box 5
Copy
import { DecorativeBox } from '@/app/components/decorative-box'
import { Wrap } from 'styled-system/jsx'

export function RowColDemo() {
  return (
    <Wrap rowGap="md" columnGap="xl" w="1/2">
      {Array.from({ length: 10 }).map((_, index) => (
        <DecorativeBox key={index} h="12" w="12" />
      ))}
    </Wrap>
  )
}
import { DecorativeBox } from '@/app/components/decorative-box'
import { Wrap } from 'styled-system/jsx'

export function AlignDemo() {
  return (
    <Wrap align="center" gap="md" w="3/4">
      {Array.from({ length: 5 }).map((_, index) => (
        <DecorativeBox key={index} h="80px" w="180px">
          Box {index + 1}
        </DecorativeBox>
      ))}
    </Wrap>
  )
}
import { DecorativeBox } from '@/app/components/decorative-box'
import { Wrap } from 'styled-system/jsx'

export function GapDemo() {
  return (
    <Wrap gap="5" w="3/4">
      {Array.from({ length: 12 }).map((_, index) => (
        <DecorativeBox key={index} h="12" w="12" />
      ))}
    </Wrap>
  )
}
import { DecorativeBox } from '@/app/components/decorative-box'
import { Wrap } from 'styled-system/jsx'

export function JustifyDemo() {
  return (
    <Wrap justify="center" gap="md" w="3/4">
      {Array.from({ length: 5 }).map((_, index) => (
        <DecorativeBox key={index} h="80px" w="180px">
          Box {index + 1}
        </DecorativeBox>
      ))}
    </Wrap>
  )
}