Skip to content

Card

Simple content container with an optional header (title + tools) and a body. Shares its padding and border-radius tokens with Dialog.

Import

typescript
import { Card } from 'vuiii'

Basic Usage

Profile
Card body content
vue
import { Card } from 'vuiii'

<Card title="Profile">
  Card body content
</Card>

Props

PropTypeDefaultDescription
titlestring-Text rendered in the card header

The header is only rendered when a title, or the header, title, or tools slot is provided.

Slots

SlotDescription
defaultCard body content
headerOverrides the whole header-left region (default renders the title)
titleOverrides just the title text (default is the title prop)
toolsContent rendered on the right side of the header

Events

The Card emits no custom events.

More Examples

With Header Tools

Tools are rendered on the right side of the header.

Members
Team members list
vue
<Card title="Members">
  <template #tools>
    <IconButton icon="plus" @click="add()" />
  </template>
  Team members list
</Card>

Custom Title

Use the title slot to render richer content in place of the plain title text.

Featured
Card body content
vue
<Card>
  <template #title><Icon name="star" /> Featured</template>
  Card body content
</Card>

Without Header

Omit the title prop and all header slots to render a body-only card.

Just a body, no header
vue
<Card>Just a body, no header</Card>

Storybook

For interactive examples, see Card in Storybook.

Released under the MIT License.