🌐 Nodejs.cn

分隔符

在视觉或语义上分离内容。

shadcn/ui
The Foundation for your Design System
A set of beautifully designed components that you can customize, extend, and build on.
import { Separator } from "@/components/ui/separator"

export function SeparatorDemo() {

安装

🌐 Installation

pnpm dlx shadcn@latest add separator

用法

🌐 Usage

import { Separator } from "@/components/ui/separator"
<Separator />

示例

🌐 Examples

垂直

🌐 Vertical

使用 orientation="vertical" 作为垂直分隔符。

🌐 Use orientation="vertical" for a vertical separator.

Blog
Docs
Source
import { Separator } from "@/components/ui/separator"

export function SeparatorVertical() {

🌐 Menu

带有描述的菜单项之间的垂直分隔符。

🌐 Vertical separators between menu items with descriptions.

SettingsManage preferences
AccountProfile & security
import { Separator } from "@/components/ui/separator"

export function SeparatorMenu() {

列表

🌐 List

列表项之间的水平分隔符。

🌐 Horizontal separators between list items.

Item 1
Value 1
Item 2
Value 2
Item 3
Value 3
import { Separator } from "@/components/ui/separator"

export function SeparatorList() {

从右到左

🌐 RTL

要在 shadcn/ui 中启用 RTL 支持,请参阅 RTL 配置指南

🌐 To enable RTL support in shadcn/ui, see the RTL configuration guide.

shadcn/ui
الأساس لنظام التصميم الخاص بك
مجموعة من المكونات المصممة بشكل جميل يمكنك تخصيصها وتوسيعها والبناء عليها.
"use client"

import * as React from "react"

API参考

🌐 API Reference

请参阅 Radix UI Separator 文档。

🌐 See the Radix UI Separator documentation.