Here are some examples showcasing cards.
Cards are used to display information in a structured way. They can contain images, text, and actions.
Such a beautiful beach!
Such a beautiful beach!
= daisy_card(css: "max-w-96 bg-base-100 shadow-xl") do |card|
- card.with_top_figure css: "aspect-video", src: image_path("landscapes/beach.jpg")
%p Such a beautiful beach!
- card.with_actions(css: "mt-2 justify-end") do
= daisy_button(css: "btn-primary") do
Book Travel
The images (figures) can be on the top or the bottom!
Such a beautiful place!
Such a beautiful place!
Such a beautiful place!
Such a beautiful place!
Such a beautiful place!
Such a beautiful place!
Such a beautiful place!
Such a beautiful place!
- pics = ["beach", "forest", "mountain-river", "desert"]
.mt-8.grid.grid-cols-1.gap-4.lg:grid-cols-2.xl:grid-cols-4
- pics.each.with_index do |pic, i|
= daisy_card(title: pic.titleize, css: "max-w-96 bg-base-100 shadow-xl") do |card|
- if i % 2 == 0
- card.with_top_figure css: "aspect-video", src: image_path("landscapes/#{pic}.jpg")
- else
- card.with_bottom_figure css: "aspect-video", src: image_path("landscapes/#{pic}.jpg")
%p Such a beautiful place!
- card.with_actions(css: "mt-2 justify-end") do
= daisy_button(css: "btn-primary") do
Book Travel
Cards can be rendered in different sizes. Use the card-sm
class for a
more condensed layout.
This is a large card with larger text / padding. It provides extra space for content and is great for highlighting important information.
This is a normal card with default padding. It provides ample space for content and is great for detailed information.
This is a small card with reduced padding. It's perfect for displaying information in a more condensed format.
This is a large card with larger text / padding. It provides extra space for content and is great for highlighting important information.
This is a normal card with default padding. It provides ample space for content and is great for detailed information.
This is a small card with reduced padding. It's perfect for displaying information in a more condensed format.
.mt-8.space-y-6.md:space-y-0.md:flex.md:flex-row.md:gap-6
= daisy_card(title: "Large Card", css: "max-w-96 bg-base-100 shadow-xl card-lg") do |card|
:markdown
This is a large card with larger text / padding. It provides extra space
for content and is great for highlighting important information.
- card.with_actions(css: "mt-2 justify-end") do
= daisy_button(css: "btn-primary") do
Learn More
= daisy_card(title: "Normal Card", css: "max-w-96 bg-base-100 shadow-xl") do |card|
:markdown
This is a normal card with default padding. It provides ample space for
content and is great for detailed information.
- card.with_actions(css: "mt-2 justify-end") do
= daisy_button(css: "btn-primary") do
Learn More
= daisy_card(title: "Small Card", css: "max-w-96 bg-base-100 shadow-xl card-sm") do |card|
:markdown
This is a small card with reduced padding. It's perfect for displaying
information in a more condensed format.
- card.with_actions(css: "mt-2 justify-end") do
= daisy_button(css: "btn-primary btn-sm") do
Learn More
Create virtual credit / debit cards to keep your real info safe.
Get $5 when you sign up — free to start!
Everything you need to grow your business with confidence!
CRM, Lead Generation, Project Management, Contracts, Online Payments, and more!
The ads above are affiliate links to products I regularly use and highly
recommend.
I may receive a commission if you decide to purchase.