Stack#

Stack visually puts elements on top of each other, like stacked papers or cards.

Import#

TSX
import { Stack } from '@sigx/daisyui';

Basic Usage#

Use w-* and h-* classes on the Stack to set the size of all stacked items.

TSX
Loading preview...

Stacked Images#

TSX
Loading preview...

Stacked Cards#

TSX
Loading preview...

Directions#

Use the direction prop to control the alignment of stacked elements.

Top Direction#

TSX
Loading preview...

Start Direction#

TSX
Loading preview...

End Direction#

TSX
Loading preview...

With Shadows#

Add shadows to create depth in the stack.

TSX
Loading preview...

Notification Cards#

A practical example showing notification cards in a stack.

TSX
Loading preview...

Props#

PropTypeDefaultDescription
direction'top' | 'bottom' | 'start' | 'end''bottom'Alignment direction of the stacked elements
classstring-Additional CSS classes. Use w-* and h-* to set stack size

CSS Classes#

The Stack component uses DaisyUI's stack CSS class under the hood:

ClassDescription
stackMain component class - puts children on top of each other
stack-topAligns children to the top
stack-bottomAligns children to the bottom (default)
stack-startAligns children to the start (horizontally)
stack-endAligns children to the end (horizontally)