Card Title
Card content goes here.
UI component documentation for card
# Card Component
A flexible content container component with header, body, and footer sections. Supports various layouts, interactive states, and rich content including images, tags, and action buttons.
The Card component is a versatile container designed to display structured content in a visually appealing way. It supports multiple variants including image cards, horizontal layouts, interactive cards, and minimal designs. Built with accessibility and responsive design in mind.
| Property | Type | Description | Default | ||||
|---|---|---|---|---|---|---|---|
variant | default \ | image \ | horizontal \ | interactive \ | minimal | Card layout variant | default |
title | string | Card title text | Required | ||||
text | string | Card body content | - | ||||
image | string | Image URL | - | ||||
tags | string[] | Array of tag labels | [] | ||||
interactive | boolean | Enable click interactions | false | ||||
expandable | boolean | Enable expand/collapse | false |
Card Title
Card content goes here.

Featured Content
// Listen for card clicks
document.addEventListener('card:click', (e) => {
console.log('Card clicked:', e.detail.card);
});// Filter cards by tag
document.dispatchEvent(new CustomEvent('card:filter', {
detail: { tag: 'javascript' }
}));
const newCard = cardComponent.createCard({
title: 'Dynamic Card',
text: 'Created programmatically',
tags: ['new', 'featured'],
image: 'https://example.com/image.jpg'
});
document.querySelector('.card-showcase').appendChild(newCard);
{{code:card.html}}
{{code:card.css}}
{{code:card.js}}
{{demo:card}}
| Event | Description | Detail |
|---|---|---|
card:click | Fired when interactive card is clicked | { card: HTMLElement } |
card:action | Fired when action button is clicked | { card, action, button } |
card:edited | Fired after inline editing | { card, title, text } |
card:filter | Filter cards by tag/category | { tag, category } |
card:sort | Sort cards | { sortBy } |
element with proper heading hierarchy/ Customize card appearance /
--card-bg: white;
--card-border: #e5e7eb;
--card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
--card-radius: 0.75rem;
--card-padding: 1.25rem;
1. Always include meaningful titles and alt text for images
2. Use semantic HTML structure (article, header, footer)
3. Provide keyboard navigation for interactive cards
4. Ensure sufficient color contrast for text
5. Use lazy loading for images in long lists
6. Keep card content concise and scannable
7. Group related actions in the card footer