TGViewer
AppPie AppPie @apppie · 3.5K subscribers
Post #2183 1.23K
Vaul —— 适用于 React 的抽屉组件

🔗 GitHub

Vaul 是一个无样式的 React 抽屉组件,可作为移动设备和平板设备上的对话框替代品。

该组件无预设样式,支持手势驱动的动画效果,由 Emil Kowalski 制作。

使用方法

要开始使用该库,请在你的项目中安装:


npm install vaul


在应用中使用抽屉组件:


import { Drawer } from 'vaul';

function MyComponent() {
return (
<Drawer.Root>
<Drawer.Trigger>Open</Drawer.Trigger>
<Drawer.Portal>
<Drawer.Content>
<Drawer.Title>Title</Drawer.Title>
</Drawer.Content>
<Drawer.Overlay />
</Drawer.Portal>
</Drawer.Root>
);
}


文档

在 文档 中查阅完整的 API 参考和示例。

#GitHub #React #OpenSource

📮 频道 @AppPie
  • 🎉 3
More from @apppie
  1. Oct 5, 2026#Apple Apple 发布测试版软件更新 • iOS 27.2 beta 3 (24B5099f) • iPadOS 27.2 beta 3 (24B5099f) • macO…
  2. Oct 5, 2026#Apple Apple 发布测试版软件更新 • Xcode 27.1 RC (27A9275) 🔗 浏览 Apple 软件更新 #AppleSoftwareUpdate 📮…
  3. Sep 28, 2026#Apple Apple 发布正式版软件更新 • watchOS 27.0.1 (24R365) 🔗 浏览 Apple 软件更新 #AppleSoftwareUpdate 📮…
  4. Sep 28, 2026#Apple Apple 发布正式版软件更新 • iOS 27.0.1 (24A446) • iPadOS 27.0.1 (24A446) • macOS 27.0.1 (26A4…
  5. Sep 28, 2026#Apple Apple 发布测试版软件更新 • Xcode 27.2 beta 2 (27B5028f) 🔗 浏览 Apple 软件更新 #AppleSoftwareUpdat…
  6. Sep 22, 2026#Wallpapers iPhone Duo 壁纸 此次整理包含展开与合拢两种构图,分别提供浅色、深色 PNG 壁纸及 Dynamic HEIC 动态版本,共六个文件。 更多壁纸,…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →