Cài đặt
Chạy lệnh này trong app, sau shadcn-vue init và theme Beehexa (Button › Code):
npx shadcn-vue@latest add https://beehexa.design/r/card.json
Cách dùng
<script setup lang="ts">
import { Button } from '@/components/ui/button'
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
</script>
<template>
<Card>
<CardHeader>
<CardTitle><h3>Cửa hàng online sang ERP</h3></CardTitle>
<CardDescription>Gửi đơn hàng mới sang ERP mỗi 15 phút.</CardDescription>
</CardHeader>
<CardContent>Lần chạy gần nhất hôm nay, 09:45.</CardContent>
<CardFooter>
<Button>Đồng bộ ngay</Button>
</CardFooter>
</Card>
</template>
Prop
| Phần | Prop | Giá trị | Ghi chú |
|---|---|---|---|
Card |
size |
default, sm |
Khoảng đệm 24 px hoặc 12 px |
| mọi phần | class |
chuỗi | Gộp với class của Beehexa |
CardHeader với class="border-b" vẽ một đường dưới phần đầu và thêm khoảng đệm bên dưới.
Dựng từ
Các phần tử thường có thuộc tính data-slot, như Card của control-center. CardTitle là một div: đặt thẻ tiêu đề bên trong khi card cần có mặt trong dàn ý của trang. Beehexa thêm style, bóng nổi và khoảng đệm theo token.