Stacks provide a 3 dimensional effect to your content. This can be helpful for displaying lots of notifications or other content in a small space.
A Stack is a wrapper around other elements, making it's children appear on top of each other.
This example uses a slightly transparent background and some clever padding to show the effect.
You can also do some slick effects with a library like Anime.js!
Click to remove and see the cards underneath.
Click to remove and see the cards underneath.
%div
%p.my-4
Click to remove and see the cards underneath.
.flex.justify-center.items-center
- card_css = "border-base-300 border shadow-lg cursor-pointer text-center transition-transform"
- card_html = { onclick: "(function(el) { anime({ targets: el, duration: 400, easing: \"easeInQuad\", translateY: \"-100%\", opacity: 0, complete: function() { el.remove() } }) })(this)" }
= daisy_stack do
= daisy_card(css: card_css + " bg-primary text-white", html: card_html) do
Stack 1
= daisy_card(css: card_css + " bg-secondary text-white", html: card_html) do
Stack 2
= daisy_card(css: card_css + " bg-accent text-white", html: card_html) do
Stack 3
= daisy_card(css: card_css + " bg-neutral text-neutral-content !cursor-default") do
Can't Remove Me!