# Content Placeholder
URL: /react/components/content-placeholder
Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/content-placeholder.mdx
A visual placeholder that conveys the nature of the area when an image or content has not been loaded.
사용 가능 버전: @seed-design/react@1.2.8, @seed-design/css@1.2.6
## Preview
```tsx
import { ContentPlaceholder } from "seed-design/ui/content-placeholder";
export default function ContentPlaceholderPreview() {
return ;
}
```
## Usage
## Installation
- npm: npx @seed-design/cli@latest add ui:content-placeholder
- pnpm: pnpm dlx @seed-design/cli@latest add ui:content-placeholder
- yarn: yarn dlx @seed-design/cli@latest add ui:content-placeholder
- bun: bun x @seed-design/cli@latest add ui:content-placeholder
## Props
## Examples
### Type Preset
You can use predefined preset icons and backgrounds by specifying `type`. If `type` is not specified, the `"default"` type is rendered.
```tsx
import { HStack } from "@seed-design/react";
import { ContentPlaceholder } from "seed-design/ui/content-placeholder";
import { contentPlaceholderVariantMap } from "@seed-design/css/recipes/content-placeholder";
export default function ContentPlaceholderTypeExample() {
return (
{contentPlaceholderVariantMap.type.map((type) => (
))}
);
}
```
### Sizes
You can use various sizes by directly specifying `width` and `height` on the component.
```tsx
import { HStack, VStack } from "@seed-design/react";
import { ContentPlaceholder } from "seed-design/ui/content-placeholder";
const sizes = [
{ label: "48x48", width: 48, height: 48 },
{ label: "200x80", width: 200, height: 80 },
{ label: "200x120", width: 200, height: 120 },
{ label: "200x50", width: 200, height: 50 },
{ label: "300x300", width: 300, height: 300 },
{ label: "320x200", width: 320, height: 200 },
{ label: "40x120", width: 40, height: 120 },
{ label: "40x40", width: 40, height: 40 },
];
export default function ContentPlaceholderSizes() {
return (
{sizes.map(({ label, width, height }) => (
{label}
))}
);
}
```
### Customizing Asset
- You can use icons that are not in the `type` preset by passing `children`.
```tsx
import {
IconAppleFill,
IconDiamondFill,
IconSparkle2Fill,
} from "@karrotmarket/react-monochrome-icon";
import { HStack } from "@seed-design/react";
import { ContentPlaceholder } from "seed-design/ui/content-placeholder";
export default function ContentPlaceholderSvgExample() {
return (
);
}
```