JGuang / JGuang UI
Components组件Radix UIRadix UI 组件

面包屑

展示当前页面在层级结构中的位置。

中文模式已适配导航、标题、简介、目录与常用章节名称。翻译状态:部分完成;技术正文目前仍为英文。
Loading JGuang UI example…

安装

Command

Manual

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

将以下代码复制到你的项目中。

View complete source: components/ui/breadcrumb.tsx

根据项目配置更新导入路径。

用法

import {
  Breadcrumb,
  BreadcrumbItem,
  BreadcrumbLink,
  BreadcrumbList,
  BreadcrumbPage,
  BreadcrumbSeparator,
} from "@/components/ui/breadcrumb"
<Breadcrumb>
  <BreadcrumbList>
    <BreadcrumbItem>
      <BreadcrumbLink href="/">Home</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbLink href="/components">Components</BreadcrumbLink>
    </BreadcrumbItem>
    <BreadcrumbSeparator />
    <BreadcrumbItem>
      <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
    </BreadcrumbItem>
  </BreadcrumbList>
</Breadcrumb>

Composition

Use the following composition to build a Breadcrumb:

Breadcrumb
└── BreadcrumbList
    ├── BreadcrumbItem
    │   └── BreadcrumbLink
    ├── BreadcrumbSeparator
    ├── BreadcrumbItem
    │   └── BreadcrumbLink
    ├── BreadcrumbSeparator
    └── BreadcrumbItem
        └── BreadcrumbPage

Basic

A basic breadcrumb with a home link and a components link.

Loading JGuang UI example…

Custom separator

Use a custom component as children for `` to create a custom separator.

Loading JGuang UI example…

You can compose with a to create a dropdown in the breadcrumb.

Loading JGuang UI example…

Collapsed

We provide a `` component to show a collapsed state when the breadcrumb is too long.

Loading JGuang UI example…

To use a custom link component from your routing library, you can use the asChild prop on ``.

Loading JGuang UI example…

从右到左布局

To enable RTL support in JGuang UI, see the RTL configuration guide.

Loading JGuang UI example…

API 参考

The Breadcrumb component is the root navigation element that wraps all breadcrumb components.

PropTypeDefault
classNamestring-

The BreadcrumbList component displays the ordered list of breadcrumb items.

PropTypeDefault
classNamestring-

The BreadcrumbItem component wraps individual breadcrumb items.

PropTypeDefault
classNamestring-

The BreadcrumbLink component displays a clickable link in the breadcrumb.

PropTypeDefault
classNamestring-

The BreadcrumbPage component displays the current page in the breadcrumb (non-clickable).

PropTypeDefault
classNamestring-

The BreadcrumbSeparator component displays a separator between breadcrumb items. You can pass custom children to override the default separator icon.

PropTypeDefault
childrenReact.ReactNode-
classNamestring-

The BreadcrumbEllipsis component displays an ellipsis indicator for collapsed breadcrumb items.

PropTypeDefault
classNamestring-

来源: components/radix/breadcrumb.mdx

JGuang UI 技术文档。

On this page