WlCard

Card with header, title, subtitle, default and footer slots.
Components / Containers v0.1.0

Change props to see the result: the example and code use the same settings. “Reset” restores the initial values.

Settings

Highlight on hover.

Props pt, as, href, to, variant, padding, models, handlers and slots can be edited in the SFC. See their descriptions in API.

Example

Team guide
Updated October 1

Team structure, roles and agreements.

Set padding to none, sm (8 px), md (12 px) or lg (16 px). Each section uses one inset; the caption has no bottom inset. Omit the prop to keep the theme defaults.

padding="none"
Team structure, roles and agreements.
padding="sm"
Team structure, roles and agreements.
padding="md"
Team structure, roles and agreements.
padding="lg"
Team structure, roles and agreements.
This nested card keeps its own padding.
Focus: outside the example · pointer: outside the example

Explore the live example and copy its Vue SFC into your application. Settings on the left can be combined.

Code for your application

Vue SFC · current settings
<script setup lang="ts">
import { WlButton, WlCard } from "legato-ui";
import { ref } from "vue";
const saved = ref(false);
</script>

<template>
  <div class="wl-stack" data-space="md">
    <WlCard >
      <template #title>{{ "Team guide" }}</template>
      <template #subtitle>{{ "Updated October 1" }}</template>
      <p class="wl-text-body">{{ "Team structure, roles and agreements." }}</p>
      <template #footer>
        <WlButton size="sm" @click="saved = !saved">{{ saved ? "Saved" : "Save" }}</WlButton>
      </template>
    </WlCard>
    <p class="wl-text-small">{{ "Set padding to none, sm (8 px), md (12 px) or lg (16 px). Each section uses one inset; the caption has no bottom inset. Omit the prop to keep the theme defaults." }}</p>
    <WlCard
      v-for="padding in (['none', 'sm', 'md', 'lg'] as const)"
      :key="padding"
      :padding="padding"
      :data-padding-example="padding"
    >
      <template #title>padding="{{ padding }}"</template>
      {{ "Team structure, roles and agreements." }}
      <template #footer>{{ "Updated October 1" }}</template>
      <WlCard v-if="padding === 'lg'" padding="none" data-padding-example="nested">
        {{ "This nested card keeps its own padding." }}
      </WlCard>
    </WlCard>
  </div>
</template>

Regular and hoverable cards

Header, title/subtitle, content and footer in a responsive grid; separate accessible actions.

Sprint 24

Teamwork · 8 tasks

Three tasks in review, demo on Friday.

Team material

Product note

Next release plan

Hoverable changes the hover appearance. A separate button performs the action.

Choose a card action.

Vue SFC · additional example
<script setup lang="ts">
import { WlButton, WlCard, WlTag } from "legato-ui";
import { ref } from "vue";
const opened = ref("");
</script>

<template>
  <div class="wl-stack" data-space="lg">
    <div class="showcase-cards">
      <WlCard aria-labelledby="showcase-card-sprint">
        <template #title>
          <h3 id="showcase-card-sprint" class="wl-text-subheading">{{ "Sprint 24" }}</h3>
        </template>
        <template #subtitle>{{ "Teamwork · 8 tasks" }}</template>
        <p class="wl-text-body">{{ "Three tasks in review, demo on Friday." }}</p>
        <template #footer>
          <WlButton size="sm" variant="soft" @click="opened = 'Sprint 24'">
            {{ "Open board" }}
          </WlButton>
          <span class="wl-text-small wl-text-muted">{{ "Updated today" }}</span>
        </template>
      </WlCard>
      <WlCard hoverable aria-labelledby="showcase-card-note">
        <template #header>
          <div class="showcase-card-banner"><WlTag color="blue">{{ "Team material" }}</WlTag></div>
        </template>
        <template #title>
          <h3 id="showcase-card-note" class="wl-text-subheading">{{ "Product note" }}</h3>
        </template>
        <template #subtitle>{{ "Next release plan" }}</template>
        <p class="wl-text-body">{{ "Hoverable changes the hover appearance. A separate button performs the action." }}</p>
        <template #footer>
          <WlButton size="sm" @click="opened = 'Product note'">{{ "Read note" }}</WlButton>
          <WlTag color="green">{{ "New" }}</WlTag>
        </template>
      </WlCard>
    </div>
    <p class="wl-text-small" role="status">{{ opened ? "Opened: " + opened : "Choose a card action." }}</p>
  </div>
</template>

<style scoped>
.showcase-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--wl-space-lg); }
.showcase-card-banner { padding: var(--wl-space-lg); background: var(--wl-accent-soft); }
</style>