Skip to content

Card ​

Styled card component family built on zw-card primitives.

@zeus-web/cardData Displayzweb add cardGenerated

Playground ​

Source ​

Choose the framework entry that matches your application.

html
<script type="module">
  import '@zeus-web/card/wc/auto'
</script>

<zw-card>
  <zw-card-header>
    <zw-card-title>Production</zw-card-title>
    <zw-card-description>Deployment status</zw-card-description>
  </zw-card-header>
  <zw-card-content>Healthy</zw-card-content>
  <zw-card-footer>Updated just now</zw-card-footer>
</zw-card>
tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@zeus-web/card/react'

export function CardExample() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Production</CardTitle>
        <CardDescription>Deployment status</CardDescription>
      </CardHeader>
      <CardContent>Healthy</CardContent>
      <CardFooter>Updated just now</CardFooter>
    </Card>
  )
}
vue
<script setup lang="ts">
import {
  Card,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from '@zeus-web/card/vue'
</script>

<template>
  <Card>
    <CardHeader>
      <CardTitle>Production</CardTitle>
      <CardDescription>Deployment status</CardDescription>
    </CardHeader>
    <CardContent>Healthy</CardContent>
    <CardFooter>Updated just now</CardFooter>
  </Card>
</template>

Add ​

bash
zweb add card

Imports ​

Styled registry component:

tsx
import {
  Card,
  CardHeader,
  CardTitle,
  CardDescription,
  CardContent,
  CardFooter,
} from '@/components/ui/card'

Primitive React wrapper:

tsx
import {
  Card,
  CardHeader,
  CardTitle,
  CardDescription,
  CardContent,
  CardFooter,
} from '@zeus-web/card/react'

Web Component entry:

ts
import '@zeus-web/card/wc/auto'

Props ​

No public props documented.

Events ​

No public events documented.

Slots ​

SlotDescription
defaultCard child components.

Styling ​

Uses Tailwind: yes

Theme tokens:

  • bg-card
  • text-card-foreground
  • border

Internal selectors:

  • [data-slot=card-root]
  • [data-slot=card-header]
  • [data-slot=card-title]
  • [data-slot=card-content]

Registry ​

Registry source: available.

Add command: zweb add card

Type: component

Dependencies:

  • @zeus-web/card

Registry dependencies:

  • cn
  • globals

Files:

  • templates/react/card.tsx → components/ui/card.tsx
  • templates/vue/card.ts → components/ui/card.ts

AI usage rules ​

Do:

  • Use Card for grouped content containers.
  • Use CardHeader + CardTitle for titles.
  • Use CardContent for the main body.
  • Use CardFooter for actions.

Do not:

  • Do not use Card inside another Card.
  • Do not place interactive elements in CardDescription.

Examples ​

React styled usage ​

tsx
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from '@/components/ui/card'

export function Example() {
  return (
    <Card>
      <CardHeader>
        <CardTitle>Title</CardTitle>
        <CardDescription>Description</CardDescription>
      </CardHeader>
      <CardContent>Content</CardContent>
    </Card>
  )
}

Released under the MIT License.