Components组件Base UIBase UI 组件
弹出框
由触发器打开的轻量上下文内容浮层。
中文模式已适配导航、标题、简介、目录与常用章节名称。翻译状态:部分完成;技术正文目前仍为英文。
Loading JGuang UI example…
安装
Command
Manual
Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.
安装以下依赖:
npm install @base-ui/react
将以下代码复制到你的项目中。
View complete source: components/ui/popover.tsx
根据项目配置更新导入路径。
用法
import {
Popover,
PopoverContent,
PopoverDescription,
PopoverHeader,
PopoverTitle,
PopoverTrigger,
} from "@/components/ui/popover"
<Popover>
<PopoverTrigger render={<Button variant="outline" />}>
Open Popover
</PopoverTrigger>
<PopoverContent>
<PopoverHeader>
<PopoverTitle>Title</PopoverTitle>
<PopoverDescription>Description text here.</PopoverDescription>
</PopoverHeader>
</PopoverContent>
</Popover>
Composition
Use the following composition to build a Popover:
Popover
├── PopoverTrigger
└── PopoverContent
Basic
A simple popover with a header, title, and description.
Loading JGuang UI example…
Align
Use the align prop on PopoverContent to control the horizontal alignment.
Loading JGuang UI example…
With Form
A popover with form fields inside.
Loading JGuang UI example…
从右到左布局
To enable RTL support in JGuang UI, see the RTL configuration guide.
Loading JGuang UI example…
API 参考
See the Base UI Popover documentation.
来源: components/base/popover.mdx
JGuang UI 技术文档。