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-bottom-startModifierSets stacking direction to bottom-start.
stack-bottom-endModifierSets stacking direction to bottom-end.
stack-topModifierSets stacking direction to top.
stack-top-startModifierSets stacking direction to top-start.
stack-top-endModifierSets stacking direction to top-end.
stack-animatedModifierAdds 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 top-end.

The example below demonstrates a stack with images.

The example below demonstrates a stack with cards.

The example below demonstrates a notifications stack.