Components
Card
A neutral surface container with optional header, body, and footer regions.
Install with the CLI
npx @vyui/cli add cardOverview
VyCard is a rounded, clipped surface with three optional regions — header, default body, and footer. Each region renders only when its slot is provided. Cards use neutral surfaces; the variant prop selects the fill and border treatment.
Usage
<script setup lang="ts">
import { VyCard } from '@vyui/kit'
</script>
<template>
<VyCard>
<template #header>
<text>Title</text>
</template>
<text>Body content goes here.</text>
<template #footer>
<text>Footer</text>
</template>
</VyCard>
</template>
Variants
<VyCard variant="outline"><text>Outline</text></VyCard>
<VyCard variant="soft"><text>Soft</text></VyCard>
<VyCard variant="subtle"><text>Subtle</text></VyCard>
<VyCard variant="solid"><text>Solid</text></VyCard>
Features and behavior
- Each region (
header, default,footer) renders only when its slot is present. - The root clips overflow and rounds its corners; content padding lives on each region slot.
solidpaints a darkrootfill and sets a white foreground on the region slots — Lynx does not cascade text color into deeply-nested<text>, so plain-text children of a solid card should set their own color or passui.{header,body,footer}.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'solid' | 'outline' | 'soft' | 'subtle' | 'outline' | Surface fill and border treatment. |
class | any | undefined | Classes merged onto the root. |
ui | Partial<Record<CardSlot, any>> | undefined | Per-instance theme slot overrides. |
Card uses neutral surfaces only and does not expose a semantic color; override colors through appConfig.ui.card or the ui prop.
Emits
This component does not emit events.
Slots
| Slot | Props | Description |
|---|---|---|
header | — | Top region; rendered only when provided. |
default | — | Body region. |
footer | — | Bottom region; rendered only when provided. |
Styling and theming
Override globally through appConfig.ui.card or locally with ui.
| UI slot | Purpose |
|---|---|
root | Radius, clipping, and surface fill/border. |
header | Header padding and layout. |
body | Body padding and layout. |
footer | Footer padding and layout. |
The default theme is a light-mode port of Nuxt UI's card. The default variant is outline.
Related components
Separatorfor dividing card regions.PlaceholderandSkeletonfor empty and loading states.