Skip to Content
文档

卡片

用于显示与单个主题相关的内容。

SourceStorybookRecipe
NC

Nue Camp

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur nec odio vel dui euismod fermentum. Curabitur nec odio vel dui euismod fermentum.

用法

¥Usage

import { Card } from "@chakra-ui/react"
<Card.Root>
  <Card.Header />
  <Card.Body />
  <Card.Footer />
</Card.Root>

示例

¥Examples

变量

¥Variants

使用 variant 属性更改卡片的视觉样式。

¥Use the variant prop to change the visual style of the Card.

NC

Nue Camp

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

NC

Nue Camp

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

NC

Nue Camp

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

在表单

¥Within Form

在表单中使用 Card 组件将相关字段分组。

¥Use the Card component within a form to group related fields together.

Sign up

Fill in the form below to create an account

尺寸

¥Sizes

使用 size 属性更改卡片的大小。

¥Use the size prop to change the size of the Card.

Card - sm

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Card - md

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Card - lg

This is the card body. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

包含图片

¥With Image

使用 Card 组件显示图片。

¥Use the Card component to display an image.

Green double couch with wooden legs

Living room Sofa

This sofa is perfect for modern tropical spaces, baroque inspired spaces.

$450

水平

¥Horizontal

使用 Card 组件水平显示内容。

¥Use the Card component to display content horizontally.

Caffe Latte

The perfect latte

Caffè latte is a coffee beverage of Italian origin made with espresso and steamed milk.

HotCaffeine

包含头像

¥With Avatar

使用 Card 组件显示头像。

¥Use the Card component to display an avatar.

NF

Nate Foss

@natefoss

Nate Foss has requested to join your team. You can approve or decline their request.

属性

¥Props

根元素

¥Root

PropDefaultType
colorPalette 'gray'
'gray' | 'red' | 'orange' | 'yellow' | 'green' | 'teal' | 'blue' | 'cyan' | 'purple' | 'pink'

The color palette of the component

size 'md'
'sm' | 'md' | 'lg'

The size of the component

variant 'outline'
'elevated' | 'outline' | 'subtle'

The variant of the component

as
React.ElementType

The underlying element to render.

asChild
boolean

Use the provided child element as the default rendered element, combining their props and behavior.

For more details, read our Composition guide.
unstyled
boolean

Whether to remove the component's style.

Previous

徽章

Next

剪贴板