components

Tailwind CSS Stack

Stack elements positions them on top of each other in a visual manner.

Class Name
Type
Description
stackComponentStacks the child elements on top of each other.
stack-startPlacementSets stacking direction to start.
stack-endPlacementSets stacking direction to end.
stack-bottom-startPlacementSets stacking direction to bottom-start.
stack-bottom-endPlacementSets stacking direction to bottom-end.
stack-topPlacementSets stacking direction to top.
stack-top-startPlacementSets stacking direction to top-start.
stack-top-endPlacementSets stacking direction to top-end.
stack-animatedPlacementAdds animation to stack when hovered over.

The following example displays div’s without stacking.

Wrap the stacked div’s with a wrapper div using the component class stack.

Apply the modifier class stack-animated to enable animation on hover.

By default, the stacking direction is from the bottom.

Apply the modifier class stack-bottom-start to set the stack direction to bottom-start.

Apply the modifier class stack-bottom-end to set the stack direction to bottom-end.

Apply the modifier class stack-top to set the stack direction to top.

Apply the modifier class stack-top-start to set the stack direction to top-start.

Apply the modifier class stack-top-end to set the stack direction to stack-end.

Apply the modifier class stack-start to set the stack direction to start.

Apply the modifier class stack-end to set the stack direction to end.

The example below demonstrates a stack with images.

The example below demonstrates a stack with cards.

The example below demonstrates a notifications stack.