Workspace
Updated just now
Components / Display
A composable surface for related content and actions.
Last changed in version 0.13.0: Add avatar groups and chips, expand the block gallery, and improve component colors, spacing, and motion.
Card variant
Card variant
Card variant
bunx --bun @getweini/cli@latest add cardImport the files copied by the install command, then place the component in your Vue template. The text and values in the example belong to your app; change them to fit your task.
Updated just now
<script setup lang="ts">
import Card from './components/ui/card/Card.vue'
import CardContent from './components/ui/card/CardContent.vue'
import CardDescription from './components/ui/card/CardDescription.vue'
import CardHeader from './components/ui/card/CardHeader.vue'
import CardTitle from './components/ui/card/CardTitle.vue'
</script>
<template>
<Card as="article">
<CardHeader>
<CardTitle>Workspace</CardTitle>
<CardDescription>Updated just now</CardDescription>
</CardHeader>
<CardContent>Your content</CardContent>
</Card>
</template>Compose CardHeader, CardTitle, CardDescription, CardContent, and CardFooter as needed.
Group an account setting, its explanation, and an edit action in one surface.
Give a small set of related figures a clear title and supporting context.
Put the action in the footer so the content remains easy to scan.
<script setup lang="ts">
import Button from './components/ui/button/Button.vue'
import Card from './components/ui/card/Card.vue'
import CardContent from './components/ui/card/CardContent.vue'
import CardDescription from './components/ui/card/CardDescription.vue'
import CardFooter from './components/ui/card/CardFooter.vue'
import CardHeader from './components/ui/card/CardHeader.vue'
import CardTitle from './components/ui/card/CardTitle.vue'
</script>
<template>
<Card as="section" variant="outline">
<CardHeader>
<CardTitle as="h2">Email notifications</CardTitle>
<CardDescription>Choose which updates reach your inbox.</CardDescription>
</CardHeader>
<CardContent>Weekly summaries are enabled.</CardContent>
<CardFooter><Button variant="outline">Edit preferences</Button></CardFooter>
</Card>
</template>A smaller card can show a single measure without another nested container.
<script setup lang="ts">
import Card from './components/ui/card/Card.vue'
import CardContent from './components/ui/card/CardContent.vue'
import CardDescription from './components/ui/card/CardDescription.vue'
import CardHeader from './components/ui/card/CardHeader.vue'
import CardTitle from './components/ui/card/CardTitle.vue'
</script>
<template>
<Card as="article" size="sm" variant="muted">
<CardHeader>
<CardTitle as="h2">Open issues</CardTitle>
<CardDescription>Across active projects</CardDescription>
</CardHeader>
<CardContent><strong>12</strong></CardContent>
</Card>
</template>Every public prop, model, event, slot, and exposed member of the installed Vue parts is listed below. “Not set” means you can leave that value out; “Required” means you must provide it. Native HTML attributes also work where the component uses a native element.
| Name | Type or signature | Default | What it does |
|---|---|---|---|
asprop | "div" | "section" | "article" | undefined | "div" | Choose the HTML element or Vue component used for this control. |
variantprop | "default" | "outline" | "muted" | undefined | "default" | Choose the visual treatment for this component. |
sizeprop | "sm" | "md" | "lg" | undefined | "md" | Choose the visual size. Medium is the usual default where available. |
defaultslot | () => unknown | Required | Content shown inside Card. |
elementexposed | HTMLElement | null | — | Reference to the underlying HTML element. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
defaultslot | () => unknown | Required | Content shown inside CardContent. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
defaultslot | () => unknown | Required | Content shown inside CardDescription. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
defaultslot | () => unknown | Required | Content shown inside CardFooter. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
defaultslot | () => unknown | Required | Content shown inside CardHeader. |
| Name | Type or signature | Default | What it does |
|---|---|---|---|
asprop | "h2" | "h3" | "h4" | "h5" | "h6" | undefined | "h3" | Choose the HTML element or Vue component used for this control. |
defaultslot | () => unknown | Required | Content shown inside CardTitle. |
// packages/frameworks/vue/components/card/types.ts
// ------- IMPORTS -------
import type { cardSizes, cardVariants } from './styles'
// ------- TYPES -------
export interface CardProps {
as?: 'div' | 'section' | 'article'
variant?: keyof typeof cardVariants
size?: keyof typeof cardSizes
}
export interface CardTitleProps {
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
}
// packages/frameworks/vue/components/card/styles.ts
// Change Card surface and spacing here; public visual types follow these keys.
export const cardVariants = {
default: 'border-border bg-card text-card-foreground shadow-card',
outline: 'border-border bg-card text-card-foreground',
muted: 'border-transparent bg-muted text-foreground',
} as const
export const cardSizes = { sm: 'gap-4 p-4', md: 'gap-6 p-6', lg: 'gap-8 p-8' } as const