Stack

Stack is a container-type utility which abstracts layout implementation for its children components.

  • direction refers to the stacking of children in either horizontal or vertical orientation.
  • gap refers to the space between children components.
  • sm, md, lg, xl are responsive properties which can be used to supply custom direction & gap for respective breakpoints.

Responsive Stack

Examples

Basic Usage

Item 1
Item 2
Item 3
  • Reduce viewport size below md to see the stack direction change.
  • Responsive Stack can be achieved using breakpoints in props of Stack.
  • Provide direction & gap for every breakpoint you want to use.

Overlap stack items using negative gap

Item 1
Item 2

Vertical Stack with gap

Custom height vertical stack

Item 1
Item 2
Item 3

Custom height vertical stack (shrink)

Item 1
Item 2
Item 3
  • shrink attribute on stack makes container take height of its items in vertical stack.

Vertical Stack (custom item shrink)

Shrink Item 1
Item 2
Item 3
  • You can wrap any child with StackItem to provide custom shrink property to specific item.

Align Items Vertical Stack

Item 1
Item 2
Item 3
  • You can use className to provide align property to container to align all items

Align Vertical Stack (custom items)

Item 1
Item 2
Item 3
  • You can wrap any child with StackItem & provide custom alignment using className on it.

Horizontal Stack with gap

Custom width horizontal stack

Item 1
Item 2
Item 3

Custom width horizontal stack (shrink)

Item 1
Item 2
Item 3
  • shrink attribute on stack makes container take width of its items in horizontal stack.

Horizontal Stack (custom item shrink)

Item 1
Item 2
Item 3
  • You can wrap any child with StackItem to provide custom shrink property to specific item.

Align Items Horizontal Stack

Item 1
Item 2
Item 3
  • You can use className to provide align property to container to align all items

Align Horizontal Stack (custom items)

Item 1
Item 2
Item 3
  • You can wrap any child with StackItem & provide custom alignment using className on it.

Basic form setup

Upload