Files
heroui-vue/apps/docs/demos/typography-typography-scale.vue
T
2026-10-22 13:07:13 +08:00

85 lines
1.9 KiB
Vue

<script setup lang="ts">
import { Typography } from "@heroui-vue/components";
const scale = [
{
label: "h1",
meta: "36px / 600 / 1.11 / tight",
sample: "打造更出色的界面",
type: "h1",
},
{
label: "h2",
meta: "30px / 600 / 1.17 / tight",
sample: "为智能时代而生",
type: "h2",
},
{
label: "h3",
meta: "24px / 600 / 1.25 / tight",
sample: "按您的条件定价",
type: "h3",
},
{
label: "h4",
meta: "20px / 600 / 1.33 / tight",
sample: "申请创业计划",
type: "h4",
},
{
label: "h5",
meta: "18px / 600 / 1.39 / tight",
sample: "卡片标题",
type: "h5",
},
{
label: "h6",
meta: "16px / 600 / 1.50 / tight",
sample: "较小的功能标题",
type: "h6",
},
{
label: "body",
meta: "16px / 400 / 1.75",
sample: "用于文档、营销文案与描述的主要正文。",
type: "body",
},
{
label: "body-sm",
meta: "14px / 400 / 1.50",
sample: "次要正文、表格单元格、导航与侧边栏项。",
type: "body-sm",
},
{
label: "body-xs",
meta: "12px / 400 / 1.25",
sample: "说明文字、徽章、辅助文本与细则。",
type: "body-xs",
},
{
label: "code",
meta: "14px / mono",
sample: "pnpm add @heroui/react",
type: "code",
},
] as const;
</script>
<template>
<div class="flex w-full flex-col divide-y divide-border">
<div
v-for="row in scale"
:key="row.label"
class="grid grid-cols-[160px_1fr] items-center gap-8 py-5"
>
<div class="flex shrink-0 flex-col gap-0.5">
<span class="text-sm font-semibold text-foreground">
{{ row.label }}
</span>
<span class="text-xs whitespace-nowrap text-muted">{{ row.meta }}</span>
</div>
<Typography :type="row.type">{{ row.sample }}</Typography>
</div>
</div>
</template>