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 { Label } from "@/components/ui/base/label"
import { Switch } from "@/components/ui/base/switch"
インストール#
pnpm dlx shadcn@latest add switch
使い方#
import { Switch } from "@/components/ui/switch"<Switch />説明#
フォーカスはデバイス間で共有され、アプリを終了すると自動的にオフになります。
import {
Field,
FieldContent,選択カード#
FieldLabel が Field 全体をラップして、クリック可能なカードパターンにするカードスタイルの選択。
import {
Field,
FieldContent,無効#
disabled プロパティを Switch コンポーネントに追加して、スイッチを無効にします。スタイル設定のために data-disabled プロパティを Field コンポーネントに追加します。
import { Field, FieldLabel } from "@/components/ui/base/field"
import { Switch } from "@/components/ui/base/switch"
無効な状態#
aria-invalid プロパティを Switch コンポーネントに追加して、無効な状態を示します。スタイル設定のために data-invalid プロパティを Field コンポーネントに追加します。
続行するには利用規約に同意する必要があります。
import {
Field,
FieldContent,サイズ#
size プロパティを使用してスイッチのサイズを変更します。
import { Field, FieldGroup, FieldLabel } from "@/components/ui/base/field"
import { Switch } from "@/components/ui/base/switch"
RTL#
shadcn/ui で RTL サポートを有効にするには、RTL 構成ガイド を参照してください。
يتم مشاركة التركيز عبر الأجهزة، ويتم إيقاف تشغيله عند مغادرة التطبيق.
"use client"
import * as React from "react"API リファレンス#
詳細については、ベース UI スイッチ ドキュメントを参照してください。
shadcn/uiアプリをVercelにデプロイ
OpenAI、Sonos、Adobeなどに採用されています。
Vercelは、アプリや機能を大規模にデプロイするためのツールと インフラを提供します。
Vercelにデプロイ