Web Awesome (ViUR)

Font Awesome
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Search this website ⌘KCtrl+K Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme View Project on GitHub Star Project on GitHub
Start Components Docs Help
Web Awesome Font Awesome Build Awesome
Search this site… /
Try SSR Server-side rendering (SSR) generates component HTML on the server before the page loads, improving SEO and initial load time. Use the switch to see Web Awesome components render with and without SSR.
Light Dark System Docs Select Color Scheme Default Awesome Shoelace Active Brutalist Glossy Matter Mellow Playful Premium Tailspin Docs Select Theme

Getting Started

  • Installation
  • Usage
  • Forms
  • Localization
  • Frameworks
  • Using with AI
  • Figma Design Kit ProThis requires access to Web Awesome Pro
  • Server Rendering

Resources

  • Accessibility
  • Browser Support
  • Contributing
  • Patterns ProPatterns require access to Web Awesome Pro
  • Migrating from Shoelace
  • Visual Tests
  • Changelog
  • Help & Support

Theming & Utilities

  • Overview
  • Built-in Themes
  • Color Palettes
  • Design Tokens
  • Customizing & Theming
  • CSS Utilities

ViUR Components

  • Alert
  • Combobox
  • Pagination
  • Table Wrapper

Actions

  • Button
  • Button Group
  • Copy Button
  • Dropdown
    • Dropdown Item

Forms

  • Checkbox
  • Checkbox Group
  • Color Picker
  • Input
  • Known Date
  • Number Input
  • Radio Group
    • Radio
  • Rating
  • Select
    • Option
  • Slider
  • Switch
  • Textarea
  • Time Input
  • Data Grid Planned A Web Awesome Kickstarter stretch goal!

Layout

  • Accordion
    • Accordion Item
  • Card
  • Details
  • Dialog
  • Divider
  • Drawer
  • Page
  • Scroller
  • Split Panel

Navigation

  • Breadcrumb
    • Breadcrumb Item
  • Tab Group
    • Tab
    • Tab Panel
  • Tree
    • Tree Item

Feedback

  • Badge
  • Callout
  • Progress Bar
  • Progress Ring
  • Skeleton
  • Spinner
  • Tag
  • Tooltip

Media

  • Animated Image
  • Avatar
  • Carousel
    • Carousel Item
  • Comparison
  • Icon
  • Markdown
  • QR Code
  • Zoomable Frame

Data Viz

  • Advanced Usage

Helpers

  • Animation
  • Format Bytes
  • Format Date
  • Format Number
  • Include
  • Intersection Observer
  • Mutation Observer
  • Popover
  • Popup
  • Random Content
  • Relative Time
  • Resize Observer

Card

  • Examples
  • Basic Card
  • Card with Header
  • Card with Footer
  • Media
  • Appearance
  • Orientation
  • Importing
  • Slots
  • Attributes & Properties
  • CSS Custom Properties
  • CSS Parts
  • SSR
On This Page...
  • Examples
  • Basic Card
  • Card with Header
  • Card with Footer
  • Media
  • Appearance
  • Orientation
  • Importing
  • Slots
  • Attributes & Properties
  • CSS Custom Properties
  • CSS Parts
  • SSR

Card

<wa-card>
Stable Layout Since 2.0

Cards group related content and actions inside a bordered container. Use them to present products, articles, user profiles, or any self-contained unit of information.

A kitten sits patiently between a terracotta pot and decorative grasses. Mittens
This kitten is as cute as he is playful. Bring him home today!
6 weeks old More Info
<wa-card class="card-overview">
  <img
    slot="media"
    src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
    alt="A kitten sits patiently between a terracotta pot and decorative grasses."
  />

  <strong>Mittens</strong><br />
  This kitten is as cute as he is playful. Bring him home today!<br />
  <small class="wa-caption-s">6 weeks old</small>

  <wa-button slot="footer" variant="brand" pill>More Info</wa-button>
  <wa-rating slot="footer-actions" label="Rating"></wa-rating>
</wa-card>

<style>
  .card-overview {
    width: 300px;
  }
</style>

Examples

Link to This Section

Basic Card

Link to This Section

Basic cards aren't very exciting, but they can display any content you want them to.

This is just a basic card. No media, no header, and no footer. Just your content.
<wa-card class="card-basic">
  This is just a basic card. No media, no header, and no footer. Just your content.
</wa-card>

<style>
  .card-basic {
    max-width: 300px;
  }
</style>

Card with Header

Link to This Section

Headers can be used to display titles and more. If using SSR, you need to also use the with-header attribute to add a header to the card (if not, it is added automatically).

Header Title

This card has a header. You can put all sorts of things in it!
<wa-card class="card-header">
  <h3 slot="header">Header Title</h3>
  This card has a header. You can put all sorts of things in it!
  <wa-button appearance="plain" slot="header-actions">
    <wa-icon name="gear" variant="solid" label="Settings"></wa-icon>
  </wa-button>
</wa-card>

<style>
  .card-header {
    max-width: 300px;
  }

  .card-header h3 {
    margin: 0;
  }
</style>

Card with Footer

Link to This Section

Footers can be used to display actions, summaries, or other relevant content. If using SSR, you need to also use the with-footer attribute to add a footer to the card (if not, it is added automatically).

This card has a footer. You can put all sorts of things in it! Preview
<wa-card class="card-footer">
  This card has a footer. You can put all sorts of things in it!

  <wa-rating slot="footer"></wa-rating>

  <wa-button slot="footer-actions" variant="brand">Preview</wa-button>
</wa-card>

<style>
  .card-footer {
    max-width: 300px;
  }
</style>

Media

Link to This Section

Card media is displayed atop the card and will stretch to fit. If using SSR, you need to also use the with-media attribute to add a media section to the card (if not, it is added automatically).

A kitten walks towards camera on top of pallet.
This card has an image of a kitten walking along a pallet.

Your browser doesn't support HTML video

This card has a video of a dog wearing shades.
<div class="wa-grid">
  <wa-card class="card-media">
    <div slot="media" class="wa-frame:landscape">
      <img
        src="https://images.unsplash.com/photo-1547191783-94d5f8f6d8b1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=400&q=80"
        alt="A kitten walks towards camera on top of pallet."
      />
    </div>
    This card has an image of a kitten walking along a pallet.
  </wa-card>
  <wa-card class="card-media">
    <video slot="media" controls>
      <source src="https://uploads.webawesome.com/dog-with-glasses.mp4" />
      <p>Your browser doesn't support HTML video</p>
    </video>
    This card has a video of a dog wearing shades.
  </wa-card>
</div>

<style>
  .card-media {
    max-width: 300px;
  }
</style>

Appearance

Link to This Section

Use the appearance attribute to change the card's visual appearance.

A kitten sits patiently between a terracotta pot and decorative grasses. Outlined (default) A kitten sits patiently between a terracotta pot and decorative grasses. Filled-outlined A kitten sits patiently between a terracotta pot and decorative grasses. Plain A kitten sits patiently between a terracotta pot and decorative grasses. Filled A kitten sits patiently between a terracotta pot and decorative grasses. Accent
<div class="wa-grid">
  <wa-card>
    <img
      slot="media"
      src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
      alt="A kitten sits patiently between a terracotta pot and decorative grasses."
    />
    Outlined (default)
  </wa-card>
  <wa-card appearance="filled-outlined">
    <img
      slot="media"
      src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
      alt="A kitten sits patiently between a terracotta pot and decorative grasses."
    />
    Filled-outlined
  </wa-card><wa-card appearance="plain">
    <img
      slot="media"
      src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
      alt="A kitten sits patiently between a terracotta pot and decorative grasses."
    />
    Plain
  </wa-card><wa-card appearance="filled">
    <img
      slot="media"
      src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
      alt="A kitten sits patiently between a terracotta pot and decorative grasses."
    />
    Filled
  </wa-card><wa-card appearance="accent">
    <img
      slot="media"
      src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
      alt="A kitten sits patiently between a terracotta pot and decorative grasses."
    />
    Accent
  </wa-card>
</div>

Orientation

Link to This Section

Set the orientation attribute to horizontal to create a card with a horizontal, side-by-side layout. Make sure to set a width or maximum width for the media slot. Horizontal cards do not currently contain the header and footer slots.

The actions slot is only available for the horizontal orientation

A kitten sits patiently between a terracotta pot and decorative grasses. This card has a horizontal orientation with media, body, and actions arranged side-by-side.
<div class="wa-grid">
  <wa-card orientation="horizontal" class="horizontal-card">
    <img
      slot="media"
      src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
      alt="A kitten sits patiently between a terracotta pot and decorative grasses."
    />
    This card has a horizontal orientation with media, body, and actions arranged side-by-side.
    <wa-button slot="actions" variant="neutral" appearance="plain"
      ><wa-icon name="ellipsis" label="actions"></wa-icon
    ></wa-button>
  </wa-card>
</div>

<style>
  .horizontal-card {
    img[slot='media'] {
      max-width: 300px;
    }
  }
</style>

Importing

Link to This Section

If you're using the autoloader or a hosted project, components load on demand — no manual import needed. To cherry-pick a component manually, use one of the following snippets.

CDN npm Self-Hosted React

Import this component directly from the CDN:

import 'https://ka-f.webawesome.com/webawesome@0.17.0/components/card/card.js';

After installing Web Awesome via npm, import this component:

import '@awesome.me/webawesome/dist/components/card/card.js';

If you're self-hosting Web Awesome, import this component from your server:

import './webawesome/dist/components/card/card.js';

To import this component for React 18 or below, use the following code:

import WaCard from '@awesome.me/webawesome/dist/react/card/index.js';

Slots

Link to This Section

Learn more about using slots.

Name Description
(default) The card's main content.
actions An optional actions section to render at the end for the horizontal card.
footer An optional footer for the card.
footer-actions An optional actions section to render in the footer of the vertical card.
header An optional header for the card.
header-actions An optional actions section to render in the header of the vertical card.
media An optional media section to render at the start of the card.

Attributes & Properties

Link to This Section

Learn more about attributes and properties.

Name Description Reflects
appearance
appearance
The card's visual appearance.
Type 'accent' | 'filled' | 'outlined' | 'filled-outlined' | 'plain'
Default 'outlined'
orientation
orientation
Renders the card's orientation *
Type 'horizontal' | 'vertical'
Default 'vertical'
withFooter
with-footer
Only required for SSR. Set to true if you're slotting in a footer element so the server-rendered markup includes the footer before the component hydrates on the client.
Type boolean
Default false
withFooterActions
with-footer-actions
Only required for SSR. Set to true if you're slotting in a footer-actions element so the server-rendered markup includes the media before the component hydrates on the client.
Type boolean
Default false
withHeader
with-header
Only required for SSR. Set to true if you're slotting in a header element so the server-rendered markup includes the header before the component hydrates on the client.
Type boolean
Default false
withHeaderActions
with-header-actions
Only required for SSR. Set to true if you're slotting in a header-actions element so the server-rendered markup includes the media before the component hydrates on the client.
Type boolean
Default false
withMedia
with-media
Only required for SSR. Set to true if you're slotting in a media element so the server-rendered markup includes the media before the component hydrates on the client.
Type boolean
Default false

CSS Custom Properties

Link to This Section

Learn more about CSS custom properties.

Name Description
--spacing
The amount of space around and between sections of the card. Expects a single value.
Default var(--wa-space-l)

CSS Parts

Link to This Section

Learn more about CSS parts.

Name Description CSS selector
body The container that wraps the card's main content. ::part(body)
footer The container that wraps the card's footer. ::part(footer)
header The container that wraps the card's header. ::part(header)
media The container that wraps the card's media. ::part(media)

SSR

Link to This Section

Learn more about Server-Side Rendering (SSR).

If you use the header, media, or footer slots, set the matching with-header, with-media, or with-footer attribute — otherwise only the card's body will render during SSR. This works around the lack of a :has-slotted CSS pseudo-class, which would normally let us style borders based on slotted content.

Need a hand? Report a bug Ask for help
Go Make Something Awesome
Version 0.17.0 © Fonticons, Inc.
  • Terms
  • Privacy
  • Refunds
  • Core License
  • Pro License

Quick Links

  • Components
  • CSS Utilities
  • Theming
  • Using with AI
  • Changelog
  • Help & Support

Recent Searches

    D'oh! No results for “”

    Suggest on GitHub Ask on Discord
    Navigate Select
    Close Esc