beUI 是一套以源码形式分发的动画 React 组件集合,通过公开 MCP 或 @beui shadcn 注册表以复制粘贴方式使用。它没有 beui 运行时包,组件安装后直接以命名导出参与组合。
用途 beUI 面向需要动效的 React 界面开发,覆盖动效 UI、智能体/聊天界面、通知提示、表单控件、数据展示与图表等场景。组件以可安装的源码条目提供,便于在项目中直接读取、组合与微调。
主要能力 组件目录涵盖多个类别:通知类(animated-toast-stack、notification-stack)、面板与导航类(bottom-sheet、drawer、animated-sidebar、ai-sidebar)、聊天与智能体类(chat-app、message-scroller、message、message-bubble、prompt-input、agent-activity、todo-list、code-block、file-diff、tool-result、tool-approval、approval-card、citations、image-generation)、浮层与菜单类(popover、popover-morph、select、select-morph、combobox、command-palette、context-menu、bloom-menu)、按钮类(button-base、button-stateful、button-magnetic、hold-action-button、slide-action-button、expanding-arrow-button)、加载与文本动效类(loader、thinking-shimmer、reasoning-text、agent-progress、text-shimmer、text-reveal、chromatic-text-reveal、text-cascade、text-scramble、number-ticker、animated-number)、滑块类(range-slider 及 inline、fluid、wave、bubble、ruler 变体)、选择器与操作栏类(wheel-picker、dock、expandable-action-bar、overflow-actions、expandable-tabs、morphing-tabs、tabs、shared-layout-bg、preview-rail、dynamic-island)、手势与上传类(swipeable-list、pull-to-refresh、file-upload、attachment-upload、otp-input、signup-form)、主题与背景类(theme-toggle、shader-background、cylinder-carousel、marquee)、数据与图表类(table、heat-calendar、returns-calendar、price-target-fan、table-editable、table-async、knockout-bracket、knockout-wheel、not-found-glitch、project-folder、swap、availability-scheduler、wallet-card、prediction-market、feedback-widget、infinite-masonry、bouncy-accordion、tilt-card、tooltip、switch、checkbox、radio、input)。
使用方式 公开 MCP 位于 https://mcp.beui.dev/mcp,无需许可证密钥或 Pro 认证。连接后可用 list_components 或 search_components 发现组件,用 get_component 查看组件。也可获取实时注册表:curl -fsS https://beui.dev/r/registry.json。CLI 安装时,从实时注册表的 items[].name 中选择最接近的安装 slug;公开 MCP 目录中的 slug 可能指向包含多个可安装变体的文档页,不应假定每个页面 slug 都是安装 slug。可用 npx shadcn@latest view @beui/<slug> 查看可安装条目,或用 npx shadcn@latest add @beui/<slug>、pnpm dlx shadcn@latest add @beui/<slug>、bunx --bun shadcn@latest add @beui/<slug> 安装。安装后读取新增文件,再通过命名导出进行组合。实时注册表是唯一事实来源。
组合规则 优先使用已安装的 beUI 源码,而非自定义的一次性动效组件;从 shadcn 添加的文件中导入命名导出;用 className 处理布局和小幅样式调整,除非用户要求,不要分叉内部实现;保留注册表安装的辅助模块,如 @/lib/ease、@/lib/utils 和 hooks;若在 beUI 组件周围新增动效,使用 motion/react 的 useReducedMotion();将磁性拉动、倾斜等装饰性悬停效果置于 useHoverCapable() 之后;动画使用 transform 和 opacity,避免动画布局属性。
图表组件 heat-calendar、returns-calendar、price-target-fan 位于文档的 /charts 下,其 @beui 安装 slug 不变。图表由根组件和导出部件组合。HeatCalendar 提供 HeatCalendarGrid、HeatCalendarLegend、HeatCalendarTooltip;ReturnsCalendar 提供 ReturnsCalendarGrid、ReturnsCalendarTooltip。每个日历的 tooltip 放在其 grid 内。两者都接受 selection、defaultSelection 和 onSelectionChange。PriceTargetFan 提供 Header、Plot、Svg、Axes、History、Targets、Now、Cursor、Tooltip 部件(均以 PriceTargetFan 为前缀)。SVG 部件放在 Svg 内,Tooltip 放在 Plot 内 Svg 旁。传入 current、targets 以及可选的按时间顺序的 { date: ISOString, price } 历史;省略 history 则不渲染历史序列。用 active、defaultActive、onActiveChange 控制读数。每个图表导出 use... hook 用于自定义后代内容;tooltip 子元素可以是渲染函数。示例数据应放在消费应用中,而非图表实现中。HeatCalendar.endDate 使用 UTC 日历日期。
限制 beUI 没有运行时包,组件以源码形式安装。授权组件需使用单独的 beui-pro 技能与 Pro 连接。公开 MCP 目录 slug 与安装 slug 可能不一致,运行任何 MCP 返回的 CLI 命令前需对照实时安装 slug 验证。贡献新公开组件需遵循 AGENTS.md,包含源码、预览、注册表条目并通过 bun run check:registry,且不得重命名现有 /r/{name}.json slug。