Card
Card는 이미지와 텍스트, 일부 기능 버튼을 포함한 컨테이너로 콘텐츠를 제공합니다.Basic Template
This is a Basic Template
Footer
import { Card } from '@vapor-ui/core';
export default function DefaultCard() {
return (
<Card.Root>
<Card.Header>Basic Template</Card.Header>
<Card.Body>This is a Basic Template</Card.Body>
<Card.Footer>Footer</Card.Footer>
</Card.Root>
);
}Examples
Layout
상황에 따라, 일부 영역을 생략하여 Card를 구성할 수 있습니다.
Body Only
Body
Footer
Header
Body
import { Card } from '@vapor-ui/core';
export default function CardLayout() {
return (
<div className="flex gap-4 items-start">
<Card.Root>
<Card.Body>Body Only</Card.Body>
</Card.Root>
<Card.Root>
<Card.Body>Body</Card.Body>
<Card.Footer>Footer</Card.Footer>
</Card.Root>
<Card.Root>
<Card.Header>Header</Card.Header>
<Card.Body>Body</Card.Body>
</Card.Root>
</div>
);
}Within Form
<Form /> 컴포넌트와 함께 사용하여 관련된 필드를 그룹화할 수 있습니다.
import { Button, Card, Field, Form, Text, TextInput } from '@vapor-ui/core';
export default function CardBasic() {
return (
<Card.Root render={<Form onSubmit={(e) => e.preventDefault()} />} width="400px">
<Card.Header>
<Text render={<h2 />} typography="heading5">
Login
</Text>
</Card.Header>
<Card.Body display="flex" flexDirection="column" gap="$100">
<Field.Root>
<Field.Label display="flex" flexDirection="column">
<Text typography="subtitle2" foreground="secondary-200">
ID
</Text>
<TextInput type="text" placeholder="Enter your username" />
</Field.Label>
</Field.Root>
<Field.Root>
<Field.Label display="flex" flexDirection="column">
<Text typography="subtitle2" foreground="secondary-200">
Password
</Text>
<TextInput type="password" />
</Field.Label>
</Field.Root>
</Card.Body>
<Card.Footer display="flex" justifyContent="flex-end">
<Button>Login</Button>
</Card.Footer>
</Card.Root>
);
}Props Table
Card.Root
Loading component documentation...
Card.Header
Loading component documentation...
Card.Body
Loading component documentation...
Card.Footer
Loading component documentation...