Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Questionnaire
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Sections
@shadcn/react
@shadcn/helpers
Utilities
import Image from "next/image"
import { AspectRatio } from "@/components/ui/base/aspect-ratio"インストール#
pnpm dlx shadcn@latest add aspect-ratio
使用法#
import { AspectRatio } from "@/components/ui/aspect-ratio"<AspectRatio ratio={16 / 9}>
<Image src="..." alt="Image" className="rounded-md object-cover" />
</AspectRatio>正方形#
ratio={1 / 1} プロップを使用した正方形のアスペクト比コンポーネント。画像を正方形で表示する場合に便利です。
import Image from "next/image"
import { AspectRatio } from "@/components/ui/base/aspect-ratio"縦長#
ratio={9 / 16} プロップを使用した縦長のアスペクト比コンポーネント。これは、画像を縦長形式で表示する場合に便利です。
import Image from "next/image"
import { AspectRatio } from "@/components/ui/base/aspect-ratio"RTL#
shadcn/ui で RTL サポートを有効にするには、RTL 構成ガイド を参照してください。
"use client"
import * as React from "react"API リファレンス#
アスペクト比#
AspectRatio コンポーネントは、希望の比率でコンテンツを表示します。
| プロップ | タイプ | デフォルト | 必須 |
|---|---|---|---|
ratio | number | - | はい |
className | string | - | いいえ |
Base UI のドキュメントで詳細を確認できます。
shadcn/uiアプリをVercelにデプロイ
OpenAI、Sonos、Adobeなどに採用されています。
Vercelは、アプリや機能を大規模にデプロイするためのツールと インフラを提供します。
Vercelにデプロイ