Technical Documentation: heroui-inc/heroui
ℹ️ Provenance: Multi-Tier Ingestion · CodeWiki Reference
Overview (`prompts/README.md`)
HeroUI v3 — AI Integration Prompt Packs
System prompts that teach AI code-generation tools to produce correct, idiomatic HeroUI v3 code.
What's in this directory
| File | Purpose |
|---|---|
heroui-system-prompt.md |
Universal prompt — works with any LLM or AI coding tool (Claude, ChatGPT, Cursor, Copilot, etc.) |
v0-heroui.md |
Tailored for v0.dev — emphasizes Next.js App Router, RSC patterns, and Tailwind v4 |
bolt-heroui.md |
Tailored for bolt.new / StackBlitz — includes full Vite setup and runnable single-file examples |
These prompts also work well with Lovable, Replit Agent, Windsurf, and similar AI-powered code generation platforms.
How to use
v0.dev
Paste the contents of v0-heroui.md into v0's system instructions or prepend it to your prompt.
bolt.new / StackBlitz
Paste the contents of bolt-heroui.md at the start of your prompt when creating a new project. It includes the full Vite + Tailwind v4 setup so bolt can scaffold the project correctly.
Cursor / Claude / ChatGPT / Copilot
Use heroui-system-prompt.md as a custom instruction, system prompt, or .cursorrules file. It gives the AI a focused reference of common HeroUI v3 components, validated forms, controlled selection, and theme-aware styling. Each prompt links to the full component index and current API documentation for additional components.
Any other tool
The universal heroui-system-prompt.md works with any tool that accepts system-level instructions.
Richer integrations
For deeper integration beyond system prompts:
- MCP Server — The HeroUI MCP server provides real-time component docs, source code, and theme tokens to AI agents. See the
@heroui/react-mcppackage. - React documentation index — heroui.com/react/llms.txt.
- Full React documentation — heroui.com/react/llms-full.txt. The root llms.txt is a cross-platform index covering React and Native.
- Component index — All React components, including components omitted from these focused prompts.
Contributing
When updating these prompts, verify that the component names, APIs, and import patterns match the actual v3 source code in this repo. Run a quick check against the component docs in apps/docs/content/docs/en/react/components/ to catch any drift.
These prompt packs require React and React DOM 19+ and Tailwind CSS v4. Existing projects should retain compatible dependencies; examples are not an instruction to upgrade the app or switch package managers.
Keep shared guidance synchronized across all three prompts. When validating an update:
- Check public exports and peer dependencies in
packages/react/package.jsonand published subpaths generated bypackages/react/scripts/update-exports.mjs. - Check component props and composition against
packages/react/src/components/, and variants againstpackages/styles/src/components/. - Type-check JSX examples and complete examples against the matching HeroUI version. A type check does not catch invalid nested buttons, missing accessible names, or client/server boundary errors; review those separately.
- Verify the framework's CSS integration and smoke-build the complete Vite example when setup changes.
- Retrieve current component docs through
@heroui/react-mcpor the React documentation links when an API is not covered here. Repository contributors can also use the source and demos inapps/docs/src/demos/en/.
Overview (`packages/react/README.md`)
Why HeroUI?
HeroUI (previously NextUI) is a production-ready React component library that combines the accessibility rigor of React Aria with the utility-first styling of Tailwind CSS v4. It ships a clean compound component API (Card.Header, Card.Content, Select.Item, …), requires no `` wrapper, and works out of the box with React 19 and Next.js.
- Accessible by default — Built on React Aria for WCAG-compliant keyboard, focus, and screen-reader behavior
- Tailwind CSS v4 — Modern engine, no CSS-in-JS runtime, smaller output, faster builds
- Compound components — Composable API (
Card.Header,Card.Content) instead of deeply nested props - Zero boilerplate — No Provider wrapper needed (unlike Chakra, MUI)
- AI-native — MCP server,
llms.txt, and agent skills so AI assistants understand your components - Battle-tested — Previously known as NextUI, trusted by thousands of production apps
Packages
| Package | Description |
|---|---|
@heroui/react |
Full component bundle |
@heroui/styles |
Styles / theme only |
| Individual packages | e.g. @heroui/button, @heroui/modal — tree-shakeable per-component imports |
Getting Started
Visit heroui.com/docs/react/getting-started/quick-start to get started with HeroUI.
npm install @heroui/styles @heroui/reactWho Is This For?
HeroUI is a good fit if you are building:
- SaaS applications — forms, tables, overlays, and notifications out of the box
- Dashboards & admin panels — data-dense layouts with consistent design tokens
- E-commerce storefronts — performant, accessible, SEO-friendly components
- Marketing sites & landing pages — polished UI without a heavyweight runtime
- Any React / Next.js project that values design quality and accessibility
AI-Powered Development
HeroUI is built for the AI-assisted development workflow.
| Tool | What it does |
|---|---|
MCP Server (@heroui/react-mcp) |
Components that understand your theme — install the server in Cursor, Claude Code, Windsurf, or any MCP-compatible editor |
| llms.txt | Available at heroui.com/llms.txt — structured context for LLMs about every component |
| Agent Skills | Run npx heroui-cli agents-md to install skills for Cursor, Claude Code, and more |
Works with Cursor, Claude Code, Windsurf, GitHub Copilot, and any tool that supports MCP or llms.txt.
Compared To
| Library | How HeroUI differs |
|---|---|
| shadcn/ui | HeroUI is batteries-included with a consistent design system; shadcn is copy-paste-customize |
| MUI | HeroUI is lighter, Tailwind-native, no CSS-in-JS runtime overhead |
| Chakra UI | HeroUI uses React Aria (stronger a11y primitives) and Tailwind v4 (better perf) |
| Mantine | HeroUI has AI tooling (MCP, llms.txt), Tailwind-first styling |
Documentation
- Latest (v3): heroui.com
- v2: v2.heroui.com
Storybook
Visit storybook-v3.heroui.com to view the storybook for all components.
Roadmap
Visit herouiv3.featurebase.app/roadmap to view the roadmap for HeroUI v3.
Figma
Visit the HeroUI Figma Kit (v3) to view the design kit.
Community
We're excited to see the community adopt HeroUI, raise issues, and provide feedback.
Whether it's a feature request, bug report, or a project to showcase, please get involved!
Contributing
Contributions are always welcome!
See CONTRIBUTING.md for ways to get started.
Please adhere to this project's CODE_OF_CONDUCT.
License
Overview (`packages/styles/README.md`)
@heroui/styles
The core HeroUI styles package containing CSS files for components, themes, and utilities. This package provides the foundation for HeroUI's design system using Tailwind CSS v4 and is framework-agnostic.
Documentation
It's the heroui.com website for the latest version of HeroUI.
- Latest (v3): https://heroui.com
- v2: https://v2.heroui.com
Installation
npm install @heroui/styles
# or
pnpm add @heroui/styles
# or
yarn add @heroui/stylesUsage
Basic Setup
Import the HeroUI styles in your main CSS file:
@import "@heroui/styles";This will import:
- Tailwind CSS base styles
- HeroUI component styles
- HeroUI utilities
- Default theme variables
- Animation utilities from tw-animate-css
Package Structure
The package exports CSS files organized into:
@heroui/styles/
├── index.css # Main entry point
├── base/ # Base styles and CSS variables
│ ├── base.css # Layout tokens, typography
│ └── scrollbar.css # Scrollbar base styles
├── components/ # Component-specific styles (one file per component)
│ ├── button.css
│ ├── chip.css
│ └── …
├── themes/ # Theme definitions
│ ├── default/ # Default theme
│ │ ├── index.css # Theme entry point
│ │ └── variables.css # Theme variables (light/dark)
│ └── shared/ # Shared theme utilities
│ └── theme.css # Calculated variables and utilities
├── utilities/ # Shared @utility helpers (status-focused, status-disabled, …)
│ └── index.css
└── variants/ # Custom Tailwind variants (motion-reduce, …)
└── index.cssImporting Specific Components
Component CSS files are not self-contained: they @apply shared utilities
(status-focused, status-disabled, no-highlight, …) and use custom
variants (motion-reduce:). Import the utilities and variants prelude
alongside the theme, then add only the components you need:
@import "tailwindcss";
/* Required prelude — component CSS depends on these */
@import "@heroui/styles/utilities";
@import "@heroui/styles/variants";
@import "@heroui/styles/themes/default" layer(theme);
/* Only the components you use */
@import "@heroui/styles/components/button.css" layer(components);
@import "@heroui/styles/components/chip.css" layer(components);Component Classes
Components use a BEM-like naming convention:
- Base:
.button - Variants:
.button--primary,.button--danger - Sizes:
.button--sm,.button--lg - Modifiers:
.button--icon-only
Button Example
<button class="button">Click me</button>
<button class="button button--primary">Save</button>
<button class="button button--sm">Small</button>
<button class="button button--icon-only">
<svg>...</svg>
</button>
<button class="button button--primary button--sm">Small Primary</button>Themes
The default theme provides automatic light/dark mode support:
- Light mode: Applied by default to
:root - Dark mode: Applied with
.darkclass or[data-theme="dark"]attribute
<html class="dark">
<html data-theme="dark"></html>
</html>CSS Variables
The package provides a comprehensive set of CSS variables for customization:
Layout Tokens
:root {
/* Spacing */
--spacing: 0.25rem;
/* Border */
--border-width: 0px; /* no border by default */
--field-border-width: var(--border-width);
--disabled-opacity: 0.5;
/* Radius */
--radius: 0.5rem;
--field-radius: calc(var(--radius) * 1.5);
/* Ring offset - Used for focus ring */
--ring-offset-width: 2px;
/* Cursor */
--cursor-interactive: pointer;
--cursor-disabled: not-allowed;
}Theme Colors
/* Detailed source-code truncated for AI context efficiency. */Note: Dark mode overrides specific variables (like --background, --surface, --overlay, --muted, --scrollbar, --default, --warning, --danger, --segment, --separator, and shadow values) when .dark class or [data-theme="dark"] attribute is applied.
Field Tokens
:root {
/* Form field defaults */
--field-background: var(--white);
--field-foreground: oklch(0.2103 0.0059 285.89);
--field-placeholder: var(--muted);
--field-border: transparent; /* no border by default on form fields */
--field-border-width: var(--border-width);
--field-radius: calc(var(--radius) * 1.5);
}Providing any of these knobs automatically updates the generated utilities (bg-field, placeholder:text-field-placeholder, rounded-field, etc.) along with the calculated hover/focus variants.
Calculated Variables
The theme also provides calculated variables for hover states, soft colors, and surface levels (defined in themes/shared/theme.css):
- Hover states:
--color-accent-hover,--color-success-hover,--color-warning-hover,--color-danger-hover,--color-default-hover - Soft colors:
--color-accent-soft,--color-danger-soft,--color-warning-soft,--color-success-soft(with their foreground and hover variants) - Surface levels:
--color-surface-secondary,--color-surface-tertiary - Radius scale:
--radius-xsthrough--radius-4xl(calculated from--radius) - Transition timing functions: Various easing curves like
--ease-smooth,--ease-out-fuild, etc.
Dependencies
- Tailwind CSS v4+: Required peer dependency
- tw-animate-css: Provides animation utilities
Build Output
The package provides:
index.css: Main unminified CSS fileheroui.min.css: Minified production-ready CSS (generated during build)
Framework Integration
This package is designed to work with any framework. For React-specific components, use @heroui/react which builds on top of these core styles.
License
MIT
Apps Docs Content Docs Cn Native Components Index (`apps/docs/content/docs/cn/native/components/index.mdx`)
title: 所有组件(Native)
按钮
集合
控件
表单
导航
浮层
反馈
布局
媒体
数据展示
工具
Apps Docs Content Docs Cn Native Getting Started Index (`apps/docs/content/docs/cn/native/getting-started/index.mdx`)
title: 介绍 icon: book-open image: https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/native/heroui-native-og-light-1.webp
HeroUI Native 是基于 Tailwind v4 与 Uniwind 的 React Native 组件库,并面向现代移动端技术栈。每个组件都带有流畅动画、精致细节与内置无障碍支持——开箱即用,亦可深度定制。
为什么选择 HeroUI Native?
默认即美观 — 专业观感开箱即有,无需额外堆样式。
无障碍优先 — 遵循移动端无障碍最佳实践,内置合理的焦点管理、触控可达性与读屏支持。
高度可组合 — 每个组件由可替换的子部件构成;按需改动,其余保持不变。
开发者友好 — 类型完备的 API、可预期的模式与出色的自动补全。
持续维护 — 由团队负责更新、修复与新特性;你只需升级依赖。
轻量按需 — 支持 Tree-shaking,仅打包实际使用的部分。
面向未来 — 兼容最新 Expo,并通过 Uniwind 建立在 Tailwind v4 之上,同时便于 AI 辅助开发。
一个精心打造的组件库,而非复制粘贴
复制粘贴的代码在依赖停滞时会变成维护负担。
HeroUI Native 则不同,它是与你共同演进的组件库:
- 自动更新和修复
- 无需额外工作即可获得新功能
- 组件与 React Native、Tailwind 与移动平台保持同步
- 深度定制,而非浅层主题调整
- 面向代码生成的 AI 友好 API
HeroUI 生态
- 🌐 HeroUI v3(Web) — 基于 Tailwind CSS v4 的 React 组件
- 📱 HeroUI Native(移动端) — 面向 React Native 的美观组件
- 🤖 HeroUI Chat(自然语言生成应用)— 用对话创建应用
- 🧠 面向 LLM 的 UI — 全新平台与 MCP 即将推出
常见问题
HeroUI Native 是否免费?
是的,基于 Apache License 2.0 完全免费且开源。
是否可用于生产?
可以。HeroUI v3 已经稳定,可放心用于生产环境。
能否自定义组件?
可以。可更新默认样式与动画,或重新组合子部件;每个插槽都可定制。
是否支持 TypeScript?
完整类型定义,IDE 体验与自动补全良好。
无障碍方面如何?
遵循移动端无障碍最佳实践,内置焦点管理、触控可达性与读屏支持。
是否有 Figma 资源?
有!欢迎访问我们的设计系统:HeroUI Figma Kit V3。
参与其中
加入社区、分享反馈或参与贡献:
HeroUI Native 采用 Apache License 2.0 发布。
Apps Docs Content Docs Cn Native Releases Index (`apps/docs/content/docs/cn/native/releases/index.mdx`)
title: 所有版本
最新版本
v1.0.11
2026 年 10 月
本补丁版本将组件 CSS 包裹在 Tailwind 的 components 层叠层中,使用户的工具类可以覆盖组件默认样式;新增 Expo SDK 58 / React Native 0.88 / Gesture Handler 3 支持;修复 Slider 使用小数步长时的浮点精度误差;让 ScrollShadow 在启用「减弱动态效果」时仍随滚动位置变化;并解决了 Android 上的多个浮层与输入组件问题。
v1.0.10
2026 年 9 月
本补丁版本将 Input、TextArea、SearchField 与 InputGroup 的 ref 类型改为原生 TextInput 实例,以适配 React Native 的 Strict TypeScript API;修复了 Android 上以及容器尺寸变化时 BottomSheet 的显示问题;让 Skeleton 的 variant="none" 跳过默认布局动画;并在窗口尺寸变化时刷新 Menu、Popover 与 Select 的锚点位置。
v1.0.9
2026 年 8 月
本补丁版本重构了字重通过 Uniwind font-* 工具类的解析方式,使使用自定义字体的应用在 iOS 上获得正确的字重;修复了省略可选部件时 SearchField 的内边距问题;纠正了 Toast 的 duration: 0 未按文档自动隐藏的行为;并恢复了 react-native-gesture-handler 3 下 Android 上 Select 与 Dialog 的滑动关闭。
v1.0.8
2026 年 7 月
本版本为整个库带来从右到左(RTL)布局支持:组件样式迁移到 Yoga 逻辑属性,Slider、Skeleton、Switch、Tabs、InputGroup、Popover 与 Menu 中对方向敏感的行为通过全新的 isRTL provider 配置解析,并提供 LayoutDirectionScope 作为子树的应急出口。同时让 heroui-native/styles 自行声明 @source,因此类名扫描不再依赖硬编码的 node_modules 路径。Card.Header 与 TagGroup.List 改变了子元素的对齐方式,两者均可用一行覆盖恢复。
v1.0.7
2026 年 7 月
本版本通过 background 属性以及配套的背景复合部件,使组件表面可扩展,从而可将表面后方的层替换为任意节点。同时新增 GlassView 层组件,以及用于 Dialog 与 Bottom Sheet 的 blur 遮罩变体,两者均由可选的 expo-blur 依赖支撑。Select 触发器被重新设计为字段外观,Toast 迁移至 overlay 主题令牌;默认主题不注册任何背景内容,因此渲染结果整体不变。
v1.0.6
2026 年 7 月
本版本将每个组件的样式从内联 Tailwind 类名字符串迁移到专用的 BEM 命名 CSS 文件,并让 tv() 插槽仅作为轻量引用,从而更易于覆盖与维护。同时修复了一个 PortalHost 协调缺陷:Bottom Sheet、Dialog、Popover 与 Select 各类 Portal 在不同屏幕间会相互继承状态,产生「幽灵」状态的已打开 Sheet。
v1.0.5
2026 年 7 月
本版本将工具链升级至 Expo 57 / React Native 0.86,并在各表单组件中以基于 outline 的聚焦、激活与无效状态优化字段边框样式。同时为 Typography 新增 iOS Dynamic Type 支持,引入 Provider 级的文本输入配置,并以更轻量、单次挂载的进入动画改进 Popover、Menu 与 Select。
CLI v1.0.0
2026 年 6 月
🎉 全新的 CLI,用于一键创建 HeroUI Native 项目。npx create-heroui-native-app@latest my-app 即可生成一个完整的 Expo Router 应用,内置 HeroUI Native、Uniwind、Tailwind CSS、所有必需的 peer 依赖以及 Provider 包装 —— 还可在单页面与 Tabs 两套起始模板中任选其一。
v1.0.4
2026 年 5 月
本补丁版本将 Text 排版组件重命名为 Typography(保留 Text 的弃用导出以兼容旧代码),调整 Alert、Avatar、Button、Chip、Toast 等组件的 soft 前景色主题令牌,并新增可选的 heroui-native/styles/vibrant 鲜亮配色;为 Menu、Popover、Select 补充 iOS 原生模态偏移的处理说明;将示例应用升级至 Expo 56 / React Native 0.85,并将 @gorhom/bottom-sheet 对等依赖升至 ^5.2.9。
v1.0.3
2026 年 5 月
本补丁版本引入全新的 Text 排版组件,提供 Heading、Paragraph、Code 子组件;修复 ScrollShadow 对反向列表的支持以及 Tabs 指示器在 RTL 布局下的对齐;并在使用自定义 children 时统一 Select.TriggerIndicator 的动画。同时将 Avatar 的 alt 属性改为可选,微调 Button、Chip、Input 的样式,并修正 TextField 与 SearchField 的内部内边距行为。
v1.0.2
2026 年 4 月
本补丁版本为 PressableFeedback 与 Surface 引入 asChild 插槽模式;为所有基于 Portal 的遮罩增加 VoiceOver 模态包容支持;修复 Android 上 Button outline 变体的样式问题;并微调 Input 与 Select 的视觉效果。
v1.0.1
2026 年 4 月
本补丁版本修复 Toast 提供程序中 total SharedValue 与实际 Toast 数量不同步的竞态;将七个组件的禁用态样式改为使用原生 disabled: 修饰符;并为主题系统新增供遮罩组件使用的 --backdrop 变量。
v1.0.0
2026 年 3 月
🎉 HeroUI Native 迎来首个稳定版本,从 beta 与候选发布阶段毕业。本里程碑包含全新 LinkButton 组件、子菜单冲突处理、可选的 @gorhom/bottom-sheet 对等依赖,以及更强的 useThemeColor 类型安全。
RC 4
2026 年 3 月
本版本引入用于嵌套可展开菜单的 SubMenu 复合组件(带动画展开/收起);以基于插槽的样式与 textProps 透传重构 Slider Output;并修复快速连按时 PressableFeedback 水波纹动画闪烁。
RC 3
2026 年 2 月
本版本新增 TagGroup、Menu、InputGroup 三个组件;为所有基于 Bottom Sheet 的遮罩增加 Android 实体返回键支持;并通过关键的 combineStyles 修复保留 Reanimated 动画样式绑定,实现 Expo 55 兼容。
RC 2
2026 年 2 月
本版本新增 SearchField、ListGroup、Slider 三个组件;为 Select 增加由类型安全泛型支撑的多选模式;将 Button 反馈 API 重构为统一的 feedbackVariant + animation。放宽对等依赖约束以更好兼容 Expo SDK 55,并修复若干 Select 与 Avatar 问题。
RC 1
2026 年 2 月
本版本引入含五种状态变体与无障碍原语的 Alert 复合组件;将 Radio 抽为可双模式运行的独立组件;新增带动画的 Select.TriggerIndicator。另提供用于精简包体的 HeroUINativeProviderRaw、用于 iOS 调试的 disableFullWindowOverlay、六个组件统一的 styles 属性,以及以各主题显式定义取代计算型的 surface 主题变量重构。
Beta 13
2026 年 2 月
本版本引入多行输入组件 TextArea、Button outline 变体,为所有组件导出样式类名,并提供可复用的 CloseButton。同时重构 Tabs(动画与变体命名改进)、将表单相关能力拆为独立原语,并增加细粒度导出以优化包体。另含主题色与组件字符串化等关键修复。
Beta 12
2026 年 1 月
本版本新增 InputOTP、Label、Description 三个核心表单组件,强化 React Native 中的表单搭建能力。另含 Popover 关闭行为、弹层受控状态、圆角配置等关键修复,并为多个表单组件增加变体样式属性支持。
Beta 11
2026 年 1 月
本版本通过 Bottom Sheet 关闭协同改进、Dialog 侧滑关闭手势修复、TextField 样式优化,以及面向高级 Portal 挂载场景的 PortalHost 导出,提升组件可靠性与开发者体验,使交互更顺滑、自定义布局更灵活。
Beta 10
2025 年 12 月
本版本引入新的 Bottom Sheet 组件;重构 PressableFeedback 并改进 API;扩展动画 API 以支持 State Prop;增强 use-theme-color 钩子以支持多色选取;并包含若干问题修复与文档改进。
发布周期
HeroUI Native 遵循常规发布周期:
- 稳定版:v1.0.0 已于 2026 年第一季度发布
- 补丁版:按需发布问题修复与小幅改进
参与贡献
发现问题或想参与贡献?请访问我们的 GitHub 仓库。
Apps Docs Content Docs Cn React Components Index (`apps/docs/content/docs/cn/react/components/index.mdx`)
title: 所有组件(React)
按钮
集合
颜色
控件
数据展示
日期与时间
反馈
表单
布局
媒体
导航
浮层
选择器
排版
工具
Apps Docs Content Docs Cn React Getting Started Index (`apps/docs/content/docs/cn/react/getting-started/index.mdx`)
title: 介绍 icon: book-open image: https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/heroui-og_2x.jpg
HeroUI 是一个基于 Tailwind CSS v4 和 React Aria Components 构建的 React 组件库。每个组件都带有流畅的动画、精致的细节和内置的无障碍支持——开箱即用,完全可定制。
为什么选择 HeroUI?
默认美观 — 开箱即用,外观专业,无需额外样式配置。
无障碍 — 基于 React Aria Components 构建,内置焦点管理、键盘导航和屏幕阅读器支持。
灵活 — 每个组件都由可定制的部件组成。按需修改,其余保持不动。
开发者友好 — 完整的类型化 API、可预期的模式以及出色的自动补全。
持续维护 — 我们负责处理更新、错误修复和新功能。你只需更新依赖包。
轻量级 — 支持 Tree Shaking,只把你实际使用的部分打包到应用中。
面向未来 — 为 React 19 和 Tailwind v4 而构建,专为 AI 辅助开发而设计。
一个精心打造的组件库,而非复制粘贴
复制粘贴的代码能用,直到它出问题为止。你将不得不维护那些不再演进的过时依赖。
HeroUI 则不同,它是与你共同演进的组件库:
- 自动更新和修复
- 无需额外工作即可获得新功能
- 组件与 React、Tailwind 和浏览器保持同步
- 深度定制,而非浅层主题调整
- 面向代码生成的 AI 友好 API
HeroUI 生态系统
- 🌐 HeroUI v3(Web) — 你正在浏览的就是这里!基于 Tailwind CSS v4 的 React 组件
- 📱 HeroUI Native(移动端) — 为 React Native 提供精美组件
- 🤖 HeroUI Chat(文本生成应用) — 用自然语言创建应用
- 🧠 面向 LLM 的 UI — 全新平台与 MCP 即将推出
为什么选择 React Aria? 我们选择 React Aria 是为了大规模实现无障碍能力。从 HeroUI v2 起我们就在使用它,v3 也保留了熟悉的 API 约定,例如 isDisabled 和 onPress。感谢 Devon Govett 以及 Adobe 团队。
常见问题
HeroUI 免费吗?
是的,基于 Apache License 2.0 完全免费且开源。
可以用于生产环境吗?
可以。HeroUI v3 已经稳定,可放心用于生产环境。
我可以定制组件吗?
当然可以!你可以使用 Tailwind 工具类、CSS 变量、BEM 修饰符,或以不同的方式组合组件。每一个插槽都可以定制。
它支持 TypeScript 吗?
完全类型化,提供出色的 IDE 支持和自动补全。
无障碍能力如何?
基于 React Aria Components 构建,符合 WCAG 标准。内置键盘导航、焦点管理和屏幕阅读器支持。
可以在不使用 React 的情况下使用样式吗?
可以,CSS 可以应用于纯 HTML。请查看我们的 Tailwind Play 示例。
有 Figma 文件吗?
有!欢迎访问我们的设计系统:HeroUI Figma Kit V3。
参与其中
加入社区、分享反馈或参与贡献:
HeroUI 基于 Apache License 2.0 协议发布。
Apps Docs Content Docs Cn React Migration Agent Index (`apps/docs/content/docs/cn/react/migration/agent-index.mdx`)
title: 迁移(面向 AI 助手) index: false
面向 AI 助手:在协助将 HeroUI v2 → v3 进行迁移时,请将本文档作为入口。
入口
请选择一种迁移策略:
- 完整迁移(迁移过程中项目将无法正常运行)→ 阅读
(workflows)/agent-guide-full.mdx。 - 渐进式迁移(v2 与 v3 并存)→ 阅读
(workflows)/agent-guide-incremental.mdx。
本套文档中的参考资料
- 通用指南:
hooks.mdx、styling.mdx。 - 上述工作流程指南已经内嵌了「主要变更」、「关键 API 变更」、组件参考表以及「新增组件」等内容。
- 各组件指南:
(components)/<component>.mdx(例如(components)/button.mdx、(components)/select.mdx)。请通过工作流程指南中的组件参考表来定位对应的文件。
Apps Docs Content Docs Cn React Migration Index (`apps/docs/content/docs/cn/react/migration/index.mdx`)
title: 迁移 index: true
面向 AI 助手
以下是 AI 助手获取迁移文档的三种方式。我们推荐使用 HeroUI Migration MCP 服务器,并充分利用其 prompt 与工具,不过其它方式也都能为 agent 提供完整的文档。
| 对比项 | MCP Server | Agent Skills | AGENTS.md |
|---|---|---|---|
| 数据来源 | 远程端点 | 远程端点 | 本地文件 |
| 访问方式 | MCP 工具 | 脚本文件 | 读取本地文件 |
| 配置方式 | MCP 配置 | 安装命令 | heroui-cli 命令 |
| 更新 | 实时 | 实时 | 手动 |
| 离线 | ❌ | ❌ | ✅ |
| 工具 | MCP 工具 + prompt | 脚本 | ❌ |
| 指南 | MCP Server → | Agent Skills → | AGENTS.md → |
主要变化
- 依赖项:将 React 升级到 v19+、HeroUI 包升级到 v3、Tailwind CSS 升级到 v4,并移除 Framer Motion
- 无需 Provider:v3 不再需要
HeroUIProvider - 组件 API 更新:许多组件改用 React Aria Components 模式
- 复合组件:全新的复合组件模式带来了更好的定制能力。详情请参阅各组件的迁移指南。
- 已移除的 Hooks:v2 中的组件 Hooks(如
useSwitch、useInput)已被移除——请改用复合组件。useDisclosure已被替换为useOverlayState。详情请参阅 Hooks 迁移指南。 - 配置变更:从 Tailwind 配置中移除
heroui()插件,更新 CSS 导入,并删除hero.ts文件 - 条目标识:集合类组件(Dropdown、ListBox、Select、Accordion 等)在 v3 中改用
id和textValue;列表本身仍需保留 React 的key。
条目标识与无障碍(key、id、textValue)
在 v2 中,集合类组件(Dropdown、ListBox、Select、Accordion 等)使用 React 的 key 作为条目标识。同一个值既驱动 React 的列表协调,又承担组件的选中/展开状态。在使用 React Aria Components 的 v3 中,这两种职责被拆分开:
id— v3 在每个条目上使用显式的id属性来表示选中状态、焦点以及回调(例如selectedKeys、expandedKeys、onSelectionChange)。请使用与你在 v2 中给key设置的相同(或等效)的值,这样状态和回调仍能正确指向对应的条目。textValue— 当条目的可见内容不是纯文本时(例如使用了Label、图标或Description),v3 需要在条目上提供textValue。它用于屏幕阅读器播报和键入快速定位(type-ahead)。key— 继续在列表项上使用 React 的key。它仍然是 React 列表协调所必需的,且与id相互独立。
迁移时:为 v3 的 API 添加 id(必要时再加上 textValue),同时保留供 React 使用的 key。
迁移策略
如果不做特殊设置,HeroUI v2 与 v3 不能在同一个项目中共存。你可以选择以下两种迁移方式:
一次性完整迁移
适用场景: 能够集中投入时间、一次性完成迁移的项目。
工作方式:
- 先迁移所有组件代码(此阶段项目将无法正常运行)
- 将依赖项切换到 v3
- 完成样式迁移
优点:
- 配置更简单——无需复杂的共存配置
- 切换更干净——同一时间只有一个版本处于激活状态
- 由 Migration MCP 的 prompt 提供支持
缺点:
- 项目在迁移期间无法正常运行
- 必须在切换依赖之前完成所有组件的迁移
开始迁移: 完整迁移指南
渐进式迁移
适用场景: 需要在迁移过程中保持可用的项目、希望分阶段逐步迁移的团队,以及按功能逐个迁移的大型代码库。
工作方式:
- 通过 pnpm 别名或组件包来设置共存
- 在保持项目可用的前提下,逐个迁移组件
- 完成迁移后再移除 v2 依赖项
优点:
- 项目在迁移期间始终可用
- 可以分阶段、按需逐步推进
- 可以将 v3 组件与 v2 并存测试
缺点:
- 初始配置更为复杂
- 可能出现样式冲突
- 需要同时管理两个版本
开始迁移: 渐进式迁移指南
组件迁移参考
可以通过下表快速查找每个组件的迁移指南。点击「迁移指南」列中的链接,即可跳转到对应的详细迁移说明。
| v2 组件 | v3 组件 | 状态 | 迁移指南 |
|---|---|---|---|
| Accordion | Accordion | ✅ 可用 | 查看指南 → |
| Alert | Alert | ✅ 可用 | 查看指南 → |
| Autocomplete | ComboBox | ✅ 已重命名 | 查看指南 → |
| Avatar | Avatar | ✅ 可用 | 查看指南 → |
| Badge | Badge | ✅ 可用 | 查看指南 → |
| Breadcrumbs | Breadcrumbs | ✅ 可用 | 查看指南 → |
| Button | Button | ✅ 可用 | 查看指南 → |
| ButtonGroup | ButtonGroup | ✅ 可用 | 查看指南 → |
| Calendar | Calendar | ✅ 可用 | 查看指南 → |
| Card | Card | ✅ 可用 | 查看指南 → |
| Checkbox | Checkbox | ✅ 可用 | 查看指南 → |
| CheckboxGroup | CheckboxGroup | ✅ 可用 | 查看指南 → |
| Chip | Chip | ✅ 可用 | 查看指南 → |
| Code | ❌ | ❌ 已移除 | 查看指南 → |
| DateInput | DateField | ✅ 已重命名 | 查看指南 → |
| DatePicker | DatePicker | ✅ 可用 | 查看指南 → |
| DateRangePicker | DateRangePicker | ✅ 可用 | 查看指南 → |
| TimeInput | TimeField | ✅ 已重命名 | 查看指南 → |
| Divider | Separator | ✅ 已重命名 | 查看指南 → |
| Drawer | Drawer | ✅ 可用 | 查看指南 → |
| Dropdown | Dropdown | ✅ 可用 | 查看指南 → |
| Form | Form | ✅ 可用 | 查看指南 → |
| Image | ❌ | ❌ 已移除 | 查看指南 → |
| Input | TextField、Input、InputGroup | ✅ 可用 | 查看指南 → |
| InputOTP | InputOTP | ✅ 可用 | 查看指南 → |
| Kbd | Kbd | ✅ 可用 | 查看指南 → |
| Link | Link | ✅ 可用 | 查看指南 → |
| Listbox | ListBox | ✅ 可用 | 查看指南 → |
| Modal | Modal | ✅ 可用 | 查看指南 → |
| Navbar | ❌ | ❌ 已移除 | 查看指南 → |
| NumberInput | NumberField | ✅ 已重命名 | 查看指南 → |
| Pagination | Pagination | ✅ 可用 | 查看指南 → |
| Popover | Popover | ✅ 可用 | 查看指南 → |
| Progress | ProgressBar | ✅ 已重命名 | 查看指南 → |
| CircularProgress | ProgressCircle | ✅ 已重命名 | 查看指南 → |
| Radio | Radio | ✅ 可用 | 查看指南 → |
| RadioGroup | RadioGroup | ✅ 可用 | 查看指南 → |
| RangeCalendar | RangeCalendar | ✅ 可用 | 查看指南 → |
| Ripple | ❌ | ❌ 已移除 | 参见 Button 的水波纹效果 → |
| ScrollShadow | ScrollShadow | ✅ 可用 | 查看指南 → |
| Select | Select | ✅ 可用 | 查看指南 → |
| Skeleton | Skeleton | ✅ 可用 | 查看指南 → |
| Slider | Slider | ✅ 可用 | 查看指南 → |
| Snippet | ❌ | ❌ 已移除 | 查看指南 → |
| Spacer | ❌ | ❌ 已移除 | 查看指南 → |
| Spinner | Spinner | ✅ 可用 | 查看指南 → |
| Switch | Switch | ✅ 可用 | 查看指南 → |
| Table | Table | ✅ 可用 | 查看指南 → |
| Tabs | Tabs | ✅ 可用 | 查看指南 → |
| Toast | Toast | ✅ 可用 | 查看指南 → |
| Tooltip | Tooltip | ✅ 可用 | 查看指南 → |
| User | ❌ | ❌ 已移除 | 查看指南 → |
v3 中新增的组件
v3 引入了一系列 v2 中尚未提供的全新组件:
| 组件 | 用途 | 文档 |
|---|---|---|
| TextField | 增强型文本输入框,支持 label 与 description | 查看文档 → |
| TextArea | 多行文本输入组件 | 查看文档 → |
| AlertDialog | 用于确认与提醒的模态对话框 | 查看文档 → |
| Label | 无障碍的表单标签组件 | 查看文档 → |
| Description | 表单字段的辅助说明文本 | 查看文档 → |
| FieldError | 表单字段的错误信息显示 | 查看文档 → |
| Fieldset | 对相关表单字段进行分组 | 查看文档 → |
| InputGroup | 将多个输入框组合在一起 | 查看文档 → |
| Surface | 带有层级样式的容器组件 | 查看文档 → |
| Disclosure | 可展开 / 可折叠的内容区域 | 查看文档 → |
| DisclosureGroup | 用于管理多个 Disclosure 区域的复合组件 | 查看文档 → |
| SearchField | 带清除按钮与可选加载状态的搜索输入框 | 查看文档 → |
| DateField | 配合日历选择器的日期输入框 | 查看文档 → |
| TimeField | 时间输入组件 | 查看文档 → |
| Tag、TagGroup | 用于选择或展示的 Tag 与 TagGroup | 查看文档 → |
| ColorPicker | 颜色选择(ColorArea、ColorField、ColorSlider、ColorSwatch、ColorSwatchPicker) | 查看文档 → |
| CloseButton | 用于关闭或解除浮层的触发按钮 | 查看文档 → |
| ErrorMessage | 表单字段错误信息展示(基于 React Aria 集成) | 查看文档 → |
其他迁移指南
- Hooks 迁移指南:将 Hooks 从 v2 迁移到 v3 的详细说明
- 样式迁移指南:更新工具类、颜色 token 与组件样式的综合指南
获取帮助
如果你在迁移过程中遇到问题:
- 查看 v3 文档
- 查阅具体组件的迁移指南
- 在 GitHub Discussions 中查找或提问
- 加入 Discord 社区
Apps Docs Content Docs Cn React Releases Index (`apps/docs/content/docs/cn/react/releases/index.mdx`)
title: 所有版本
最新版本
v3.2.6
2026 年 9 月 17 日
补丁版本:AvatarGroup 作为独立组件回归;鼠标打开浮层后,ListBox、Dropdown、Select 与浮层触发器上的焦点环重新变为仅键盘触发;@internationalized/date 移入 peerDependencies,同时移除 tailwind-merge 与 @react-aria/i18n;ColorSlider 不再在生产构建中每次渲染都告警;裸 .tag 标记保留默认内边距;Breadcrumbs 重新对齐到间距网格;React Aria 升级到 1.21.1([email protected])。此外,43 个组件的 context 值做了 memoize,消费者不再随根组件的每次渲染而重渲染。
v3.2.5
2026 年 9 月 8 日
补丁版本:Toast 支持堆叠并在悬停时展开,Select 新增 ClearButton,Tabs 新增 align 变体,@heroui/react 再导出 Pressable、Focusable、OverlayTriggerStateContext 与 DisclosureStateContext,React Aria 升级到 1.21.0([email protected])。同时修复了嵌套 data-theme 作用域与 Shadow DOM 中的主题 token、导出变体上的原生 :focus-visible 焦点环、Modal 级浮层被关闭中的 Popover 遮挡等问题,以及 ScrollShadow、Table、Drawer、NumberField、Accordion、Label 与 Tag 的若干问题。
v3.2.4
2026 年 8 月 4 日
补丁版本:Autocomplete 弹层不再裁剪末尾选项,scroll="outside" 的 Modal 重新支持点击遮罩关闭,Tabs 的箭头滚动会精确停在边缘,tailwind-variants 升级到 3.3.1 以修复重新渲染后变体修饰符回退到错误类名的问题,React Aria 升级到 1.20.0([email protected]),并为 @heroui/react 添加了行为测试套件。
v3.2.3
2026 年 7 月 30 日
补丁版本:ComboBox 新增多选支持,样式采用逻辑 CSS 属性以更好地支持 RTL,tailwind-variants 升级到 3.3.0,并修复 ScrollShadow、Spinner、InputOTP、Table 以及 accent Button 焦点样式的问题。
v3.2.2
2026 年 6 月 19 日
补丁版本:升级到 React Aria 1.19.0([email protected]),为 Tabs.ListContainer 添加溢出滚动,修复清除/关闭按钮意外提交表单,以及 Checkbox、Radio 和 Switch 中视觉隐藏输入框导致的溢出滚动。
v3.2.1
2026 年 6 月 17 日
补丁版本:@heroui/react 不再内置自己的 react-aria 副本。react-aria 的子路径在 Rollup 构建中被外部化,使消费方解析到项目中安装的单一 react-aria,而非内联副本。同时修复了 SwitchGroup 横向布局。
v3.2.0
2026 年 6 月 6 日
基于 React Aria 1.18 的 Calendar 周/日视图、重做的年份选择器与范围日历演示,新增 Tooltip 延迟主题变量,并纳入随之发布的补丁修复。破坏性变更:Radio、Checkbox、Switch 改为显式的 *.Content 组合(控件嵌套进 *.Content,标签为纯文本、不嵌套 <Label>,帮助文本变为兄弟节点)。
v3.1.0
2026 年 5 月 25 日
小版本发布:新增中文 React 文档与本地化示例,加入更可访问的 soft foreground 令牌和 vibrant palette 选项,统一滚动条系统,修复 useTheme、Toast、Fieldset、Link、浮层问题,并改进 Table、Picker 与 MenuItem 的 RTL 支持。
v3.0.5
2026 年 5 月 15 日
补丁版本:Text 重命名为 Typography 以解决 tailwind-merge 冲突(⚠️ 破坏性变更),派生颜色令牌重构为无前缀源变量,Checkbox 与 Radio 的 field-border 边框样式对齐,Calendar 悬停改用 accent-soft-foreground 以提升可读性,并新增 CLI 文档页。
v3.0.4
2026 年 5 月
补丁版本:从 HeroUI Pro 移植的全新 Text 复合组件、文档主题选择器、在 45+ 个组件 CSS 文件中采用 min() 上限约束的圆角令牌、重做的 Table 聚焦环,以及对 Checkbox、Autocomplete、Tooltip 与表单字段内边距的修复。
v3.0.3
2026 年 4 月 17 日
补丁版本:升级到 React Aria Components 1.17(合并依赖、安装更快、Table 支持可展开行),为 Vite 与 CRA 提供 useTheme Hook,为轻量级组件提供 DOM 多态的 render prop,并修复了 NumberField 的重置问题以及嵌套 Tabs 的样式问题。
v3.0.2
2026 年 4 月 3 日
修复了多个 bug,Drawer 过渡更加平滑,新增了 --backdrop 主题变量,并优化了 trigger、arrow 与 Tag 的样式。修复了 Autocomplete 弹出层的宽度跟踪问题,浮层触发器现在使用 inline-block,Tag 在间距与无障碍方面也有所改进。
v3.0.0
2026 年 3 月
面向 React 与 React Native 的彻底重写。包含 75+ Web 组件、37 个原生组件、Tailwind CSS v4、React Aria、复合组件架构、基于 OKLCH token 的 CSS 优先主题、通过 data-reduce-motion 控制动画,并面向利用 MCP Server、Agent Skills 与 LLMs.txt 的 AI 辅助开发而打造。
HeroUI Pro
面向 React 与 React Native 的高级组件、模板与 AI 工具。预售价格现已上线。
v3.0.0-rc.1
2026 年 3 月 14 日
新增七个组件(Drawer、ToggleButton、ToggleButtonGroup、Meter、ProgressBar、ProgressCircle、Toolbar),为 Table 和 ListBox 引入了 虚拟化,ButtonGroup 新增 ButtonGroup.Separator 与垂直方向支持,React Aria Components 升级到 v1.16.0。
v3.0.0-beta.8
2026 年 3 月 2 日
此版本新增三个组件(Badge、Pagination、Table),并为 DateField 与 TimeField 提供了新的 InputContainer 组合 API。⚠️ 破坏性变更:TextField 的 CSS 类已从 .text-field 重命名为 .textfield。
v3.0.0-beta.7
2026 年 2 月 18 日
此版本引入了完整的日期与时间系统,包含四个新组件(Calendar、RangeCalendar、DatePicker、DateRangePicker),新增了 Switch.Content 子组件、显式的 Tabs.Separator 用于按需启用分隔线,以及 ⚠️ 破坏性变更:从 Tabs 中移除 hideSeparator,并将 DateInputGroup / ColorInputGroup 合并到各自的 Field 组件之下。
v3.0.0-beta.6
2026 年 2 月 6 日
此版本引入了完整的颜色系统,包含六个新组件(ColorPicker、ColorArea、ColorSlider、ColorField、ColorSwatch、ColorSwatchPicker),对 Toast 进行了重大改进,加入了加载状态与 Promise 支持,Separator 新增变体,以及 ⚠️ 破坏性变更:将 Toast.Container 重命名为 Toast.Provider,并将 CSS 类名统一为连字符格式。
v3.0.0-beta.5
- 修复构建问题
v3.0.0-beta.4
2026 年 1 月 20 日
此版本引入了用于可视化主题定制的全新主题构建器、三个新组件(Autocomplete、Breadcrumbs、Toast),为 Tabs 添加了 secondary 变体,为 Input 与 InputGroup 添加了 primary / secondary 变体,以及 ⚠️ 破坏性变更:移除了 Link 的下划线变体,并从表单组件中移除了 isInSurface prop。
v3.0.0-beta.3
2025 年 12 月 19 日
此版本引入了七个新组件(ButtonGroup、DateField、ErrorMessage、ScrollShadow、SearchField、TagGroup、TimeField),为表单与输入组件添加了 fullWidth 支持,为 Tabs、ButtonGroup 和 Accordion 引入 hideSeparator 以获得更简洁的布局,包含若干样式修复,以及 ⚠️ 破坏性变更:移除 asChild prop,并更新了 AlertDialog 与 Modal 的 backdrop 变体。
v3.0.0-beta.2
2025 年 11 月 20 日
此版本引入了六个重要的新组件(AlertDialog、ComboBox、Dropdown、InputGroup、Modal、NumberField),增强了主题兼容性与动效偏好支持,改进了 Select 组件的 API(包含 ⚠️ 破坏性变更),并附带多项优化和 bug 修复。
v3.0.0-beta.1
2025 年 11 月 6 日
此版本对 HeroUI v3 进行了全面重新设计,将 v2 的美观与动效与 v3 的简洁性融为一体。所有组件均经过重新设计,新增 8 个组件(Alert、Checkbox、InputOTP、ListBox、Select、Slider、Surface),并对设计系统进行了彻底重构,包括更完善的颜色 token、阴影体系与整体架构。本版本还包含对设计系统变量、组件 API 以及灵活组件模式的破坏性变更。
早期版本
v3.0.0-alpha.35
2025 年 10 月 21 日
React Server Components 支持
- 修复了复合组件在 React Server Components(RSC)中无法正常工作的关键问题
- 将复合组件模式的逻辑从组件移至 index 文件,解决
"use client"冲突 - (⚠️ 破坏性变更):主组件现在需要
.Root后缀(例如<Avatar>→<Avatar.Root>) - 命名导出保持不变,并完全继续支持
React 19 相关改进
Switch 组件重构
- (⚠️ 破坏性变更):将 Switch 与 SwitchGroup 拆分为独立组件
- 更简洁的 API:
<SwitchGroup>取代<Switch.Group>和<Switch.GroupItems> - 与 Radio / RadioGroup 模式保持一致
- 各自拥有独立的样式、类型和实现
受影响的组件
以下复合组件均需要使用 .Root 后缀:Accordion、Avatar、Card、Disclosure、Fieldset、Kbd、Link、Popover、Radio、Switch、Tabs、Tooltip
v3.0.0-alpha.34
2025 年 10 月 15 日
- 新增基于表单的组件:Description、FieldError、Fieldset、Form、Input、Label、RadioGroup、TextField 以及 TextArea
- 引入表单字段相关的 token
--field-* - 按类别重新组织 Storybook
- (破坏性变更):在 Skeleton 中将
--skeleton-default-animation-type重命名为--skeleton-animation - 统一了各组件中
data-slot标记的命名 - 改进了文档
v3.0.0-alpha.33
2025 年 10 月 5 日
- 将 RAC 升级至 2025 年 10 月 2 日发布的版本
- 调整了 Tabs 中 Indicator 的顺序(破坏性变更)
- 将 Tabs 组件改为使用 React Aria 的
SelectionIndicator,现已支持 SSR - 更新了 Disclosure 和 Disclosure Group 组件,使其在展开/折叠动画中使用 RAC 的 CSS 变量
- 更新了 Switch 组件的样式与动画
- 为 Switch 新增
size变体并补充了对应演示 - 在 Button、Tabs、Disclosure、Disclosure Group 中添加了相关示例
- 改进了文档
v3.0.0-alpha.32
2025 年 10 月 1 日
重新设计了 Card 组件,引入了新变体,新增了 CloseButton 组件,发布了面向 AI 编码助手的 MCP 服务器,并改进了文档。
v3.0.0-alpha.31
2025 年 9 月 22 日
- 🎨 展示页面 - 使用 HeroUI 构建的站点案例集
- 🌀 DisclosureGroup 组件 - 将多个 Disclosure 组合在一起
- 📇 Card 组件(预览) - Card 组件的首个版本
- 🔀 Switch 组件(预览) - 用于设置项的切换开关
发布周期
HeroUI v3 现已稳定。后续版本将遵循固定的发布周期:
- 补丁版本:按需修复 bug 与小幅优化
- 次要版本:新增组件与功能,通常每月一次
- 主版本:包含架构层面的变更,并提供迁移指南
参与贡献
发现问题或希望参与贡献?欢迎查看我们的 GitHub 仓库。
Apps Docs Content Docs En Native Components Index (`apps/docs/content/docs/en/native/components/index.mdx`)
title: All Components (Native)
Buttons
Collections
Controls
Forms
Navigation
Overlays
Feedback
Layout
Media
Data Display
Typography
Utilities
Apps Docs Content Docs En Native Getting Started Index (`apps/docs/content/docs/en/native/getting-started/index.mdx`)
title: Introduction icon: book-open image: https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/native/heroui-native-og-light-1.webp
HeroUI Native is a React Native component library built on Tailwind v4 via Uniwind and modern mobile development technologies. Every component comes with smooth animations, polished details, and built-in accessibility—ready to use, fully customizable.
HeroUI Ecosystem
- 🌐 HeroUI v3 (web) — React components with Tailwind CSS v4
- 📱 HeroUI Native (mobile) — Beautiful components for React Native
- 🤖 HeroUI Chat (text-to-app) — Create apps with natural language
- 🧠 UI for LLMs — New platform & MCPs coming soon
FAQ
Is HeroUI Native free?
Yes, completely free and open source under the Apache License 2.0.
Is it production-ready?
Yes, HeroUI Native is production-ready and actively used in production apps.
Can I customize the components?
Yes! Update default styles, animations or compose component parts differently. Every slot is customizable.
Does it work with TypeScript?
Fully typed with excellent IDE support and autocompletion.
What about accessibility?
Accessibility follows mobile development best practices with proper focus management, touch accessibility, and screen reader support built into every component.
Is there a Figma file?
Yes! Access our design system at HeroUI Figma Kit V3.
Get Involved
Join the community, share feedback, or contribute:
HeroUI Native is released under the Apache License 2.0.
Apps Docs Content Docs En Native Releases Index (`apps/docs/content/docs/en/native/releases/index.mdx`)
title: All Releases
Latest Release
v1.0.11
October 2026
This patch wraps component CSS in Tailwind's components cascade layer so user utilities override component defaults, adds Expo SDK 58 / React Native 0.88 / Gesture Handler 3 support, fixes Slider floating point noise with decimal steps, keeps ScrollShadow scroll-driven when Reduce Motion is enabled, and resolves several overlay and input bugs on Android.
v1.0.10
September 2026
This patch types Input, TextArea, SearchField, and InputGroup refs as native TextInput instances for React Native's Strict TypeScript API, fixes BottomSheet visibility on Android and during container resize, lets Skeleton variant="none" skip default layout animations, and refreshes Menu/Popover/Select anchor positions on window resize.
v1.0.9
August 2026
This patch reworks font weight resolution through Uniwind font-* utilities so custom-font apps get correct weights on iOS, fixes SearchField padding when optional slots are omitted, corrects Toast duration: 0 to auto-hide as documented, and restores Select/Dialog swipe-to-dismiss on Android under react-native-gesture-handler 3.
v1.0.8
July 2026
This release adds right-to-left layout support across the library: component styles move to Yoga logical properties, and direction-sensitive behavior in Slider, Skeleton, Switch, Tabs, InputGroup, Popover, and Menu resolves through a new isRTL provider config with a LayoutDirectionScope escape hatch for subtrees. It also makes heroui-native/styles declare its own @source, so class scanning no longer depends on a hardcoded node_modules path. Card.Header and TagGroup.List change how they align children, both with one-line overrides.
v1.0.7
July 2026
This release makes component surfaces extensible with a background prop and a matching background compound part, so the layer behind a surface can be replaced with any node. It also adds the GlassView layer component and a blur overlay variant for Dialog and Bottom Sheet, both backed by the optional expo-blur dependency. The Select trigger is restyled to a field look and Toast moves onto overlay theme tokens; the default theme registers no background content, so rendering is otherwise unchanged.
v1.0.6
July 2026
This release migrates every component's styling from inline Tailwind class strings to dedicated BEM-named CSS files, keeping tv() slots as thin references for easier overriding and maintenance. It also fixes a PortalHost reconciliation bug that caused Bottom Sheet, Dialog, Popover, and Select portals to inherit each other's state across screens, producing "ghost" open sheets.
v1.0.5
July 2026
This release upgrades the toolchain to Expo 57 / React Native 0.86 and refines field border styling with outline-based focus, active, and invalid states across form components. It also adds iOS Dynamic Type support to Typography, introduces provider-level text input configuration, and improves Popover, Menu, and Select with lighter, single-mount enter animations.
CLI v1.0.0
June 2026
🎉 A new CLI for scaffolding a HeroUI Native project in one command. npx create-heroui-native-app@latest my-app generates a complete Expo Router app with HeroUI Native, Uniwind, Tailwind CSS, every required peer dependency, and the provider wiring already in place — pick between a single-screen or tabs starter template.
v1.0.4
May 2026
This patch release renames the Text typography component to Typography (with deprecated Text exports preserved for backward compatibility), refines soft-foreground theme tokens across Alert, Avatar, Button, Chip, and Toast with an optional heroui-native/styles/vibrant palette, documents the iOS native modal offset workaround for Menu, Popover, and Select, and upgrades the example app to Expo 56 / React Native 0.85 while bumping the @gorhom/bottom-sheet peer to ^5.2.9.
v1.0.3
May 2026
This patch release introduces the new Text typography component with Heading, Paragraph, and Code sub-components, fixes ScrollShadow support for inverted lists and Tabs indicator alignment in RTL layouts, and unifies the Select.TriggerIndicator animation when using custom children. It also makes Avatar's alt prop optional, refines Button, Chip, and Input styles, and corrects inner padding behavior for TextField and SearchField.
v1.0.2
April 2026
This patch release introduces the asChild slot pattern for PressableFeedback and Surface, adds VoiceOver modal containment support across all portal-based overlays, fixes an Android-specific Button outline variant styling issue, and refines Input and Select visual styles.
v1.0.1
April 2026
This patch release fixes a race condition in the Toast provider where the total SharedValue drifted from the actual toast count, corrects disabled-state styling across seven components to use the native disabled: modifier, and introduces the --backdrop theme variable for overlay components.
v1.0.0
March 2026
🎉 HeroUI Native reaches its first stable release, graduating from beta and release candidate stages. This milestone includes the new LinkButton component, sub-menu conflict resolution, an optional @gorhom/bottom-sheet peer dependency, and improved type safety for useThemeColor.
RC 4
March 2026
This release introduces the SubMenu compound component for nested expandable menus with animated expand/collapse, refactors Slider Output composition with slot-based styling and textProps forwarding, and fixes PressableFeedback ripple animation blink on rapid presses.
RC 3
February 2026
This release introduces three new components—TagGroup, Menu, and InputGroup—adds Android hardware back button support for all bottom-sheet-based overlays, and achieves Expo 55 compatibility with a critical combineStyles fix that preserves Reanimated animated style bindings.
RC 2
February 2026
This release introduces three new components—SearchField, ListGroup, and Slider—adds multi-selection mode to Select with type-safe generics, and refactors the Button feedback API into a unified feedbackVariant + animation prop pattern. Peer dependency constraints are relaxed for broader Expo SDK 55 compatibility, and several Select and Avatar bugs are fixed.
RC 1
February 2026
This release introduces the Alert compound component with five status variants and accessibility primitives, extracts Radio into a standalone component with dual-mode operation, and adds the animated Select.TriggerIndicator subcomponent. It also delivers HeroUINativeProviderRaw for bundle optimization, a disableFullWindowOverlay prop for iOS debugging, unified styles prop support across six components, and theme surface variable refactoring with explicit per-theme definitions.
Beta 13
February 2026
This release introduces the TextArea component for multiline text input, adds Button outline variant, exports style class names for all components, and includes a reusable CloseButton component. The release also refactors Tabs with improved animations and variant naming, decomposes form components into standalone primitives, and adds granular exports for bundle optimization. Critical bug fixes for theme colors and component stringification are also included.
Beta 12
January 2026
This release introduces three essential form components—InputOTP, Label, and Description—that enhance form building capabilities in React Native applications. The release also includes critical fixes for Popover close behavior, popup controlled state management, border radius configuration, and adds variant style prop support across multiple form components.
Beta 11
January 2026
This release enhances component reliability and developer experience with improved close coordination for Bottom Sheet, fixes for Dialog swipe-to-dismiss gestures, TextField styling improvements, and a new PortalHost export for advanced portal mounting scenarios. These updates ensure smoother interactions and provide more flexibility for custom layouts.
Beta 10
December 2025
This release introduces the new Bottom Sheet component, refactors PressableFeedback with improved API, extends the Animation API with State Prop support, enhances the use-theme-color hook to handle multiple colors selection, and includes various bug fixes and documentation improvements.
Release Schedule
HeroUI Native follows a regular release cycle:
- Stable releases: v1.0.0 shipped Q1 2026
- Patch releases: Bug fixes and minor improvements as needed
Contributing
Found an issue or want to contribute? Check out our GitHub repository.
Apps Docs Content Docs En React Components Index (`apps/docs/content/docs/en/react/components/index.mdx`)
title: All Components (React)
Buttons
Collections
Colors
Controls
Data Display
Date and Time
Feedback
Forms
Layout
Media
Navigation
Overlays
Pickers
Typography
Utilities
Apps Docs Content Docs En React Getting Started Index (`apps/docs/content/docs/en/react/getting-started/index.mdx`)
title: Introduction icon: book-open image: https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/heroui-og_2x.jpg
HeroUI is a React component library built on Tailwind CSS v4 and React Aria Components. Every component comes with smooth animations, polished details, and built-in accessibility—ready to use, fully customizable.
Why HeroUI?
Beautiful by default — Professional look out of the box, no extra styling needed.
Accessible — Built on React Aria Components with focus management, keyboard navigation, and screen reader support.
Flexible — Each component is made of customizable parts. Change what you need, leave the rest.
Developer-friendly — Fully typed APIs, predictable patterns, and excellent autocompletion.
Maintained — We handle updates, bug fixes, and new features. Just update the package.
Lightweight — Tree-shaken. Only what you use goes into your app.
Future-proof — Built for React 19 and Tailwind v4, designed for AI-assisted development.
A Living Library, Not Copy-Paste
Copy-paste code works until it breaks. You're left maintaining outdated dependencies that stop evolving.
HeroUI is different. It's a living library that grows with you:
- Automatic updates and fixes
- New features without extra work
- Components stay current with React, Tailwind, and browsers
- Deep customization, not shallow theme tweaks
- AI-friendly APIs for code generation
HeroUI v3 is not a snapshot—it's a garden that keeps growing. 🌱
HeroUI Ecosystem
- 🌐 HeroUI v3 (web) — You're here! React components with Tailwind CSS v4
- 📱 HeroUI Native (mobile) — Beautiful components for React Native
- 🤖 HeroUI Chat (text-to-app) — Create apps with natural language
- 🧠 UI for LLMs — New platform & MCPs coming soon
Why React Aria? We chose React Aria for accessibility at scale. We've used it since HeroUI v2, and v3 keeps familiar API conventions like isDisabled and onPress. Thanks to Devon Govett and the Adobe team.
FAQ
Is HeroUI free?
Yes, completely free and open source under the Apache License 2.0.
Is it production-ready?
Yes. HeroUI v3 is stable and ready for production use.
Can I customize the components?
Yes! Use Tailwind utilities, CSS variables, BEM modifiers, or compose component parts differently. Every slot is customizable.
Does it work with TypeScript?
Fully typed with excellent IDE support and autocompletion.
What about accessibility?
Built on React Aria Components for WCAG compliance. Keyboard navigation, focus management, and screen reader support included.
Can I use the styles without React?
Yes, the CSS can be applied to plain HTML. See our Tailwind Play example.
Is there a Figma file?
Yes! Access our design system at HeroUI Figma Kit V3.
Get Involved
Join the community, share feedback, or contribute:
HeroUI is released under the Apache License 2.0.
Apps Docs Content Docs En React Migration Agent Index (`apps/docs/content/docs/en/react/migration/agent-index.mdx`)
title: Migration (for AI assistants) index: false
For AI assistants: use this as the entry point when helping migrate HeroUI v2 → v3.
Entry
Choose a migration strategy:
- Full migration (project will be broken during migration) → read
(workflows)/agent-guide-full.mdx. - Incremental (v2 and v3 coexist) → read
(workflows)/agent-guide-incremental.mdx.
Reference in this bundle
- Cross-cutting guides:
hooks.mdx,styling.mdx. - The workflow guides above already inline the "major changes", "key API changes", component reference table, and "new components" sections.
- Per-component guides:
(components)/<component>.mdx(e.g.(components)/button.mdx,(components)/select.mdx). Use the component reference table in the workflow guides to find the right file.
Apps Docs Content Docs En React Migration Index (`apps/docs/content/docs/en/react/migration/index.mdx`)
title: Migration index: true
For AI Assistants
Below are three approaches for AI assistants to access migration documentation. We recommend using the HeroUI Migration MCP server and leveraging its prompts and tools, but all options provide agents with the complete documentation.
| Feature | MCP Server | Agent Skills | AGENTS.md |
|---|---|---|---|
| Data source | Remote endpoints | Remote endpoints | Local files |
| Access method | MCP tools | Script files | Local file reads |
| Setup | MCP config | Install command | heroui-cli command |
| Updates | Real-time | Real-time | Manual |
| Offline | ❌ | ❌ | ✅ |
| Tools | MCP tools + prompts | Scripts | ❌ |
| Guide | MCP Server → | Agent Skills → | AGENTS.md → |
Major Changes
- Dependencies: Update React to v19+, HeroUI packages to v3, Tailwind CSS to v4, remove Framer Motion
- No Provider Required: v3 removes the need for
HeroUIProvider - Component API Updates: Many components use React Aria Components patterns
- Compound Components: New compound component patterns for better customization. See individual component guides for details.
- Hooks Removed: v2 component hooks like
useSwitchoruseInputare removed - use compound components instead.useDisclosureis replaced withuseOverlayState. See the Hooks Migration Guide for details. - Configuration: Remove
heroui()plugin from Tailwind config, update CSS imports, removehero.tsfile - Item identity: Collection items (Dropdown, Listbox, Select, Accordion, etc.) now use
idandtextValuein v3; keep React'skeyfor lists.
Item identity and accessibility (key, id, textValue)
In v2, collection components (Dropdown, Listbox, Select, Accordion, etc.) used React's key as the item identity. The same value drove both React's list reconciliation and the component's selection/expand state. In v3, which uses React Aria Components, those roles are split:
id— v3 uses an explicitidprop on each item for selection state, focus, and callbacks (e.g.selectedKeys,expandedKeys,onSelectionChange). Use the same (or equivalent) value you used forkeyin v2 so that state and callbacks continue to refer to the correct item.textValue— v3 requirestextValueon items when the visible content is not plain text (e.g. when usingLabel, icons, orDescription). It is used for screen reader announcements and type-ahead.key— Keep using React'skeyon list items. It is still required for React's reconciliation and is independent ofid.
When migrating: add id (and textValue where needed) for v3's API, but keep key for React.
Migration Strategies
HeroUI v2 and v3 cannot coexist in the same project without special setup. You have two migration approaches to choose from:
Full Migration
Best for: Projects that can dedicate focused time to complete migration in one go.
How it works:
- Migrate all component code first (project will be broken during this phase)
- Switch dependencies to v3
- Complete styling migration
Advantages:
- Simpler setup - no complex coexistence configuration
- Cleaner transition - only one version active at a time
- Supported by Migration MCP prompts
Disadvantages:
- Project is broken during migration
- All components should be migrated before switching dependencies
Get started: Full Migration Guide
Incremental Migration
Best for: Projects that need to stay functional during migration, teams migrating gradually over time, large codebases migrating feature-by-feature.
How it works:
- Set up coexistence using pnpm aliases or component packages
- Migrate components one-by-one while keeping project functional
- Complete migration and remove v2 dependencies
Advantages:
- Project remains functional during migration
- Can migrate gradually over time
- Can test v3 components alongside v2
Disadvantages:
- More complex initial setup
- Potential styling conflicts
- Requires managing two versions simultaneously
Get started: Incremental Migration Guide
Component Migration Reference
Use the table below to quickly find migration guidance for each component. Use the link in the "Migration Guide" column to jump to detailed migration instructions.
| v2 Component | v3 Component | Status | Migration Guide |
|---|---|---|---|
| Accordion | Accordion | ✅ Available | View guide → |
| Alert | Alert | ✅ Available | View guide → |
| Autocomplete | ComboBox | ✅ Renamed | View guide → |
| Avatar | Avatar | ✅ Available | View guide → |
| Badge | Badge | ✅ Available | View guide → |
| Breadcrumbs | Breadcrumbs | ✅ Available | View guide → |
| Button | Button | ✅ Available | View guide → |
| ButtonGroup | ButtonGroup | ✅ Available | View guide → |
| Calendar | Calendar | ✅ Available | View guide → |
| Card | Card | ✅ Available | View guide → |
| Checkbox | Checkbox | ✅ Available | View guide → |
| CheckboxGroup | CheckboxGroup | ✅ Available | View guide → |
| Chip | Chip | ✅ Available | View guide → |
| Code | ❌ | ❌ Removed | View guide → |
| DateInput | DateField | ✅ Renamed | View guide → |
| DatePicker | DatePicker | ✅ Available | View guide → |
| DateRangePicker | DateRangePicker | ✅ Available | View guide → |
| TimeInput | TimeField | ✅ Renamed | View guide → |
| Divider | Separator | ✅ Renamed | View guide → |
| Drawer | Drawer | ✅ Available | View guide → |
| Dropdown | Dropdown | ✅ Available | View guide → |
| Form | Form | ✅ Available | View guide → |
| Image | ❌ | ❌ Removed | View guide → |
| Input | TextField, Input, InputGroup | ✅ Available | View guide → |
| InputOTP | InputOTP | ✅ Available | View guide → |
| Kbd | Kbd | ✅ Available | View guide → |
| Link | Link | ✅ Available | View guide → |
| Listbox | ListBox | ✅ Available | View guide → |
| Modal | Modal | ✅ Available | View guide → |
| Navbar | ❌ | ❌ Removed | View guide → |
| NumberInput | NumberField | ✅ Renamed | View guide → |
| Pagination | Pagination | ✅ Available | View guide → |
| Popover | Popover | ✅ Available | View guide → |
| Progress | ProgressBar | ✅ Renamed | View guide → |
| CircularProgress | ProgressCircle | ✅ Renamed | View guide → |
| Radio | Radio | ✅ Available | View guide → |
| RadioGroup | RadioGroup | ✅ Available | View guide → |
| RangeCalendar | RangeCalendar | ✅ Available | View guide → |
| Ripple | ❌ | ❌ Removed | See Button ripple → |
| ScrollShadow | ScrollShadow | ✅ Available | View guide → |
| Select | Select | ✅ Available | View guide → |
| Skeleton | Skeleton | ✅ Available | View guide → |
| Slider | Slider | ✅ Available | View guide → |
| Snippet | ❌ | ❌ Removed | View guide → |
| Spacer | ❌ | ❌ Removed | View guide → |
| Spinner | Spinner | ✅ Available | View guide → |
| Switch | Switch | ✅ Available | View guide → |
| Table | Table | ✅ Available | View guide → |
| Tabs | Tabs | ✅ Available | View guide → |
| Toast | Toast | ✅ Available | View guide → |
| Tooltip | Tooltip | ✅ Available | View guide → |
| User | ❌ | ❌ Removed | View guide → |
New Components in v3
v3 introduces a number of new components not available in v2:
| Component | Purpose | Documentation |
|---|---|---|
| TextField | Enhanced text input with label and description support | View docs → |
| TextArea | Multi-line text input component | View docs → |
| AlertDialog | Modal dialog for confirmations and alerts | View docs → |
| Label | Accessible form label component | View docs → |
| Description | Helper text for form fields | View docs → |
| FieldError | Form field error message display | View docs → |
| Fieldset | Group related form fields | View docs → |
| InputGroup | Compose multiple inputs together | View docs → |
| Surface | Container component with elevation styles | View docs → |
| Disclosure | Expandable/collapsible content sections | View docs → |
| DisclosureGroup | Compound component for multiple disclosure sections | View docs → |
| SearchField | Search input with clear button and optional loading state | View docs → |
| DateField | Date input with calendar picker | View docs → |
| TimeField | Time input component | View docs → |
| Tag, TagGroup | Tags and tag group for selection or display | View docs → |
| ColorPicker | Color selection (ColorArea, ColorField, ColorSlider, ColorSwatch, ColorSwatchPicker) | View docs → |
| CloseButton | Dismiss or close trigger button | View docs → |
| ErrorMessage | Form field error display (React Aria integration) | View docs → |
Additional Migration Guides
- Hooks Migration Guide: Detailed guide for migrating hooks from v2 to v3
- Styling Migration Guide: Comprehensive guide for updating utility classes, color tokens, and component styling
Getting Help
If you encounter issues during migration:
- Check the v3 documentation
- Review component-specific migration guides
- Check the GitHub Discussions
- Join the Discord community
Apps Docs Content Docs En React Releases Index (`apps/docs/content/docs/en/react/releases/index.mdx`)
title: All Releases
Latest Release
v3.2.6
September 17, 2026
Patch release: AvatarGroup returns as a dedicated component, focus rings are keyboard-only again on ListBox, Dropdown, Select, and overlay triggers after a mouse-driven open, @internationalized/date moves to peerDependencies while tailwind-merge and @react-aria/i18n are dropped, ColorSlider no longer warns on every render in production, bare .tag markup keeps its default padding, Breadcrumbs sit back on the spacing grid, and React Aria is upgraded to 1.21.1 ([email protected]). Context values are also memoized across 43 components, so consumers no longer re-render on every root render.
v3.2.5
September 8, 2026
Patch release: Toast collapses notifications into a stack that expands on hover, Select gains a ClearButton, Tabs adds an align variant, @heroui/react re-exports Pressable, Focusable, OverlayTriggerStateContext, and DisclosureStateContext, and React Aria is upgraded to 1.21.0 ([email protected]). Also fixes theme tokens in nested data-theme scopes and shadow DOM, native :focus-visible rings on exported variants, and modal-level overlays being covered by closing popovers, plus ScrollShadow, Table, Drawer, NumberField, Accordion, Label, and Tag.
v3.2.4
August 4, 2026
Patch release: the Autocomplete popover no longer clips its last options, backdrop clicks dismiss a Modal with scroll="outside" again, Tabs chevron scrolling lands flush on the edges, tailwind-variants is upgraded to 3.3.1 to fix variant modifiers falling back to the wrong class after a re-render, React Aria is upgraded to 1.20.0 ([email protected]), and @heroui/react gains a behavioral test suite.
v3.2.3
July 30, 2026
Patch release: ComboBox adds multiple selection, styles adopt logical CSS properties for better RTL support, tailwind-variants is upgraded to 3.3.0, plus fixes for ScrollShadow, Spinner, InputOTP, Table, and accent Button focus styling.
v3.2.2
June 19, 2026
Patch release: upgrades to React Aria 1.19.0 ([email protected]), adds overflow scrolling to Tabs.ListContainer, fixes clear/close buttons accidentally submitting their surrounding form, and prevents visually hidden inputs in Checkbox, Radio, and Switch from causing overflow scroll.
v3.2.1
June 17, 2026
Patch release: @heroui/react no longer bundles its own copy of react-aria. The react-aria subpaths are externalized in the Rollup build, so consumers resolve to the single react-aria installed in their project instead of a vendored copy. Also fixes SwitchGroup horizontal layout.
v3.2.0
June 6, 2026
Calendar week and day views, a reworked year picker, and range demos on React Aria 1.18, plus tooltip delay theme variables and the patch fixes shipped with it. Breaking: Radio, Checkbox, and Switch move to an explicit *.Content composition (control nests inside *.Content; the label is plain text, no nested <Label>; help text becomes a sibling).
v3.1.0
May 25, 2026
Minor release: Chinese React docs and localized demos, accessible soft foreground tokens with a vibrant palette opt-in, a shared scrollbar system, fixes for useTheme, Toast, Fieldset, Link, overlays, and improved RTL support across Table, pickers, and MenuItem.
v3.0.5
May 15, 2026
Patch release: Text is renamed to Typography to resolve a tailwind-merge collision (⚠️ breaking change), derived color tokens are refactored into unprefixed source variables, Checkbox and Radio get aligned field-border styling, Calendar hover uses accent-soft-foreground for readability, and a new CLI docs page is added.
v3.0.4
May 2026
Patch release: new Text compound component ported from HeroUI Pro, docs theme selector, min()-capped border-radius tokens across 45+ component CSS files, reworked Table focus rings, and fixes for Checkbox, Autocomplete, Tooltip, and form field padding.
v3.0.3
April 17, 2026
Patch release: React Aria Components 1.17 (dependencies consolidation, faster installs, Table expandable rows), the useTheme hook for Vite and CRA, a DOM polymorphic render prop for lightweight components, and fixes for NumberField resets and nested Tabs styling.
v3.0.2
April 3, 2026
Bug fixes, smoother Drawer transitions, new --backdrop theme variable, and style refinements for triggers, arrows, and tags. Autocomplete popover width tracking fixed, overlay triggers now inline-block, and Tag gets improved spacing + accessibility.
v3.0.0
March 2026
A ground-up rewrite for React and React Native. 75+ web components, 37 native components, Tailwind CSS v4, React Aria, compound component architecture, CSS-first theming with OKLCH tokens, data-reduce-motion animation control, and built for AI-assisted development with MCP servers, agent skills, and LLMs.txt.
HeroUI Pro
Premium components, templates, and AI tooling for React and React Native. Pre-sale pricing is live.
See plans and pricing at heroui.pro →
v3.0.0-rc.1
March 14, 2026
Seven new components (Drawer, ToggleButton, ToggleButtonGroup, Meter, ProgressBar, ProgressCircle, Toolbar), virtualization for Table and ListBox, ButtonGroup.Separator + vertical orientation for ButtonGroup, and React Aria Components bumped to v1.16.0.
v3.0.0-beta.8
March 2, 2026
This release adds three new components (Badge, Pagination, Table) and new InputContainer composition APIs for DateField + TimeField. ⚠️ Breaking changes: TextField CSS classes were renamed from .text-field to .textfield.
v3.0.0-beta.7
February 18, 2026
This release introduces a comprehensive Date & Time system with four new components (Calendar, RangeCalendar, DatePicker, DateRangePicker), new Switch.Content sub-component, explicit Tabs.Separator for opt-in separator lines, and ⚠️ breaking changes removing hideSeparator from Tabs and consolidating DateInputGroup/ColorInputGroup under their respective field components.
v3.0.0-beta.6
February 6, 2026
This release introduces a comprehensive Color System with six new components (ColorPicker, ColorArea, ColorSlider, ColorField, ColorSwatch, ColorSwatchPicker), major Toast improvements with loading states and promise support, Separator variants, and ⚠️ breaking changes renaming Toast.Container to Toast.Provider and updating CSS class names to hyphenated format.
v3.0.0-beta.5
- Fixed build issue
v3.0.0-beta.4
January 20, 2026
This release introduces the new Theme Builder for visual theme customization, three new components (Autocomplete, Breadcrumbs, Toast), secondary variant for Tabs, primary/secondary variants for Input and InputGroup, and ⚠️ breaking changes removing Link's underline variants and isInSurface prop from form components.
v3.0.0-beta.3
December 19, 2025
This release introduces seven new components (ButtonGroup, DateField, ErrorMessage, ScrollShadow, SearchField, TagGroup, TimeField), adds fullWidth support for form and input components, introduces hideSeparator to Tabs, ButtonGroup, and Accordion for cleaner layouts, includes styling fixes, and ⚠️ breaking changes removing the asChild prop and updating AlertDialog & Modal backdrop variant.
v3.0.0-beta.2
November 20, 2025
This release introduces six essential new components (AlertDialog, ComboBox, Dropdown, InputGroup, Modal, NumberField), enhances theme compatibility and motion preferences, improves the Select component API with a ⚠️ breaking change, plus various refinements and bug fixes.
v3.0.0-beta.1
November 6, 2025
This release introduces a comprehensive redesign of HeroUI v3, merging v2's beauty and animations with v3's simplicity. All components have been redesigned, 8 new components added (Alert, Checkbox, InputOTP, ListBox, Select, Slider, Surface), and the design system has been completely overhauled with better color tokens, shadows, and architecture. Includes breaking changes to design system variables, component APIs, and flexible component patterns.
Previous Releases
v3.0.0-alpha.35
October 21, 2025
React Server Components Support
- Fixed critical issue where compound components didn't work in React Server Components (RSC)
- Moved compound pattern logic from components to index files, resolving
"use client"conflicts - (⚠️ Breaking change): Main component now requires
.Rootsuffix (e.g.,<Avatar>→<Avatar.Root>) - Named exports remain unchanged and fully supported
React 19 Improvements
Switch Component Refactoring
- (⚠️ Breaking change): Split Switch and SwitchGroup into separate components
- Cleaner API:
<SwitchGroup>replaces<Switch.Group>and<Switch.GroupItems> - Matches Radio/RadioGroup pattern for consistency
- Separate styles, types, and implementations
Affected Components
All compound components now require .Root suffix: Accordion, Avatar, Card, Disclosure, Fieldset, Kbd, Link, Popover, Radio, Switch, Tabs, Tooltip
v3.0.0-alpha.34
October 15, 2025
- Added Form-based components: Description, FieldError, Fieldset, Form, Input, Label, RadioGroup, TextField, and TextArea.
- Introduced form field tokens
--field-* - Reorganized Storybook by category
- (Breaking change): Renamed
--skeleton-default-animation-typeto--skeleton-animationin Skeleton - Aligned data-slot markers across components
- Improved documentation
v3.0.0-alpha.33
October 5, 2025
- Upgraded RAC with October 2, 2025 Release
- Reordered Tabs Indicator (Breaking change)
- Updated Tabs component to use React Aria's
SelectionIndicator, now supports SSR - Updated Disclosure and Disclosure Group components to use RAC CSS variables for the expand and collapse animations
- Updated Switch component styles and animations
- Added
sizevariants and added demo in Switch - Added related showcases in Button, Tabs, Disclosure, Disclosure Group
- Improved documentation
v3.0.0-alpha.32
October 1, 2025
Card component redesigned with new variants, added CloseButton component, MCP Server for AI coding assistants, and improved documentation.
v3.0.0-alpha.31
September 22, 2025
- 🎨 Showcases page - Gallery of sites built with HeroUI
- 🌀 DisclosureGroup component - Groups multiple disclosures together
- 📇 Card component (preview) - First version of card component
- 🔀 Switch component (preview) - Toggle switch for settings
Release Schedule
HeroUI v3 is now stable. Future releases follow a regular cycle:
- Patch releases: Bug fixes and minor improvements as needed
- Minor releases: New components and features, typically monthly
- Major releases: Architectural changes with migration guides
Contributing
Found an issue or want to contribute? Check out our GitHub repository.
Apps Docs AGENTS (`apps/docs/AGENTS.md`)
This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in node_modules/next/dist/docs/ (resolved from this file's directory; in monorepos the next package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by next dev — verify at node_modules/next/dist/server/lib/generate-agent-files.js. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
Apps Docs Package.Json (`apps/docs/package.json`)
{
"name": "@heroui/docs",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"predev": "node scripts/build-skills.mjs && node scripts/build-theme-presets.mjs",
"dev": "next dev",
"prebuild": "node scripts/build-skills.mjs && node scripts/build-theme-presets.mjs",
"build": "next build",
"start": "next start",
"test": "vitest run",
"lint": "eslint --max-warnings=0",
"lint:fix": "eslint --fix",
"typecheck": "tsc --noEmit",
"typegen": "next typegen",
"postinstall": "fumadocs-mdx",
"test:skills": "node test_skills_scripts.mjs",
"test:skills:dev": "node test_skills_scripts.mjs --env dev",
"test:skills:staging": "node test_skills_scripts.mjs --env staging",
"test:skills:prod": "node test_skills_scripts.mjs --env production"
},
"dependencies": {
"@fumadocs/language": "0.0.1",
"@gravity-ui/icons": "2.22.0",
"@heroui/agent": "1.0.0-beta.14",
"@heroui/react": "workspace:",
"@iconify-json/gravity-ui": "1.2.14",
"@iconify/react": "6.0.2",
"@internationalized/date": "3.12.4",
"@lglab/react-qr-code": "1.7.3",
"@react-aria/overlays": "3.32.1",
"@react-stately/data": "3.16.1",
"@t3-oss/env-nextjs": "0.13.11",
"@tailwindcss/typography": "0.5.20",
"@tanstack/react-table": "9.2.4",
"@vercel/analytics": "1.6.1",
"@vercel/og": "0.8.6",
"calligraph": "1.4.1",
"clsx": "2.1.1",
"color-convert": "3.1.3",
"color2k": "2.0.4",
"culori": "4.0.2",
"feed": "5.1.0",
"fumadocs-core": "16.9.3",
"fumadocs-mdx": "14.2.14",
"fumadocs-typescript": "5.0.1",
"fumadocs-ui": "16.9.3",
"lucide-react": "0.562.0",
"m3-ripple": "1.1.3",
"motion": "12.23.28",
"next": "16.4.2",
"next-mdx-remote": "6.0.0",
"next-themes": "0.4.6",
"nuqs": "2.10.1",
"posthog-node": "5.52.6",
"react": "19.3.0",
"react-aria-components": "1.21.1",
"react-dom": "19.3.0",
"remark": "15.0.1",
"remark-gfm": "4.0.1",
"remark-mdx": "3.1.1",
"shiki": "3.20.0",
"tailwind-merge": "3.7.0",
"tailwind-variants": "3.3.1",
"ts-morph": "27.0.2",
"usehooks-ts": "3.1.1",
"yaml": "2.9.0",
"zod": "4.6.5"
},
"devDependencies": {
"@heroui/standard": "workspace:",
"@heroui/styles": "workspace:*",
"@tailwindcss/postcss": "4.3.3",
"@types/color-convert": "2.0.4",
"@types/culori": "4.0.1",
"@types/mdx": "2.0.14",
"@types/react": "19.3.0",
"@types/react-dom": "19.3.0",
"babel-plugin-react-compiler": "1.0.0",
"postcss": "8.5.28",
"source-map-support": "0.5.21",
"tailwindcss": "4.3.3",
"tar": "7.5.22",
"typescript": "5.9.3",
"vitest": "4.1.11"
}
}
Apps Docs Tsconfig.Json (`apps/docs/tsconfig.json`)
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@heroui/standard/tsconfig/next.json",
"compilerOptions": {
"jsx": "preserve",
"paths": {
"@/.source": ["./.source/server.ts"],
"@/.source/": ["./.source/"],
"@/": ["./src/"],
"~env": ["./env.ts"]
}
},
"include": ["/*.ts", "/.tsx", "env.ts", "next-env.d.ts", ".next/types/**/.ts"],
"exclude": ["node_modules"]
}
Apps Docs Public .Well Known Assetlinks.Json (`apps/docs/public/.well-known/assetlinks.json`)
[
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "android_app",
"package_name": "com.herouinative.android",
"sha256_cert_fingerprints": [
"62:D8:E2:37:B2:F1:18:99:A5:08:6B:65:95:53:24:3F:5B:A2:A8:95:78:9E:AA:A3:D2:82:55:1F:83:74:7F:2E",
"77:AC:EE:FC:3F:03:A2:E7:5F:5F:08:B1:53:C9:F1:25:8C:31:0A:F1:D9:63:C9:DE:FE:F8:31:CE:F1:9A:37:9E"
]
}
}
]
Apps Docs Content Blog Cn Best React Ui Component Libraries (`apps/docs/content/blog/cn/best-react-ui-component-libraries.mdx`)
title: "2026 年 12 个最佳 React UI 组件库" date: "2026-05-16" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["react", "ui-libraries", "comparison"] image: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/blog/heroui-overview-light.png" darkImage: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/blog/heorui-overview-dark.png"
选择合适的 React UI 组件库,会直接影响你的开发体验。2026 年最佳的 React UI 组件库都提供了开箱即用、可访问性良好的生产级组件,让你专注于产品功能,而不是第 N 次重新实现下拉菜单。
我从样式方案、可访问性基础、组件广度、AI 工作流支持和授权许可这几个维度,对比了 12 个库。各项目的组件数量与定价随时可能变化,因此请将本文视为一份实用的速查指南,最终决策前请查阅各自的官方文档。
速览对比
| 组件库 | 样式方案 | 可访问性基础 | 组件广度 | AI 工作流 |
|---|---|---|---|---|
| HeroUI | Tailwind CSS v4 | React Aria | MCP 服务器、llms.txt、agent skills | |
| shadcn/ui | Tailwind CSS | Radix UI 及其他基础组件 | 官方文档列出 59 个组件条目 | MCP 服务器、llms.txt、skills |
| Material UI | 默认使用 Emotion,可接入 Pigment CSS | MUI 自研实现 | 核心组件 + MUI X,覆盖极广 | 公开文档 |
| Chakra UI | 基于 Panda CSS API 的体系 | Chakra / Ark UI 生态 | 应用层组件覆盖广泛 | MCP 服务器与公开文档 |
| Mantine | CSS 文件 / CSS Modules | Mantine 自研实现 | 120+ 个组件,70+ 个 hooks | MCP 服务器、llms.txt、skills |
| Radix UI | 无样式 | Radix 基础组件 | 聚焦基础组件 | 公开文档 |
| Ant Design | CSS-in-JS / Token 体系 | Ant Design 自研实现 | 偏企业级 | 公开文档 |
| Headless UI | 无样式 | Headless UI 基础组件 | 聚焦基础组件 | 公开文档 |
| React Aria | 无样式 | React Aria | 深度的基础原语层 | 公开文档 |
| Ark UI | 无样式 | Zag.js 状态机 | Headless 组件 | 公开文档 |
| Tremor | Tailwind CSS v4 | 面向仪表盘的组件 | 数据分析 / 数据展示 | 公开文档 |
| Park UI | Panda CSS / Tailwind | Ark UI | 带样式的 Ark 组件 | 公开文档 |
1. HeroUI
HeroUI 将 React Aria 的可访问性能力与 Tailwind CSS v4 样式系统、以及复合组件 API(Card.Header、Table.Column、Modal.Body)结合在一起。组件原生支持 React 19 与 Next.js App Router。
核心优势:
- 可访问性优先的架构。 每个组件都构建在 React Aria 之上 —— Adobe 经过大规模生产验证的可访问性原语。这意味着屏幕阅读器支持、键盘导航和 ARIA 属性都是开箱即用、正确实现的,而不是事后再补上的功能。
- 原生支持 Tailwind CSS v4。 HeroUI 的样式系统采用基于 CSS 的主题方案,通过
@theme与设计 token 实现,避免了 CSS-in-JS 的运行时开销。 - 复合组件 API。 组件采用可组合的模式(
Card.Header、Card.Content、Card.Footer),让你在不牺牲易用性的前提下完全掌控标签结构与布局。 - AI 工具支持。 HeroUI 提供了 MCP 服务器、llms.txt 和 agent skills,让 AI 编码助手能查到最新的 HeroUI API,而不必只依赖训练数据。
- 对服务端组件友好。 组件在设计时就考虑了 React Server Components —— 客户端边界精简且文档清晰。
适用场景: 你需要一个现代化、可访问性良好的组件库,搭配 Tailwind CSS 样式系统和一流的 AI 工具支持。非常适合使用 Next.js、React 19 与 Tailwind v4 的新项目。
2. shadcn/ui
shadcn/ui 并不是传统意义上的组件库 —— 它是基于 Radix UI 与 Tailwind CSS 的一组可复制粘贴的组件。你不需要安装某个 npm 包,而是把组件源码直接加入项目。
核心优势:
- 完全的所有权。 组件代码就在你的代码库里,可以随意修改,无需对抗库的抽象,也不必等待上游变更。
- 基于 Radix UI 的可访问性。 底层原语稳定地处理了弹出层、下拉选择、对话框等复杂交互的可访问性。
- CLI 工具。
shadcnCLI 可以将组件、依赖与文件结构一键脚手架到你的项目中。 - 面向 AI 的文档。 shadcn/ui 同时发布了
llms.txt、skills 以及 MCP 服务器,供 AI 代理使用。 - 庞大的生态。 社区围绕 shadcn 的模式构建了数百个扩展、主题与集成方案。
适用场景: 你希望对组件代码拥有最大控制权,并愿意自己维护这些被复制进来的组件。适合需要大量定制化的团队。
权衡点: 你拥有代码,也就拥有了 bug。上游的修复和改进都需要手动重新合并,没有集中式的升级机制。此外,shadcn/ui 建立在 Radix UI 之上,存在一定的不确定性 —— 原 Radix 团队已将重心转向 Base UI,Radix 基础组件的长期维护状态在社区中仍是一个悬而未决的问题。
3. Material UI (MUI)
Material UI 是最成熟的 React 组件库,已在生产环境中使用了十年。MUI 稳定的样式路径仍然以 Emotion 与 sx prop 为核心;Pigment CSS 则作为零运行时的实验性方向存在,并非默认选项。
核心优势:
- 组件数量庞大。 拥有超过 70 个组件,几乎覆盖了你能想到的所有 UI 模式 —— 从基础按钮到复杂的数据网格。
- 遵循 Material Design。 如果你的设计系统基于 Material Design,MUI 可以提供像素级精准的实现。
- 企业级生态。 MUI X 提供高级组件(数据网格、日期选择器、图表),并附带企业级支持与 SLA。
- 成熟且久经考验。 数以千计的生产应用运行在 MUI 之上,多年来许多边缘场景都已被发现并修复。
适用场景: 你正在构建一个大型企业级应用,需要遵循 Material Design 规范,或者需要使用 MUI X 的高级数据网格和日期选择器组件。
权衡点: Material Design 的美学风格非常鲜明。把它改造成完全不同的外观虽然可行,但需要相当大的投入。包体积也比大多数同类方案更大。
4. Chakra UI
Chakra UI 在 React 中率先推广了 "style props" 模式,让你能用 bg="blue.500"、p={4} 这样的 props 来设置样式。Chakra 当前的主题文档描述了一套围绕 Panda CSS API 构建的体系,包含 defineConfig、createSystem、recipes、slot recipes、tokens 与语义化 tokens。
核心优势:
- 直观的样式 API。 Style props 让你不必离开 JSX,就能快速完成设计的原型与迭代。
- 设计 token 体系。 通过 theme 对象集中管理颜色、间距、字体和断点。
- 良好的可访问性默认值。 组件遵循 WAI-ARIA 模式并内置键盘导航支持。
- 基于 recipe 的样式方案。 Chakra 使用 recipe、slot recipe 与基于 token 的体系来组织组件样式。
- AI 支持。 Chakra 提供了用于 AI 辅助工作流的 MCP 服务器文档。
适用场景: 你更喜欢通过 props 而非 class 名来设置样式,并且希望拥有一套默认值统一的设计系统。
权衡点: 对于复杂组件,style props 模式会让 JSX 显得比较冗杂。从 v2 升级到 v3 需要较多改动,因为组件与主题 API 都发生了变化。
5. Mantine
Mantine 是一个功能非常齐全的 React 组件库,组件目录非常宽广,还附带一个 hooks 包以及丰富的扩展生态。Mantine 官网当前将该库描述为提供 120+ 个组件和 70+ 个 hooks。
核心优势:
- 覆盖面无可匹敌。 Mantine 拥有大量组件和扩展,几乎涵盖各种产品需求 —— 日期选择器、通知、Spotlight 搜索、图表、表单等等。
- 庞大的 hooks 包。 除了组件之外,Mantine 还提供了 localStorage、媒体查询、剪贴板、空闲检测等大量常用模式的 hooks。
- 基于 CSS 的样式方案。 Mantine 组件基于 CSS 文件构建,可通过 Styles API 进行自定义。
- AI 工具支持。 Mantine 提供了 LLM 文档、skills 与 MCP 服务器。
- 表单库。
@mantine/form提供了状态管理与校验的能力,可以与 Mantine 输入组件无缝集成。
适用场景: 你想要一个开箱即用、包罗万象的库,几乎任何使用场景都能找到对应组件,而无需再引入第三方包。
权衡点: 巨大的表面积意味着如果不仔细做 tree-shaking,包体积会迅速膨胀。组件设计风格虽然简洁,但相对鲜明。
6. Radix UI (Primitives)
Radix UI 提供了一组无样式、可访问的 UI 基础组件,由你自行决定如何赋予样式。它是 shadcn/ui 以及许多其他组件库的底层基础。
核心优势:
- 可访问性标杆。 每个基础组件都按照 WAI-ARIA 规范构建,键盘导航、焦点管理与屏幕阅读器支持都极其完善。
- 默认无样式。 不预设任何设计立场,也就不必和库的美学风格博弈。把你自己的样式体系带上即可。
- 可组合的 API。 基础组件采用复合组件模式,通过基于 slot 的组合方式,让你对每一个被渲染的元素都有掌控权。
- 经过生产验证。 通过直接使用以及 shadcn/ui,Radix 基础组件已经支撑了数千个生产应用。
适用场景: 你需要只提供行为、不带样式的可访问基础组件,并希望对样式有完全控制权。非常适合构建定制化设计系统的团队。
权衡点: 所有样式都需要自己实现。对于较简单的使用场景,组合模式的学习曲线可能略陡。
7. Ant Design
Ant Design 是由蚂蚁集团(阿里巴巴)创建的综合性设计系统与组件库,在企业级应用以及中国开发者社区中尤为流行。
核心优势:
- 企业级组件。 Table(支持排序、过滤、分页)、Form(带校验)、Tree 等复杂组件都非常成熟、功能丰富。
- 附带完整的设计系统。 Ant Design 不仅是组件库,还是一套完整的设计系统,包括设计 tokens、模式与规范指南。
- 国际化支持出色。 一流的 i18n 支持,提供 60+ 个本地化包。
- 组件质量高。 每个组件都处理了大量边缘情况,你自己实现的话需要花费大量时间。
适用场景: 你正在构建复杂的企业级应用,尤其是需要复杂数据表格、表单与树形视图的场景。
权衡点: 设计风格非常鲜明的 "Ant Design 范",要改造成不同的外观需要相当多的工作。包体积较大。可访问性虽然在不断改进,但仍落后于基于 Radix / React Aria 的库。
8. Headless UI
Headless UI 是 Tailwind Labs 团队提供的一组无样式、可访问的 UI 组件,专注于常见的交互模式 —— 下拉菜单、对话框、Tabs、组合框等。
核心优势:
- 与 Tailwind CSS 深度集成。 出自 Tailwind 团队,与 Tailwind 的工具类与过渡工具配合得天衣无缝。
- 小巧而聚焦。 仅覆盖那些真正难以做到可访问的组件(菜单、列表框、对话框等)。
- 轻量。 由于聚焦的组件集合,对包体积的影响极小。
- 简洁的 API。 使用 render props 和复合组件,API 简单且可预测。
适用场景: 你正在使用 Tailwind CSS,需要少量可访问的交互组件,但不想引入一整套 UI 库。
权衡点: 组件集合非常小 —— 数据表格、表单输入、日期选择器等大多数模式都需要另寻他解。
9. React Aria (Primitives)
React Aria 是 Adobe 出品的 React 可访问性原语库。它提供 hooks 与组件,帮助你从零构建可访问的 UI。
核心优势:
- 业界领先的可访问性。 React Aria 可以说是目前可用的最完善的可访问性原语库。它处理了国际化、从右到左布局、触摸交互,以及大多数库都会忽略的边缘情况。
- Hooks + 组件。 同时提供低层 hooks(最大灵活性)与高层组件(更便捷)。
- 平台感知。 根据设备类型、指针类型与平台惯例自动调整行为。
- 众多库的底层基础。 HeroUI、Adobe Spectrum 以及其他库都建立在 React Aria 之上,证明了它在大规模场景下的可靠性。
适用场景: 你正在从零构建设计系统,需要尽可能强大的可访问性基础。当你需要特定基础组件(例如颜色选择器或日历)而其他库无法提供时,它也很有用。
权衡点: 比带样式的库学习曲线更陡。你需要自行实现所有样式与组合模式。
10. Ark UI
Ark UI 出自 Chakra UI 的作者团队,是一个 headless 组件库,底层基于状态机,行为高度可预测。
核心优势:
- 状态机架构。 底层使用 Zag.js 状态机,组件行为可预测、易于调试。
- 框架无关的内核。 同一套状态机驱动每个组件的 React、Vue 与 Solid 版本。
- 现代模式。 提供了签名板、Pin 输入框、分栏器等其他 headless 库中较少见的组件。
- 样式方案灵活。 可搭配任何样式方案 —— Tailwind、Panda CSS、原生 CSS、CSS Modules 都行。
适用场景: 你想要带可预测状态管理的 headless 组件,或者需要在 React、Vue 与 Solid 项目之间复用组件逻辑。
权衡点: 社区规模小于 Radix 或 React Aria。状态机抽象在简单组件上会带来额外的概念负担。
11. Tremor
Tremor 专注于仪表盘与数据可视化。其当前文档显示 Tremor Raw 面向 React 18.2+ 与 Tailwind CSS 4.0+ 设计。
核心优势:
- 以仪表盘为中心。 针对数据分析、仪表盘 UI 与数据展示提供专门的资源。
- Tailwind 原生。 无需额外样式配置,即可与现有 Tailwind 项目无缝集成。
- 简洁的默认样式。 图表与指标卡开箱即用,外观精致、设计语言统一。
- 聚焦的范围。 只关注数据展示,可以按需取用,而不必引入整套 UI 框架。
适用场景: 你正在构建数据分析仪表盘或数据密集型界面,并已经在使用 Tailwind CSS。
权衡点: 仅限于仪表盘相关组件。对于表单、导航、对话框等通用 UI 模式,你需要另寻他库。
12. Park UI
Park UI 是构建在 Ark UI 基础组件之上的带样式组件库,提供 Panda CSS 与 Tailwind CSS 两种版本。
核心优势:
- 预先样式化的 Ark UI。 在 Ark UI 的 headless 组件基础上叠加了精致、可定制的样式 —— 类似 shadcn/ui 对 Radix 的做法。
- 支持双样式方案。 提供 Panda CSS 与 Tailwind CSS 两种变体,按项目情况选择即可。
- 复制粘贴模式。 与 shadcn/ui 一样,组件以源码形式加入你的项目,你拥有它们并可自由定制。
- 设计 tokens。 自带 token 体系,可以方便地进行全局样式调整。
适用场景: 你喜欢 shadcn/ui 的复制粘贴模式,但更倾向于使用基于状态机的 Ark UI 而非 Radix,或者你正在使用 Panda CSS。
权衡点: 相比 shadcn/ui,社区与生态规模更小,第三方扩展和主题也较少。
如何选择
并不存在一个绝对"最好"的库 —— 正确的选择取决于你项目的约束条件:
- 使用 Tailwind v4 开始新项目? HeroUI 提供了最现代的技术栈:React Aria 可访问性、复合组件以及 AI 工具支持。
- 想完全拥有组件代码? shadcn/ui 或 Park UI 让你直接把组件复制进项目。
- 构建有复杂数据需求的企业级应用? MUI 的数据网格或 Ant Design 的表格组件难以被超越。
- 需要最强的可访问性合规? HeroUI 基于 React Aria 的底层提供了开箱即用的最强可访问性。
- 希望拥有一套高质量的通用 UI 工具箱? HeroUI 覆盖了所有核心 UI 模式并具备深度的可访问性;对于富文本编辑器等特定需求,可以搭配专门的库一起使用。
- 跨多个框架工作? Ark UI 的状态机可以同时在 React、Vue 与 Solid 中使用。
开始使用 HeroUI
如果你正在启动一个新的 React 项目,希望使用可访问性良好、设计精美、基于 Tailwind CSS v4 的组件,那么不妨试试 HeroUI:
Apps Docs Content Blog Cn Styling And Theming In Heroui Native (`apps/docs/content/blog/cn/styling-and-theming-in-heroui-native.mdx`)
title: "HeroUI Native 的样式与主题机制" date: "2026-07-31" author: "Volodymyr Serbulenko" authorHandle: "@v_serbulenko" authorUrl: "https://x.com/v_serbulenko" authorAvatar: "https://avatars.githubusercontent.com/u/115154506?v=4" tags: ["native", "react-native", "styling", "theming", "css", "design-system"] image: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/blog/heroui-native-styling.jpg"
大多数 React Native 组件库都在 JavaScript 中定义外观。组件的样式可能写在 StyleSheet.create 调用中、styled-components 模板里,或是通过 React context 层层传递的主题对象中。这些方式都能奏效,但有两件事做起来并不顺手:在不 fork 组件库的情况下覆盖其内部样式,以及将一套截然不同的视觉主题打包成可安装的资源。
HeroUI Native 选择了另一条路。组件外观定义在随包发布的真正的 .css 文件中,而主题机制则从头到尾都基于 CSS 变量。本文将介绍这一选择背后的原则,以及它们如何实现一种不常见的能力:将完整的视觉风格 —— 甚至包括并非由你编写的组件内部细节 —— 打包成一份可安装的样式表。
React Native 组件库中的 CSS
HeroUI Native 基于 Uniwind 构建,后者将 Tailwind CSS v4 带到了 React Native。Uniwind 接入 Metro 打包工具,读取 CSS 入口文件,并解析 React Native 视图上的 className。样式表不会在设备运行时解析 —— CSS 在应用打包时就已处理完毕。
这带来了真正的 CSS 编写能力。安装组件库只需安装依赖包,再在 CSS 入口文件中添加一条导入语句:
/* global.css */
@import "tailwindcss";
@import "uniwind";
@import "heroui-native/styles";
@source "./node_modules/heroui-native/lib";这一条导入语句就会引入整个样式系统:设计 tokens、浅色和深色主题、自定义工具类,以及所有组件的 CSS。此后,className 就是主要的样式 API:
import {View, Text} from "react-native";
<View className="bg-background flex-1 px-4">
<Text className="text-foreground text-lg">Your app content</Text>
</View>;关键不只是 Tailwind 类名能在 React Native 中使用,而是组件库自身的样式也用同样的 CSS 编写,存放在你可以阅读和覆盖的文件里,而非编译成只能通过 props 访问的 JavaScript 对象。
三层设计 tokens
主题系统分为三层,将它们分开是降低自定义成本的关键。
第一层是基础值。 这些值不会随主题变化:固定颜色、基础边框宽度、基础圆角,以及禁用状态的不透明度。
@theme {
--white: oklch(100% 0 0);
--radius: 0.5rem;
--border-width: 1px;
--opacity-disabled: 0.5;
}第二层是各主题的语义变量。 这些变量描述的是用途,而非具体数值 —— 背景、表面、强调色、危险状态等,每个主题都会重新定义它们:
@layer theme {
:root {
@variant light {
--background: oklch(0.9702 0 0);
--surface: var(--white);
--accent: oklch(0.6204 0.195 253.83);
}
@variant dark {
--background: oklch(12% 0.005 285.823);
--surface: oklch(0.2103 0.0059 285.89);
--accent: oklch(0.6204 0.195 253.83);
}
}
}第三层是派生层。 这一层最能体现系统的价值。语义变量会映射到 Tailwind 的颜色命名空间,让 bg-accent 这样的工具类能够生效;与此同时,每种颜色的各种状态也会据此计算出来:
@theme inline static {
--color-accent: var(--accent);
--color-accent-hover: color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%);
--color-accent-soft: color-mix(in oklab, var(--accent) 15%, transparent);
--color-accent-soft-hover: color-mix(in oklab, var(--accent) 20%, transparent);
}原则很简单:只需定义一次颜色,就能自动获得它的整套衍生配色。 在应用中覆盖 --accent,按下状态、柔和背景、柔和前景以及柔和配色的按下状态都会随之变化。组件库无需预先知道你的品牌色。
同样的思路也适用于形状尺寸。圆角尺寸体系由一个基础值派生而来,因此修改一个变量,就能按比例调整整个系统中的所有圆角:
--radius-lg: calc(var(--radius) * 1);
--radius-xl: calc(var(--radius) * 1.5);
--radius-3xl: calc(var(--radius) * 3);使用 OKLCH 定义颜色、使用 OKLab 混合颜色,是有意为之。基于感知的色彩空间能让派生出的悬停状态保持一致的视觉效果,无论基础色是浅黄色还是高饱和度的蓝色。当基础色由你从未见过的用户提供时,这正是所需的特性。
前景色配对规则
一个命名约定就能解决很多问题。不带后缀的变量表示背景色;同名变量加上 -foreground 后缀,则表示应当显示在该背景之上的前景色。
例如 --accent 与 --accent-foreground、--surface 与 --surface-foreground、--danger 与 --danger-foreground。
这样,对比度就成了每个主题在设计时只需做一次的决定,无需在每个组件中反复判断。编写自定义主题时,只要提供每组配对的两个值,所有使用该语义角色的组件就会自动获得清晰可读的文本。
组件样式写在 CSS 中
每个组件都有一份样式表,其中的类名描述了组件的结构与变体:
.button__root--variant-primary {
background-color: var(--color-accent);
}
.button__root--size-sm {
height: calc(var(--spacing) * 10);
padding-inline: calc(var(--spacing) * 3.5);
border-radius: var(--radius-3xl);
}TypeScript 不负责生成这些样式,而是使用 tailwind-variants 选择要应用的样式:
const root = tv({
base: "button__root",
variants: {
variant: {
primary: "button__root--variant-primary",
secondary: "button__root--variant-secondary",
},
size: {
sm: "button__root--size-sm",
md: "button__root--size-md",
},
},
});因此,CSS 是外观的唯一依据,TypeScript 则负责将 props 映射到相应的样式。这带来了两个结果。
首先,重新设计样式可以直接从已有规则入手,无需不断叠加额外的样式机制。组件自身的类就是普通 CSS,调整某个变体只需为它编写 CSS —— 不必与内联样式对象对抗,也不必等待组件库新增某个 prop。
其次,变体映射是公开的。每个组件都会导出自己的 classNames 对象,因此你可以构建与组件库外观完全一致的基础组件:
import {buttonClassNames, cn} from "heroui-native";
import {Pressable, Text} from "react-native";
<Pressable className={cn(buttonClassNames.root({variant: "primary", size: "md"}))}>
<Text className={buttonClassNames.label({variant: "primary", size: "md"})}>Continue</Text>
</Pressable>;自定义链接、可按压的自定义列表行、第三方控件的封装 —— 都能直接采用完全相同的按钮样式,无需从组件库中复制具体的样式值。
并非所有样式都适合放在 CSS 中,组件库也没有强行这么做。React Native 有些属性没有对应的 CSS 写法,还有一些样式由 Reanimated 驱动。这些样式仍保留在 StyleSheet 和组件的动画层中,且优先级高于 className。这是刻意安排的顺序,确保动画和平台特有的行为不会被某个工具类悄然覆盖。
一个主题就是一个 `@variant` 块
浅色模式和深色模式并没有特殊待遇。它们各自都是一个重新定义语义变量的 @variant 块,你也可以按需添加任意数量的主题。在 Metro 配置中向 Uniwind 注册它们即可:
module.exports = withUniwindConfig(config, {
cssEntryFile: "./global.css",
dtsFile: "./src/uniwind.d.ts",
extraThemes: ["ocean-light", "ocean-dark"],
});切换主题只需一次调用:
import {Uniwind} from "uniwind";
Uniwind.setTheme("ocean-dark");这个过程不经过 React 主题 Provider。变量由 Uniwind 解析,因此主题变化不会触发贯穿整棵组件树的 context 更新。虽然有 HeroUINativeProvider,但它负责的是安全区域边距、文本默认设置、Toast 挂载容器以及 RTL 布局 —— 它是应用的基础设施,并非主题引擎。
Pro 主题的实现模式
由于 tokens 是变量,组件样式是 CSS 类,一套完整的视觉风格就能打包成一份样式表。HeroUI Native Pro 正是这样提供主题的,整个过程分为两步。Brutalism(粗野主义)主题与默认外观差异极大,能清楚地展示这两个步骤。
第一步,重新调整 tokens。 Brutalism 的整个变量文件只有大约十五行:
@layer theme {
:root {
@variant light {
--accent: var(--foreground);
--accent-foreground: var(--background);
--radius: 0px;
--field-radius: 0px;
--field-border-width: 1px;
--field-border: var(--border);
--surface-shadow: 0 0 0 0 transparent;
--field-shadow: 0 0 0 0 transparent;
}
}
}这就完成了颜色和形状尺寸的全部调整。由于圆角尺寸是派生的,--radius: 0px 能一次性将整个组件库的圆角变成直角。表单字段读取各自的 tokens,因此一行就能为所有输入框加上细边框,再通过阴影变量移除柔和的悬浮层次感。--accent: var(--foreground) 也值得仔细看一下 —— 主题的强调色相对于当前调色板采用单色设计,而非硬编码某个颜色,因此仍能适应底层的浅色、深色或自定义调色板。
第二步,调整组件内部样式。 有些风格特征无法用 token 表达。Brutalism 希望标签使用大写的展示字体,并为特定按钮变体添加细边框。由于组件样式就是普通的 CSS 类,主题只需为它们编写规则:
.button__label {
font-family: var(--brutalism-font-display);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.button__root--variant-secondary,
.button__root--variant-tertiary,
.button__root--variant-outline {
border-width: 1px;
border-color: var(--color-border);
}这就是该主题对按钮的全部样式覆盖。Switch 只需两行,Widget 只需三行。整个主题由大约三十个这样的小文件组成,同时覆盖基础组件与 Pro 组件,只需在基础样式之后添加一条导入语句即可引入:
@import "heroui-native/styles";
@import "heroui-native-pro/styles";
@import "heroui-native-pro/themes/brutalism";这种模式的价值在于:主题能够改变并非由它定义的组件内部元素的样式 —— 按钮中的标签、开关中的滑块、Widget 图例中的圆点 —— 无需额外的 prop、主题对象字段,也无需 fork。在样式写在 JavaScript 中的组件库里,要像这样修改组件内部文本的样式,前提是组件库预先考虑到了这个需求,并为该元素提供了专门的自定义接口。而在这里,整棵组件树默认都可以被定位,因为样式使用 CSS 编写,类名也稳定地反映了组件结构。
主题还可以引入自己的变量。上面的 --brutalism-font-display 由主题自行定义,再由应用赋值。对于主题无法自行提供的资源,就可以通过这种方式交给应用配置:
@layer theme {
:root {
@variant light {
--brutalism-font-display: "Anton-Regular";
}
}
}这些操作不依赖任何特权。Pro 主题所做的事,你自己的 global.css 完全可以做到:调整一些变量,再覆盖需要修改的类。区别只在于打包方式,而非能力。
这套机制带来的价值
将这些原则结合起来,可以得到以下好处:
- 自定义不妨碍升级。 通过覆盖 tokens 和编写 CSS 来调整外观,无需 fork 组件内部实现,因此可以继续接收组件库更新。
- 一处修改,全局生效。 一个强调色或基础圆角的变化,会传递到系统中所有相关的派生状态和尺寸。
- 主题机制独立于 React。 主题定义在 CSS 中,通过 Uniwind 切换,不会触发贯穿组件树的 context 更新。
- 主题可以独立发布。 完整的视觉风格就是一份样式表,可以像其他依赖一样发布、管理版本和安装。
- 与 HeroUI 的其他部分保持相同概念。 语义角色、前景色配对、复合组件,都与你在 Web 端使用的理念一致。
- AI 智能体也能读懂。 用 CSS 变量表达设计 tokens、用 CSS 类表达组件样式,都是 AI 助手擅长处理的格式,因此 MCP 服务器 和 llms.txt 端点能够准确描述这套样式系统。
下一步
先阅读快速开始,完成 Uniwind 和样式表的配置;再阅读样式,了解 className 与样式优先级规则;通过主题查阅完整的变量参考和自定义主题指南。如果你打算编写自己的主题,颜色文档提供了完整的语义调色板。
Apps Docs Content Blog Cn Why Choose Heroui For Your Design System (`apps/docs/content/blog/cn/why-choose-heroui-for-your-design-system.mdx`)
title: "为什么选择 HeroUI 作为你的设计系统" date: "2026-05-17" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["heroui", "design-system", "react", "ui-libraries"] image: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/heroui-og_2x.jpg" darkImage: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/heroui-og-black_2x.jpg"
大多数 React 组件库都在解决同一个问题:不再重复造按钮。但设计系统往往会在另一个阶段出问题 —— 当你选用的库无法灵活贴合产品需求时;当可访问性是发布之后才匆忙补上的考量时;又或者当你的 AI 编码助手凭空臆造出根本不存在的 props 时。
HeroUI 将 React Aria 的可访问性、Tailwind CSS v4 的样式系统,以及一套复合组件 API 结合到一起 —— 让你拥有结构上的掌控权,又不必让 props 数量失控。本文将给出选择它作为设计系统基础的具体理由。
技术栈
| 分层 | 技术 | 原因 |
|---|---|---|
| 可访问性 | React Aria (Adobe) | 业界领先的 WCAG 基础原语,由 Adobe 积极维护 |
| 样式 | Tailwind CSS v4 | 静态 CSS、零运行时、通过 @theme 定义设计 tokens |
| 组件 API | 复合组件 | Card.Header、Modal.Body —— 结构可控,不必让 props 失控 |
| 类型 | TypeScript | 完整类型覆盖、泛型 props、兼容严格模式 |
| AI 工具 | MCP 服务器、llms.txt、agent skills | 让 AI 助手能拿到最新 API,而非陈旧的训练数据 |
| 跨平台 | HeroUI Native (React Native) | 同一套设计系统覆盖 Web 与移动端 —— 目前没有其他开源库能做到这一点 |
真正达到企业级标准的可访问性
每个 HeroUI 组件都构建在 React Aria 之上 —— Adobe 的可访问性原语库。这不是营销话术:React 生态中没有比它更深入的可访问性基础,它甚至支撑着 Adobe 自己的生产级设计系统(Spectrum),覆盖 Photoshop Web、Acrobat 和 Lightroom 等产品。
React Aria 处理了大多数库都未顾及的部分:
- 感知平台的键盘导航。 Mac、Windows 与 Linux 在 Home/End、option/alt+方向键和焦点行为上有着不同的惯例。React Aria 会自动适配。
- 屏幕阅读器的播报。 实时区域、状态消息以及动态内容播报,在 JAWS、NVDA 和 VoiceOver 上都能正确工作。
- 触摸交互。 移动端的长按、拖放与手势处理 —— 不仅仅是点击事件。
- 国际化。 从右到左布局、按区域格式化日期/数字,以及对 30+ 种语言的字符串排序支持。
- 虚拟焦点。 对于包含成千上万项的集合,React Aria 在保持性能的同时仍能正确通知屏幕阅读器。
这些都很重要,因为在 2026 年,可访问性合规已经不再是可选项。政府、医疗、金融与教育行业都要求符合 WCAG。HeroUI 把这种合规作为默认能力提供,而不是需要额外升级才能获得的特性。
React Aria 与 Radix UI 的对比
许多流行的库(如 shadcn/ui、Park UI)都构建在 Radix UI 之上。Radix 本身很扎实,但原团队已将重心转向 Base UI,Radix 基础组件的长期维护仍是未定之数。React Aria 则由 Adobe 持续维护 —— 一家自身产品就严重依赖它的公司。
原生支持 Tailwind CSS v4
HeroUI 不是把 Tailwind 当作兼容层 —— 它从一开始就是为 Tailwind CSS v4 设计的。
这意味着:
- 零运行时 CSS 开销。 所有样式都是静态 CSS,在构建时就被解析完毕。没有 CSS-in-JS 的运行时计算,没有样式注入,也没有水合(hydration)成本。
- 通过 CSS 自定义属性定义设计 tokens。 主题以标准 CSS
@theme指令的形式存在,而不是 JavaScript 配置对象。改一个 token,所有组件随之更新。 - 基于工具类的自定义。 用
className覆盖任意组件 —— 与你在项目其他地方使用 Tailwind 的方式完全一致。 - 更小的输出体积。 Tailwind v4 的新引擎生成的 CSS 更少,再加上 HeroUI 的模块化导入,能让你的生产环境包保持精简。
<Button variant="secondary" className="font-semibold tracking-wide">
Get Started
</Button>
<Card className="max-w-md shadow-lg">
<Card.Header className="pb-0">
<Card.Title className="text-xl font-bold">Dashboard</Card.Title>
</Card.Header>
<Card.Content className="py-4">
Your metrics here
</Card.Content>
</Card>如果你的团队已经在用 Tailwind,引入 HeroUI 不会带来第二套样式系统。如果你还没用 Tailwind,是否采用它是另一个独立的决定 —— 但这是 2026 年大多数 React 团队都已经做出的选择。
复合组件 API
HeroUI 采用复合组件 —— 父组件通过点号语法暴露其子组件的模式。这与 Radix UI 的做法相同,并且在复杂 UI 上比基于 props 的 API 扩展性更好。
<Modal>
<Button>Open</Button>
<Modal.Backdrop>
<Modal.Container>
<Modal.Dialog>
<Modal.Header>
<Modal.Heading>Confirm</Modal.Heading>
</Modal.Header>
<Modal.Body>Are you sure?</Modal.Body>
<Modal.Footer>
<Button variant="ghost">Cancel</Button>
<Button>Confirm</Button>
</Modal.Footer>
</Modal.Dialog>
</Modal.Container>
</Modal.Backdrop>
</Modal>这种模式对设计系统的意义:
- 结构可控。 可以在组件的各个部分之间重新排列、省略或插入自定义元素,而不必与库的内部布局对抗。
- 细粒度的样式。 可以为任意子组件单独应用
className,让Card.Header与Card.Footer拥有不同样式,无需 CSS 覆盖。 - TypeScript 校验。 编译器会检查你的组件树结构 —— 错误嵌套在构建时就会被发现,而不是带到生产环境。
- JSX 可读性强。 组件的层级结构直接映射到 UI 的视觉层级。新成员阅读代码即可理解布局。
+ 个组件
HeroUI 提供
- 数据输入 —— Input、Textarea、NumberField、Select、ComboBox、Autocomplete、DatePicker、DateRangePicker、ColorPicker、Slider、Switch、Checkbox、Radio
- 数据展示 —— Table(排序、选择、分页)、Avatar、Badge、Chip、Tag、Skeleton
- 布局 —— Card、Surface、Separator、Fieldset
- 导航 —— Tabs、Breadcrumbs、Pagination、Link
- 反馈 —— Toast、ProgressBar、ProgressCircle、Meter、Spinner
- 覆盖层 —— Modal、Drawer、Popover、Tooltip、Dropdown、AlertDialog
- 展开/折叠 —— Accordion、Disclosure
- 动作类 —— Button、ToggleButton、ToggleButtonGroup
像 Calendar、DatePicker、ColorPicker 和 Table 这样的复杂组件都是自包含的 —— 它们在内部处理日期运算、本地化格式、键盘导航以及屏幕阅读器播报。这些组件想做到真正可访问其实非常困难,而 HeroUI 把它们作为持续维护、经过测试的原语提供出来。
面向 AI 的原生工具
如今,绝大多数开发者每天都在使用 AI 编码助手。生成代码的质量取决于 AI 是否拥有你所用组件库的准确上下文 —— 否则就只能凭借陈旧的训练数据猜测。
HeroUI 提供了四项官方集成:
MCP 服务器
一个 Model Context Protocol 服务器,AI 代理可以通过它查询组件文档、API、源码与设计 tokens。可接入 Cursor、Claude Code、Windsurf,或任何兼容 MCP 的编辑器。
当 AI 助手能够访问 MCP 服务器时,它可以查到任意 HeroUI 组件的复合组件结构、可用 props 以及正确的 import —— 不再需要凭空臆造。
llms.txt
一个结构化参考文件,位于 heroui.com/llms.txt,为 LLM 提供整个库的精炼且准确的参考。这是一个标准化格式,AI 工具会读取它来避免生成已废弃的写法。
Agent Skills
为 Cursor、Claude Code 等 AI 工具预构建的 skill 文件,帮助 AI 代理掌握 HeroUI 的约定 —— 包括正确的 import、复合组件模式、样式方案以及项目脚手架。
AGENTS.md
一份 AGENTS.md 文件,为 AI 编码代理提供仓库级上下文。它描述了项目结构、编码约定与组件模式,让代理从第一次 prompt 起就理解你的代码库。
一旦 AI 编码助手成为生产工作流的一部分,也值得评估专用推理容量。像 Morph 这样的提供商,会为高并发代码生成、搜索与 apply 工作负载的团队提供预留容量,让 agent 功能在用量增长时仍能保持快速、可靠。
结果是: AI 助手能够生成正确的 HeroUI v3 代码,使用正确的复合组件模式、import 路径与 Tailwind 类名。这一点至关重要,因为错误的 AI 输出在调试上耗费的时间,远多于它生成代码本身节省的时间。
生态系统
HeroUI Pro
HeroUI Pro 在基础库之上扩展了应用级组件与模板:
- AppLayout、Sidebar、Navbar —— 包含响应式行为的完整应用外壳
- DataGrid —— 支持类型化列、排序与过滤的高密度数据表格
- KPI、NumberValue、TrendChip —— 仪表盘指标组件
- LineChart、BarChart —— 数据可视化
- Sheet、CommandMenu —— 高级覆盖层模式
- 模板 —— 仪表盘、财务、聊天与邮件应用等起点模板
Pro 是付费产品 —— 当你需要的不仅是 UI 组件,更是应用级基础设施时再使用。
HeroUI Native
HeroUI 是目前唯一在 Web 与移动端上都能提供同等组件质量的开源设计系统。HeroUI Native 把同一套设计 tokens、复合组件 API 以及可访问性标准带到 React Native —— 利用各平台的原生 API,而非简单地包装 WebView。
这意味着构建跨平台产品的团队可以在 React(Web)和 React Native(移动端)之间共享同一套设计系统,无需对任何一端妥协。统一的视觉语言、统一的组件模式、统一的主题 tokens —— 但在各端都使用原生渲染。
目前没有其他开源 React 组件库能够做到这一点。MUI、shadcn/ui、Chakra UI 与 Mantine 都仅限于 Web。如果你的产品需要同时支撑 Web 与移动端,HeroUI 是唯一一套能从同一基础覆盖两端的设计系统。
Figma Kit
HeroUI Figma Kit (v3) 让设计与代码保持同步。Figma 中的组件与 React 实现一一对应,设计师与开发者基于同一份真实来源进行工作。
Storybook
每个组件都有对应的 Storybook stories,展示所有变体、状态与组合方式。可用于可视化测试、设计评审与文档。
社区
HeroUI 并非新生事物 —— 我们已经构建了 5 年多,最早从 v1(最初的 NextUI)开始。社区规模稳步增长:GitHub 上有 29.3K+ stars,Discord 上有 9K+ 成员,每周还有数以千计的讨论、社区回答与 issue 被解决。
- GitHub —— 源码、issue 与讨论
- Discord —— 9K+ 成员,社区支持与公告
- X / Twitter —— 更新与版本发布
获得 Y Combinator 投资
HeroUI 获得了风险投资,包括 Y Combinator。这意味着我们有专职的全职团队、长期的维护承诺,以及持续交付所需的资源。在选用一个组件库时,你其实是在押注它的未来 —— HeroUI 的目标是长期存在。
开箱即用的设计品质
HeroUI 提供经过精心打磨的默认样式,不做任何主题定制看起来也很精致:
- 流畅的动画。 按钮带有细腻的按下反馈,弹窗以弹簧物理动效呈现,手风琴展开时使用自然的缓动曲线。
- 均衡的间距 tokens。 所有组件遵循统一的数学比例,padding、margin 与 gap 都保持一致。
- 阴影层级。 浅色与深色模式下都能良好工作的高度层级,无需手动调整。
- 主题变体。 内置 glass、brutalism 以及中性等多种视觉风格,通过设计 tokens 即可切换。
设计 token 体系基于 CSS 自定义属性,主题就是标准 CSS:
@theme {
--color-primary: oklch(0.6 0.25 260);
--radius-field: 0.5rem;
--shadow-surface: 0 1px 3px rgba(0, 0, 0, 0.08);
}修改 tokens,所有组件都会随之全局更新。不需要 JavaScript 主题对象,不需要 provider 包装,也没有运行时开销。
想要几次点击就把 HeroUI 变成你自己的样子?主题构建器允许你以可视化的方式自定义颜色、字体、圆角与间距 —— 然后导出一份可直接用于项目的 CSS 主题。
两步即可就绪
大多数组件库在渲染第一个组件之前,都需要配置文件、provider 包装、主题对象与插件设置。HeroUI 不需要。整个安装过程只有两步:
1. 安装:
npm i @heroui/styles @heroui/react2. 在你的 CSS 中加一行:
@import "tailwindcss";
@import "@heroui/styles"; /* 就这些 */接下来即可使用任意组件 —— 不需要 ThemeProvider、不需要 ChakraProvider、不需要 MantineProvider,也不需要任何配置对象:
import { Button, Card } from "@heroui/react";
export default function Page() {
return (
<Card>
<Card.Content>
<Button>Click me</Button>
</Card.Content>
</Card>
);
}整个配置就是这些。不需要用 provider 包裹整个应用,不需要主题配置文件,也不需要任何运行时初始化。安装、引入一行 CSS,然后就可以开始构建。查看快速开始指南,五分钟内即可上手。
服务端组件
HeroUI 的设计契合 React Server Components 的模型:
- 静态组件(
Card、Badge、Text、Separator、Avatar)可以留在服务端组件树中,不带任何客户端 JavaScript。 - 交互式组件(
Button、Modal、Table、Select)使用客户端边界 —— 每个组件都有清晰的文档说明。 - 不强制使用 provider —— 没有迫使整个组件树进入客户端边界的客户端 context。
这意味着你的页面默认会输出更少的 JavaScript。静态布局在服务端渲染,交互式部件仅在需要的位置进行水合(hydration)。
一些权衡
HeroUI 采用聚焦的策略:与其交付所有可能的组件,我们更优先保证团队最常使用组件的深度、可访问性与品质。对于富文本编辑、拖放或图表等专门需求,我们建议将 HeroUI 与擅长这些特定问题的专业库搭配使用 —— 这比依赖单一库覆盖所有场景效果更好。
HeroUI 是为 Tailwind CSS v4 构建的。如果你的团队已经在使用 Tailwind,引入它非常顺畅。如果你使用的是其他样式方案,迁移到 Tailwind 是一个独立但值得的投入 —— 那是面向现代 CSS 工具链的一笔投资。
谁适合使用 HeroUI
如果你正在构建以下产品,HeroUI 会是个不错的选择:
- SaaS 应用 —— 表单、表格、覆盖层与导航,并具备 React Aria 的可访问性
- 仪表盘与管理后台 —— 借助 HeroUI Pro 组件构建的高密度数据布局
- 电商门店 —— 高性能、可访问、对 SEO 友好的组件渲染
- 营销官网与落地页 —— 精致的默认样式,没有运行时 CSS 开销
- 跨平台产品 —— 借助 HeroUI Native,在 Web(React)与移动端(React Native)上共享同一套设计系统
- 任何重视可访问性、Tailwind CSS 集成与 AI 辅助开发的 React / Next.js 项目
开始使用
npm install @heroui/styles @heroui/react- 快速开始指南 —— 五分钟内即可完成配置
- 组件文档 —— 完整的 API 参考与在线示例
- 主题指南 —— 自定义设计系统
- MCP 服务器 —— 接入你的 AI 编码助手
- GitHub 仓库 —— 源码与 issue
Apps Docs Content Blog En Best React Dashboards (`apps/docs/content/blog/en/best-react-dashboards.mdx`)
title: "14 Dashboard Templates and Frameworks for React Teams in 2026" date: "2026-05-10" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["react", "dashboards", "templates"] image: "/images/blog/best-react-dashboards.jpg" draft: true
Building a React dashboard from scratch takes weeks — picking the right template, framework, or component stack can cut that down dramatically. The strongest options give you responsive layouts, data visualization patterns, accessible navigation, and a theme system you can actually maintain.
I pulled together 14 options worth checking in 2026. Pricing and feature gates change often, so use this as a shortlist and verify the current license before you buy or build on top of anything.
Quick Comparison
| Template / Framework | Type | Best reason to consider it |
|---|---|---|
| HeroUI Pro Dashboard | Template + Pro components | HeroUI-native app shell, sidebar, navbar, KPI, data grid, and chart patterns |
| Tremor | Dashboard UI resources | Tailwind v4 dashboard blocks and analytics-oriented UI |
| Refine | Framework | Data-provider driven CRUD/admin applications |
| AdminJS | Framework | Generated admin panels from backend models |
| React Admin | Framework | Mature admin framework with a large data-provider ecosystem |
| Ant Design Pro | Template/framework ecosystem | Ant Design and ProComponents-based admin apps |
| CoreUI | Template | Cross-framework admin template ecosystem |
| Tabler | Template | Bootstrap-based dashboard UI |
| Argon Dashboard | Template | Creative Tim dashboard aesthetic |
| Material Dashboard | Template | MUI / Material Design dashboard starting point |
| Berry | Template | MUI-based admin dashboard ecosystem |
| Mantis | Template | MUI-based admin dashboard ecosystem |
| shadcn/ui Dashboard | Example | Source-owned Tailwind dashboard example |
| HeroUI Pro + custom widgets | Pro components + template | Start from Pro layout/table/chart primitives, then add product-specific widgets |
1. HeroUI Pro Dashboard Template
HeroUI Pro offers pre-built dashboard templates designed specifically for SaaS products, admin panels, and analytics dashboards. Built on HeroUI v3 components with Tailwind CSS v4.
What you get:
- Complete dashboard layouts with sidebar navigation, header, and content areas
- Analytics pages with charts, metrics cards, and data tables
- Settings, analytics, orders, tracker, help, finance, chat, and email-style app surfaces across the current templates
- App shell patterns using
AppLayout,Sidebar, andNavbar - Pro dashboard widgets using
KPI,DataGrid,LineChart,NumberValue, andTrendChip - Dark mode support with HeroUI's theming system
- Responsive design that works on mobile and desktop
Key strengths:
- Production-quality components. Every component is built on React Aria with full accessibility support and keyboard navigation.
- Tailwind CSS v4. Modern styling with CSS-based theming, no runtime overhead.
- Next.js App Router ready. Templates are built for the latest Next.js with server components and streaming.
- AI tooling. Use HeroUI's MCP server with Cursor or other AI tools to extend and customize dashboards with AI assistance.
Pricing: Premium license through HeroUI Pro; check the current pricing page for details.
Best for: Teams building SaaS products who want accessible, modern dashboard components they can customize with Tailwind CSS.
2. Tremor
Tremor is focused on dashboard UI. Its current docs describe Tremor Raw as designed for React 18.2+ and Tailwind CSS 4.0+.
What you get:
- Dashboard-oriented UI resources
- Tremor Blocks for copy-paste dashboard sections
- Figma UI Kit for dashboard design work
- Tailwind CSS v4 setup guides
Key strengths:
- Dashboard-first design. The project is centered on analytics and dashboard interfaces.
- Tailwind native. Current docs target Tailwind CSS v4.
- Useful design resources. The docs link to Tremor Blocks and a Figma UI Kit.
Trade-offs: Limited to dashboard-specific components. You'll need another library for forms, navigation, and other general UI patterns.
Pricing: Check Tremor's current site and repository before choosing it for a commercial project.
Best for: Teams that already have a UI library and need dashboard-specific visualization components to complement it.
3. Refine
Refine is a meta-framework for building data-intensive applications — admin panels, dashboards, and internal tools. It's not a template; it's a framework that generates CRUD interfaces from your data model.
What you get:
- Automatic CRUD operations from data provider configuration
- Authentication and authorization hooks
- Routing integration (Next.js, Remix, React Router)
- Connectors for REST, GraphQL, Supabase, Strapi, Appwrite, and more
- UI framework adapters for Ant Design, MUI, Mantine, and Chakra UI
Key strengths:
- Data-first architecture. Define your data providers and Refine generates the boilerplate — list pages, create/edit forms, show views, and filters.
- Framework-agnostic UI. Swap between Ant Design, MUI, Mantine, or Chakra UI without changing your business logic.
- Headless mode. Use your own components if none of the bundled UI adapters fit.
- Active community. Regular releases, good documentation, and a responsive maintainer team.
Trade-offs: The abstraction adds complexity for simple dashboards. If your data layer doesn't fit Refine's provider model, you'll fight the framework more than benefit from it.
Pricing: Check Refine's current open-source and commercial offering before choosing it.
Best for: Teams building admin panels or internal tools with standard CRUD patterns over existing APIs.
4. AdminJS
AdminJS (formerly Admin Bro) auto-generates an admin panel from your database models. Point it at your ORM, and it creates a full CRUD interface.
What you get:
- Auto-generated admin panel from Sequelize, TypeORM, Mongoose, Prisma, or MikroORM models
- CRUD views, search, filtering, and bulk actions
- Dashboard page with customizable widgets
- Role-based access control
- Custom action hooks for business logic
Key strengths:
- Zero-config setup for common ORMs. If you use Prisma or TypeORM, AdminJS reads your schema and generates an admin panel automatically.
- Customizable. Override components, actions, and views when the defaults don't fit.
- Plugin system. Add features like file upload, import/export, and logging through plugins.
Trade-offs: The auto-generated UI looks functional but plain. Heavy customization can become painful because you're working against the generated output. The React version uses older patterns.
Pricing: Check AdminJS's current open-source and hosted offering before choosing it.
Best for: Backend teams that need a quick admin panel for database management without building frontend code.
5. React Admin
React Admin is the most mature admin framework in the React ecosystem, maintained by Marmelab since 2016.
What you get:
- Complete admin panel framework with routing, layout, and state management
- List, Create, Edit, Show views with declarative configuration
- Many data provider adapters for common backend patterns
- Authentication hooks and access control
- Theming through MUI
Key strengths:
- Mature and battle-tested. Years of production use mean many admin edge cases are documented and handled.
- Declarative API. Define resources, list columns, form fields, and filters with JSX — React Admin generates the plumbing.
- Enormous data provider ecosystem. If your backend speaks a protocol, there's probably a React Admin data provider for it.
- Enterprise edition. Calendar, kanban, audit log, real-time updates, and multi-tenancy for teams that need them.
Trade-offs: Tightly coupled to MUI for styling. The declarative API is powerful but opaque — debugging what goes wrong inside the framework requires understanding its internals.
Pricing: Check React Admin's current licensing and Enterprise Edition details.
Best for: Teams building full-featured admin panels that need a mature, well-documented framework with extensive data provider support.
6. Ant Design Pro
Ant Design Pro is the official dashboard template ecosystem for Ant Design. It is aimed at full-featured admin products built around Ant Design and ProComponents.
What you get:
- Complete admin layout with sidebar, header, and breadcrumbs
- Pre-built pages: dashboard, forms, tables, profiles, error pages
- Authentication and authorization patterns in the Ant Design Pro ecosystem
- ProComponents (ProTable, ProForm, ProLayout) for complex data patterns
- Internationalization with 10+ language packs
Key strengths:
- ProComponents. Advanced components like ProTable (configurable data table with search, filtering, and actions) save weeks of development time.
- Umi integration. Built on the Umi framework with conventions for routing, plugins, and data fetching.
- Comprehensive template. Nearly every page you'd need in an admin panel is included and customizable.
Trade-offs: Tightly coupled to the Ant Design ecosystem (Umi, Ant Design, AntV). The aesthetic is distinctly Ant Design — theming it to look different is difficult. Documentation is primarily in Chinese with English translations.
Pricing: Check Ant Design Pro's current license and repository before choosing it.
Best for: Teams already using Ant Design who need a comprehensive admin template with advanced data components.
7. CoreUI
CoreUI is a cross-framework admin template available for React, Vue, Angular, and vanilla Bootstrap. The React version ships with a complete dashboard layout and component set.
What you get:
- Dashboard layout with sidebar navigation and header
- 30+ page templates (analytics, user management, settings, etc.)
- Custom UI components built on Bootstrap foundations
- Chart examples for data visualization
- Icon library with 1,500+ icons
Key strengths:
- Cross-framework consistency. If your organization uses multiple frontend frameworks, CoreUI provides a consistent design language across all of them.
- Extensive page templates. Pre-built pages for common admin patterns save time on layout and structure.
- Regular updates. Actively maintained with frequent releases.
Trade-offs: The Bootstrap foundation feels dated compared to Tailwind-based alternatives. The free version is limited — most useful features require the Pro license.
Pricing: Check CoreUI's current pricing and license before choosing it.
Best for: Organizations that need the same admin panel design across React, Vue, and Angular projects.
8. Tabler
Tabler is a free, open-source dashboard template built on Bootstrap with a React adaptation. Known for its clean, minimal design and extensive component set.
What you get:
- 200+ responsive UI components
- Dashboard layout with multiple navigation patterns
- Apache ECharts integration for data visualization
- Form components with validation
- Email and e-commerce page templates
Key strengths:
- Beautiful design. Tabler has one of the cleanest default aesthetics of any free dashboard template.
- Component breadth. Over 200 components covering navigation, forms, data display, feedback, and layout.
- Open-source starting point. Check the current repository license and docs before adopting it.
- Active development. Regular releases with new components and improvements.
Trade-offs: The React version lags behind the HTML/Bootstrap version in features. TypeScript support is incomplete. Based on Bootstrap rather than a modern CSS approach.
Pricing: Check Tabler's current license and template docs before choosing it.
Best for: Developers who want a beautiful, free dashboard template and are comfortable with Bootstrap-based styling.
9. Argon Dashboard
Argon Dashboard React by Creative Tim is a popular dashboard template with a distinctive visual style.
What you get:
- Dashboard layout with sidebar and navbar
- Pre-built pages (dashboard, maps, tables, user profile)
- Bootstrap-based styling with custom extensions
- Chart examples
Key strengths:
- Distinctive design. Argon has a recognizable gradient-heavy aesthetic that stands out from more neutral templates.
- Creative Tim ecosystem. Integrates with Creative Tim's other products (login pages, landing pages, design system).
- Good documentation. Clear setup instructions and component guides.
Trade-offs: The free version is bare-bones — most useful pages and components require the Pro license. The design is polarizing. Bootstrap foundation limits modern CSS usage.
Pricing: Check Creative Tim's current pricing and license before choosing it.
Best for: Teams that like Creative Tim's design aesthetic and want a quick starting point for a dashboard.
10. Material Dashboard
Material Dashboard React is another Creative Tim template, built on MUI with a Material Design aesthetic.
What you get:
- MUI-based dashboard layout
- Pre-built pages with Material Design styling
- Chart examples for data visualization
- Dark mode support
- RTL layout support
Key strengths:
- Material Design compliance. If you need a dashboard that follows Google's Material Design guidelines, this delivers out of the box.
- MUI foundation. Access to MUI's full component ecosystem for extending beyond the template's defaults.
- Well-documented. Clear guides for customization, theming, and deployment.
Trade-offs: Same Creative Tim free-vs-Pro split — the free version is limited. Closely tied to MUI, making it hard to use with other styling approaches.
Pricing: Check Creative Tim's current pricing and license before choosing it.
Best for: Teams using MUI who want a Material Design dashboard template with ready-made pages.
11. Berry
Berry is an MUI-based admin dashboard template known for its polished design and comprehensive feature set.
What you get:
- A large set of page templates and widgets
- Chart examples for data visualization
- Authentication page examples
- Multi-language support
- Light and dark themes with RTL support
Key strengths:
- Feature density. Berry focuses on a large set of pre-built pages and widgets.
- Chart-heavy pages. The template includes polished chart-oriented dashboard pages.
- Auth examples. Includes authentication-related page examples.
Trade-offs: The Pro version is expensive compared to alternatives. MUI dependency means the same theming constraints apply.
Pricing: Check the current Berry pricing and license before choosing it.
Best for: Teams that want a feature-rich MUI dashboard with multiple authentication patterns and extensive pre-built pages.
12. Mantis
Mantis is a React admin dashboard built on MUI, focused on clean design and developer experience.
What you get:
- Clean, modern dashboard layout
- Chart examples for data visualization
- Authentication page examples
- Form components with validation
- Widget pages for common dashboard patterns
Key strengths:
- Clean aesthetic. Mantis has a more restrained, modern design compared to other MUI-based templates.
- Good code organization. The project structure follows best practices for scalable React applications.
- Regular updates. Actively maintained with consistent releases.
Trade-offs: Similar to Berry — MUI dependency, limited free version, Pro pricing.
Pricing: Check the current Mantis pricing and license before choosing it.
Best for: Teams who want a clean, well-organized MUI dashboard template.
13. Shadcn Dashboard
The shadcn/ui Dashboard example demonstrates how to build a full dashboard using shadcn/ui components with Tailwind CSS.
What you get:
- Example dashboard layout with sidebar and header
- Data table with sorting, filtering, and pagination
- Charts using Recharts
- Account/authentication page examples
- Settings forms
Key strengths:
- Full code ownership. Since shadcn/ui components are copied into your project, you have complete control over the dashboard code.
- Tailwind CSS styling. Clean, utility-first styling that's easy to customize.
- Community extensions. Many developers have built expanded dashboard templates on top of the shadcn example.
Trade-offs: It's an example, not a production template. You'll need to build out most pages yourself. The components need manual updates when shadcn releases improvements.
Pricing: Check shadcn/ui's current license and docs before choosing it.
Best for: Developers who want a Tailwind-based dashboard starting point with full control over the source code.
14. HeroUI Pro + Custom Widgets
If you want a HeroUI-native dashboard, start with HeroUI Pro rather than rebuilding the frame from base components. Use the Pro dashboard template for the app shell and add product-specific widgets only where your product needs something unique.
What you get:
AppLayout,Sidebar, andNavbarfor the dashboard frameKPI,DataGrid,LineChart,NumberValue, andTrendChipfor dashboard UI- Base HeroUI components for local UI around the Pro primitives
- Full control over your data fetching, permissions, and business logic
Why this works:
- No hand-rolled shell. The app frame, sidebar, navbar, metrics, tables, and charts already have Pro primitives.
- Modern stack. The current dashboard template is built with Next.js and HeroUI Pro components.
- AI-assisted development. Use HeroUI's MCP server and docs so agents can extend the dashboard with current APIs.
How to start:
- Start from the HeroUI Pro dashboard template.
- Keep
AppLayout,Sidebar,Navbar,KPI,DataGrid, and chart components as the foundation. - Replace the mock data files with your API, database, or analytics source.
- Add custom widgets only for product-specific workflows.
Pricing: Check HeroUI Pro's current pricing and license before choosing it.
Best for: Teams that want a HeroUI-native dashboard without rebuilding dashboard infrastructure from scratch.
How to Choose
Your choice depends on what you value most:
- Speed to launch: HeroUI Pro Dashboard or Ant Design Pro give you the most complete starting points.
- Maximum flexibility: HeroUI Pro plus custom widgets or the shadcn Dashboard example let you build around your product's exact needs.
- CRUD-heavy admin panels: React Admin or Refine auto-generate interfaces from your data model.
- Enterprise needs: React Admin Enterprise, MUI X, or Berry Pro offer advanced features with support contracts.
- Budget-friendly: Tabler, Tremor, and the shadcn Dashboard example are worth checking when you want an open-source starting point.
Build Your Dashboard with HeroUI
HeroUI provides the components you need to build modern, accessible dashboards:
- Component Documentation — Tables, Cards, Navigation, Forms, and more
- Quick Start Guide — Set up a new project in minutes
- HeroUI Pro — Pre-built dashboard templates and premium components
- Tutorial: Build a React Dashboard — Step-by-step guide
Apps Docs Content Blog En Best React Ui Component Libraries (`apps/docs/content/blog/en/best-react-ui-component-libraries.mdx`)
title: "12 Best React UI Component Libraries in 2026" date: "2026-05-16" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["react", "ui-libraries", "comparison"] image: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/blog/heroui-overview-light.png" darkImage: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/blog/heorui-overview-dark.png"
Choosing the right React UI component library can make or break your development workflow. The best React UI component libraries in 2026 ship accessible, production-ready components that let you focus on building features instead of re-implementing dropdowns for the hundredth time.
I compared 12 libraries across styling, accessibility foundation, breadth, AI workflow, and licensing. Exact component counts and pricing can change quickly, so treat this as a practical field guide and check each project's docs before you commit.
Quick Comparison
| Library | Styling | Accessibility foundation | Breadth | AI workflow |
|---|---|---|---|---|
| HeroUI | Tailwind CSS v4 | React Aria | MCP server, llms.txt, agent skills | |
| shadcn/ui | Tailwind CSS | Radix UI and other primitives | Official docs list 59 component entries | MCP server, llms.txt, skills |
| Material UI | Emotion by default, Pigment CSS integration path | MUI implementation | Very broad core + MUI X | Public docs |
| Chakra UI | Panda CSS API-based system | Chakra / Ark UI ecosystem | Broad app component set | MCP server and public docs |
| Mantine | CSS files / CSS Modules | Mantine implementation | 120+ components, 70+ hooks | MCP server, llms.txt, skills |
| Radix UI | Unstyled | Radix primitives | Focused primitives | Public docs |
| Ant Design | CSS-in-JS / token system | Ant Design implementation | Enterprise-heavy | Public docs |
| Headless UI | Unstyled | Headless UI primitives | Focused primitives | Public docs |
| React Aria | Unstyled | React Aria | Deep primitive layer | Public docs |
| Ark UI | Unstyled | Zag.js state machines | Headless components | Public docs |
| Tremor | Tailwind CSS v4 | Dashboard-focused components | Analytics/data display | Public docs |
| Park UI | Panda CSS / Tailwind | Ark UI | Styled Ark components | Public docs |
1. HeroUI
HeroUI pairs React Aria accessibility with Tailwind CSS v4 styling and a compound component API (Card.Header, Table.Column, Modal.Body). Components work with React 19 and the Next.js App Router out of the box.
Key strengths:
- Accessibility-first architecture. Every component is built on React Aria, Adobe's battle-tested accessibility primitives. This means screen reader support, keyboard navigation, and ARIA attributes are handled correctly out of the box — not bolted on as an afterthought.
- Tailwind CSS v4 native. HeroUI's styling system uses CSS-based theming with
@themeand design tokens, avoiding the runtime overhead of CSS-in-JS. - Compound component API. Components use a composable pattern (
Card.Header,Card.Content,Card.Footer) that gives you full control over markup and layout without sacrificing ergonomics. - AI tooling. HeroUI ships an MCP server, llms.txt, and agent skills so AI coding assistants can look up current HeroUI APIs instead of relying only on training data.
- Server component friendly. Components are designed with React Server Components in mind — client boundaries are minimal and clearly documented.
When to use it: You want a modern, accessible component library with Tailwind CSS styling and first-class AI tooling support. Ideal for new projects using Next.js, React 19, and Tailwind v4.
2. shadcn/ui
shadcn/ui isn't a traditional component library — it's a collection of copy-paste components built on Radix UI and Tailwind CSS. Instead of installing a package, you add component source code directly to your project.
Key strengths:
- Full ownership. Components live in your codebase, so you can modify them freely without fighting library abstractions or waiting for upstream changes.
- Radix UI foundation. The underlying primitives handle accessibility and complex interactions (popovers, comboboxes, dialogs) reliably.
- CLI tooling. The
shadcnCLI scaffolds components into your project with the right dependencies and file structure. - AI-ready docs. shadcn/ui publishes
llms.txt, skills, and an MCP server for agents. - Massive ecosystem. The community has built hundreds of extensions, themes, and integrations around shadcn's patterns.
When to use it: You want maximum control over component code and you're comfortable maintaining copied components. Works well for teams that need heavy customization.
Trade-offs: You own the code, which means you also own the bugs. Upstream fixes and improvements require manual re-integration. No central update mechanism. Additionally, shadcn/ui's foundation on Radix UI carries some uncertainty — the original Radix team has shifted focus to Base UI, and the long-term maintenance status of Radix primitives is an open question in the community.
3. Material UI (MUI)
Material UI is the most established React component library, with a decade of production use. MUI's stable styling path still centers on Emotion and the sx prop; Pigment CSS exists as an experimental zero-runtime direction rather than the default.
Key strengths:
- Massive component count. Over 70 components covering nearly every UI pattern you can think of, from basic buttons to complex data grids.
- Material Design compliance. If your design system is built on Material Design, MUI gives you pixel-perfect implementations.
- Enterprise ecosystem. MUI X offers premium components (data grid, date pickers, charts) with enterprise support and SLAs.
- Mature and battle-tested. Thousands of production apps run on MUI. Edge cases have been found and fixed over years.
When to use it: You're building a large enterprise application that needs Material Design compliance, or you need MUI X's premium data grid and date picker components.
Trade-offs: The Material Design aesthetic is opinionated. Theming away from Material's look-and-feel is possible but requires significant effort. Bundle size is larger than most alternatives.
4. Chakra UI
Chakra UI pioneered the "style props" pattern in React, letting you style components with props like bg="blue.500" and p={4}. Chakra's current theming docs describe a system built around the Panda CSS API with defineConfig, createSystem, recipes, slot recipes, tokens, and semantic tokens.
Key strengths:
- Intuitive styling API. Style props make it fast to prototype and iterate on designs without leaving your JSX.
- Design token system. The theme object gives you centralized control over colors, spacing, fonts, and breakpoints.
- Good accessibility defaults. Components follow WAI-ARIA patterns and include keyboard navigation.
- Recipe-driven styling. Chakra uses recipes, slot recipes, and a token-based system for component styling.
- AI support. Chakra documents an MCP server for AI-assisted workflows.
When to use it: You like styling through props rather than class names, and you want a cohesive design system with good defaults.
Trade-offs: The style props pattern can make JSX noisy for complex components. Migrating from v2 to v3 required significant changes because the component and theming APIs changed.
5. Mantine
Mantine is a full-featured React component library with a very broad component catalog, a hooks package, and a rich extension ecosystem. Mantine's homepage currently describes the library as 120+ components and 70+ hooks.
Key strengths:
- Unmatched breadth. Mantine has components and extensions for many product needs — date pickers, notifications, spotlight search, charts, forms, and more.
- Large hooks package. Beyond components, Mantine ships hooks for local storage, media queries, clipboard, idle detection, and many other common patterns.
- CSS styling. Mantine components are built with CSS files and can be customized through the Styles API.
- AI tooling. Mantine publishes LLM docs, skills, and an MCP server.
- Form library.
@mantine/formprovides form state management with validation that integrates seamlessly with Mantine inputs.
When to use it: You want a batteries-included library where you can find a component for almost any use case without adding third-party packages.
Trade-offs: The huge surface area means the bundle can grow quickly if you're not tree-shaking carefully. The component design aesthetic, while clean, is fairly specific.
6. Radix UI (Primitives)
Radix UI provides unstyled, accessible UI primitives that you style yourself. It's the foundation behind shadcn/ui and many other component libraries.
Key strengths:
- Accessibility gold standard. Every primitive is built to WAI-ARIA specification with exhaustive keyboard navigation, focus management, and screen reader support.
- Unstyled by default. Zero design opinions means zero fighting with the library's aesthetic. Bring your own styling system.
- Composable APIs. Primitives use a compound component pattern with slot-based composition that gives you control over every rendered element.
- Production-proven. Radix primitives power thousands of production applications through both direct usage and shadcn/ui.
When to use it: You need accessible, behavior-only primitives and want complete control over styling. Great for teams building custom design systems.
Trade-offs: You need to bring all your own styling. The learning curve for the composition patterns can be steep for simpler use cases.
7. Ant Design
Ant Design is a comprehensive design system and component library created by Ant Group (Alibaba). It's especially popular in enterprise applications and the Chinese development community.
Key strengths:
- Enterprise-grade components. Complex components like Table (with sorting, filtering, pagination), Form (with validation), and Tree are mature and feature-rich.
- Design system included. Ant Design is a complete design system with design tokens, patterns, and guidelines — not just a component library.
- Internationalization. First-class i18n support with 60+ locale packages.
- Component quality. Each component handles dozens of edge cases that you'd otherwise need to build yourself.
When to use it: You're building a complex enterprise application, especially one that needs sophisticated data tables, forms, and tree views.
Trade-offs: The design aesthetic is distinctly "Ant Design" and theming it to look different requires substantial effort. Bundle size is significant. Accessibility support, while improving, still lags behind Radix/React Aria-based libraries.
8. Headless UI
Headless UI is a set of unstyled, accessible UI components from the Tailwind Labs team. It focuses on common interactive patterns — dropdowns, dialogs, tabs, comboboxes.
Key strengths:
- Tailwind CSS integration. Built by the Tailwind team, it works perfectly with Tailwind's utility classes and transition utilities.
- Small, focused scope. Only includes components that are genuinely hard to build accessibly (menus, listboxes, dialogs, etc.).
- Lightweight. Minimal bundle impact because of the focused component set.
- Clean API. Uses render props and compound components with a simple, predictable API.
When to use it: You're using Tailwind CSS and need a few accessible interactive components without a full UI library.
Trade-offs: Very small component set — you'll need other solutions for data tables, form inputs, date pickers, and most other patterns.
9. React Aria (Primitives)
React Aria is Adobe's library of accessibility primitives for React. It provides hooks and components for building accessible UI from scratch.
Key strengths:
- Industry-leading accessibility. React Aria is arguably the most thoroughly accessible UI primitive library available. It handles internationalization, right-to-left layouts, touch interactions, and edge cases that most libraries miss.
- Hooks + components. Offers both low-level hooks (for maximum flexibility) and higher-level components (for convenience).
- Platform-aware. Adapts behavior based on device type, pointer type, and platform conventions.
- Foundation for other libraries. HeroUI, Adobe Spectrum, and other libraries build on React Aria, proving its reliability at scale.
When to use it: You're building a design system from scratch and need the strongest possible accessibility foundation. Also useful when you need specific primitives (like a color picker or calendar) that other libraries don't offer.
Trade-offs: Steeper learning curve than styled libraries. You need to bring all your own styling and composition patterns.
10. Ark UI
Ark UI is a headless component library from the creators of Chakra UI, built on top of state machines for predictable behavior.
Key strengths:
- State machine architecture. Uses Zag.js state machines under the hood, making component behavior predictable and debuggable.
- Framework-agnostic core. The same state machines power React, Vue, and Solid versions of every component.
- Modern patterns. Includes components like Signature Pad, Pin Input, and Splitter that aren't commonly found in other headless libraries.
- Styling flexibility. Works with any styling solution — Tailwind, Panda CSS, vanilla CSS, CSS modules.
When to use it: You want headless components with predictable state management, or you need to share component logic across React, Vue, and Solid projects.
Trade-offs: Smaller community than Radix or React Aria. The state machine abstraction adds conceptual overhead for simple components.
11. Tremor
Tremor is focused on dashboards and data visualization. Its current docs describe Tremor Raw as designed for React 18.2+ and Tailwind CSS 4.0+.
Key strengths:
- Dashboard-first design. Purpose-built resources for analytics, dashboard UI, and data display.
- Tailwind native. Integrates seamlessly with existing Tailwind projects without additional styling configuration.
- Clean defaults. Charts and metrics look polished out of the box with a cohesive design language.
- Lightweight scope. Focused on data display, so you pick what you need without pulling in an entire UI framework.
When to use it: You're building analytics dashboards or data-heavy interfaces and already use Tailwind CSS.
Trade-offs: Limited to dashboard-specific components. You'll need another library for general UI patterns like forms, navigation, and dialogs.
12. Park UI
Park UI is a styled component library built on Ark UI primitives, available in both Panda CSS and Tailwind CSS variants.
Key strengths:
- Pre-styled Ark UI. Takes Ark UI's headless components and adds polished, customizable styling — similar to what shadcn/ui does for Radix.
- Dual styling support. Available in both Panda CSS and Tailwind CSS variants, so you can pick the approach that fits your project.
- Copy-paste model. Like shadcn/ui, components are added to your project as source files you own and customize.
- Design tokens. Ships with a token system that makes global style changes straightforward.
When to use it: You like the shadcn/ui copy-paste model but prefer Ark UI's state-machine-based primitives over Radix, or you're using Panda CSS.
Trade-offs: Smaller community and ecosystem compared to shadcn/ui. Fewer third-party extensions and themes.
How to Choose
There's no single "best" library — the right choice depends on your project's constraints:
- Starting a new project with Tailwind v4? HeroUI gives you the most modern stack with React Aria accessibility, compound components, and AI tooling.
- Want full ownership of component code? shadcn/ui or Park UI let you copy components into your project.
- Building enterprise apps with complex data needs? MUI's data grid or Ant Design's table component are hard to beat.
- Need maximum accessibility compliance? HeroUI's React Aria foundation provides the strongest accessibility out of the box.
- Want a broad UI toolkit with quality? HeroUI covers all core UI patterns with deep accessibility; pair with dedicated libraries for specialized needs like rich text editors.
- Working across multiple frameworks? Ark UI's state machines work in React, Vue, and Solid.
Get Started with HeroUI
If you're starting a new React project and want accessible, beautifully designed components with Tailwind CSS v4, give HeroUI a try:
Apps Docs Content Blog En Build React Dashboard With Heroui (`apps/docs/content/blog/en/build-react-dashboard-with-heroui.mdx`)
title: "How to Build a React Dashboard with HeroUI Pro" date: "2026-05-11" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["react", "dashboard", "tutorial", "heroui", "admin"] image: "/images/blog/build-react-dashboard-with-heroui.jpg" draft: true
I've watched too many teams spend their first two sprints hand-rolling a sidebar, a responsive navbar, and a metrics card layout — only to rip it out later when the requirements get real. If you have HeroUI Pro, skip that phase entirely.
This post shows the Pro-first approach: start with AppLayout, Sidebar, Navbar, KPI, DataGrid, and chart components, then plug in your data. The dashboard template already handles the layout, responsive behavior, and mobile navigation.
Project Setup
Install HeroUI and HeroUI Pro packages:
npm install @heroui/styles @heroui/react @heroui-pro/reactHeroUI Pro requires access to the Pro package registry. The dashboard template uses these style imports:
@import "@heroui/styles/css";
@import "@heroui-pro/react/css";
@source "../**/*.{ts,tsx}";
body {
background-color: var(--background);
}Use AppLayout for the Frame
The app frame should come from HeroUI Pro AppLayout, not a custom flex layout.
"use client";
import type {ReactNode} from "react";
import {AppLayout} from "@heroui-pro/react";
import {usePathname, useRouter} from "next/navigation";
import {useCallback} from "react";
import {DashboardNavbar} from "./dashboard-navbar";
import {DashboardSidebar} from "./dashboard-sidebar";
export function AppShell({children}: {children: ReactNode}) {
const router = useRouter();
const pathname = usePathname();
const navigate = useCallback((href: string) => router.push(href), [router]);
return (
<AppLayout
navbar={<DashboardNavbar title="Dashboard" />}
navigate={navigate}
sidebar={<DashboardSidebar pathname={pathname} />}
sidebarCollapsible="offcanvas"
>
{children}
</AppLayout>
);
}AppLayout handles the relationship between the sidebar, navbar, mobile menu, and content region. Keep it as the app shell and customize inside the slots.
Use Pro Sidebar and Navbar
HeroUI Pro ships a Sidebar compound component and a Navbar compound component. The dashboard template uses both.
"use client";
import {Bell, Magnifier} from "@gravity-ui/icons";
import {Button} from "@heroui/react";
import {AppLayout, Navbar, Sidebar} from "@heroui-pro/react";
export function DashboardNavbar({title}: {title: string}) {
return (
<Navbar maxWidth="full">
<Navbar.Header>
<AppLayout.MenuToggle />
<Sidebar.Trigger />
<h1 className="text-foreground truncate text-xl font-semibold">{title}</h1>
<Navbar.Spacer />
<Button isIconOnly aria-label="Search" size="sm" variant="tertiary">
<Magnifier className="size-4" />
</Button>
<Button isIconOnly aria-label="Notifications" size="sm" variant="tertiary">
<Bell className="size-4" />
</Button>
</Navbar.Header>
</Navbar>
);
}For navigation, render Sidebar.MenuItem items instead of building custom active-link styles:
/* Detailed source-code truncated for AI context efficiency. */The full Pro template also includes a header profile area, footer items, badges, and mobile content reuse.
Use KPI for Metrics
Do not rebuild metric cards with Card unless you need a one-off design. Use KPI from HeroUI Pro.
"use client";
import {KPI} from "@heroui-pro/react";
const chartData = [
{x: 1, y: 12},
{x: 2, y: 18},
{x: 3, y: 16},
{x: 4, y: 24},
];
export function KpiRow() {
return (
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4">
<KPI>
<KPI.Header>
<KPI.Title>Revenue</KPI.Title>
</KPI.Header>
<KPI.Content>
<KPI.Value currency="USD" maximumFractionDigits={0} style="currency" value={45231} />
<KPI.Trend trend="up">12.5%</KPI.Trend>
</KPI.Content>
<KPI.Chart color="var(--color-accent)" data={chartData} height={60} strokeWidth={1.5} />
</KPI>
</div>
);
}The dashboard template uses this same pattern for analytics KPIs and finance KPIs.
Use Pro Charts
HeroUI Pro chart components keep chart styling aligned with the rest of the design system.
/* Detailed source-code truncated for AI context efficiency. */Use the chart components from Pro for dashboard analytics, then swap the sample arrays for your real metrics.
Use DataGrid for Tables
Dashboards usually need dense, sortable tables. Use Pro DataGrid instead of composing raw table markup.
/* Detailed source-code truncated for AI context efficiency. */This matches the template's table direction: typed columns, a controlled sort descriptor, search outside the grid, and getRowId for stable row identity.
Compose the Dashboard Page
The page should mostly assemble widgets. In the Pro template, the dashboard view looks like this:
"use client";
import {DashboardToolbar} from "../widgets/dashboard-toolbar";
import {EmployeesTable} from "../widgets/employees-table";
import {KpiRow} from "../widgets/kpi-row";
import {SalesPerformanceCard} from "../widgets/sales-performance-card";
import {TrafficSourceCard} from "../widgets/traffic-source-card";
export function DashboardPage() {
return (
<div className="mx-auto flex max-w-7xl flex-col gap-4 px-5 pb-10 pt-4">
<DashboardToolbar />
<KpiRow />
<div className="grid grid-cols-1 gap-3 lg:grid-cols-2">
<SalesPerformanceCard />
<TrafficSourceCard />
</div>
<EmployeesTable />
</div>
);
}That is the main architectural point: the page should read like product composition, not infrastructure.
Why HeroUI for Dashboards
Dashboards are dense — data tables, form controls, navigation, and overlays on a single screen. HeroUI handles the accessibility and styling for all of those pieces so you can focus on your data layer.
- Data tables that handle accessibility for you. Sortable columns, row selection, keyboard navigation, and screen reader announcements come from React Aria. You don't reimplement them per table.
- Static CSS for data-heavy pages. Tailwind v4 generates all styles at build time. Dashboards with KPI cards, charts, and grids don't pay a runtime styling tax.
- Pro primitives instead of hand-rolled infrastructure. AppLayout, Sidebar, Navbar, KPI, DataGrid, and chart components from HeroUI Pro save weeks of dashboard scaffold work.
- AI assistants that know the Pro API. The MCP server and agent skills let AI tools scaffold dashboard views with correct component APIs instead of guessing.
Next Steps
- Start from the HeroUI Pro dashboard template if you have Pro access.
- Replace the mock files in
src/data/*with your API, database, or analytics source. - Keep
AppLayout,Sidebar,Navbar,KPI,DataGrid, and Pro charts as the foundation. - Use base HeroUI components for local UI that does not need a Pro primitive.
Apps Docs Content Blog En Choosing React Native Ui Library (`apps/docs/content/blog/en/choosing-react-native-ui-library.mdx`)
title: "Choosing a React Native UI Library" date: "2026-05-12" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["native", "react-native", "ui-libraries", "comparison"] image: "/images/blog/choosing-react-native-ui-library.jpg" draft: true
Choosing a React Native UI library is not just a component-count decision. It is a maintenance decision, a design decision, and increasingly an AI workflow decision.
The library you choose becomes the vocabulary your team uses every day. It shapes how designers hand off screens, how engineers compose interfaces, how quickly you can fix accessibility issues, and how well AI agents generate code that actually compiles.
This guide explains how we think about that decision, and why HeroUI Native is built the way it is.
What to Evaluate
Before comparing libraries, write down what your product needs:
- Are you building a consumer app, internal tool, SaaS companion app, marketplace, fintech app, or mobile-first product?
- Do you need bottom sheets, dialogs, menus, tabs, forms, toasts, skeletons, and list patterns?
- Is your design system already defined in Figma?
- Do you need AI assistants to generate UI reliably?
- Does your team want a package that updates over time, or copied source code you fully own?
Those questions matter more than a screenshot gallery.
Package vs. Copy-Paste
Copy-paste UI can be useful when you need total code ownership. The trade-off is maintenance. Once the code is in your app, your team owns the updates, accessibility fixes, dependency changes, and design consistency.
HeroUI Native takes the package approach:
- Install
heroui-native. - Configure Uniwind and the provider once.
- Compose components through documented APIs.
- Update the package when fixes and improvements ship.
- Use MCP/LLM docs so AI tools can read current component documentation.
That does not mean a package is always better. If your team has a dedicated design system group and wants to own every line of component code, copied source may fit. But if your team wants to ship product screens without becoming a component-maintenance team, a maintained package is usually the healthier default.
Design Quality Is a Feature
Mobile apps are judged in milliseconds. A button press, sheet transition, input focus state, disabled control, or empty state can make an app feel cared for or unfinished.
HeroUI Native is intentionally opinionated about the baseline:
- Semantic component variants create a clear visual hierarchy.
- Components are designed to look complete before customization.
- Theming happens through CSS variables and Uniwind.
- Animated components use React Native animation libraries instead of web-only assumptions.
- Component APIs follow compound composition so you can adjust structure without forking internals.
The goal is not to lock you into one visual identity. The goal is to start from a designed system rather than a pile of primitives.
Ecosystem Fit
HeroUI Native is strongest when you want one ecosystem across product surfaces:
- Web product: HeroUI React
- Mobile product: HeroUI Native
- Premium app surfaces: HeroUI Pro
- Design handoff: HeroUI Figma Kit V3
- AI workflow: Native MCP Server, llms.txt, and Agent Skills
That ecosystem is the advantage. A component library by itself saves some time. A design system, docs, Figma kit, AI context, and maintained package save coordination cost.
Where HeroUI Native Is Different
HeroUI Native is built specifically for React Native. It does not ask you to use web imports or CSS files that do not belong in mobile apps.
Use Native patterns:
import {Button} from "heroui-native";
<Button variant="primary" onPress={() => console.log("Pressed")}>
<Button.Label>Continue</Button.Label>
</Button>;Avoid web patterns:
Do not use the HeroUI web package or web-only event handlers in React Native screens.
HeroUI Native uses onPress, HeroUINativeProvider, GestureHandlerRootView, Uniwind, and native overlay/portal patterns because those are the right abstractions for mobile.
Recommendation
Choose HeroUI Native when your team values design quality, maintainability, and ecosystem leverage. It is especially compelling if you already use HeroUI on the web, work from Figma, or build with AI coding assistants.
Start with the Quick Start, then read the Design Principles before building your first screen.
Apps Docs Content Blog En Design To Code With Heroui Native (`apps/docs/content/blog/en/design-to-code-with-heroui-native.mdx`)
title: "Design to Code with HeroUI Native" date: "2026-05-13" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["native", "react-native", "design-system", "figma", "ai"] image: "/images/blog/design-to-code-with-heroui-native.jpg" draft: true
The hardest part of a mobile design system is not drawing components. It is keeping design, code, documentation, and generated AI output aligned over time.
HeroUI Native is built for that workflow. The library gives developers a maintained React Native component system, gives designers a shared HeroUI visual language through Figma, and gives AI assistants structured documentation through MCP, llms.txt, and skills.
The Problem
Most teams drift in predictable ways:
- Figma components use one naming system.
- React Native components use another.
- Design tokens get translated by hand.
- AI agents guess props from old examples.
- Engineers copy a component once, customize it, and rarely bring upstream fixes back in.
The result is subtle inconsistency. One screen has different spacing. Another uses the wrong disabled state. A generated component imports web HeroUI into a native app. The first version ships, but the system becomes harder to maintain.
HeroUI Native is designed to reduce that drift.
Shared Mental Model
HeroUI Native uses the same product-level ideas as the rest of the HeroUI ecosystem:
- Semantic variants like
primary,secondary, andtertiary. - Compound components for flexible composition.
- Theme variables for semantic colors and surfaces.
- Component documentation with anatomy, props, examples, and usage patterns.
- AI-readable docs for agents.
The implementation is native, not web. HeroUI Native uses React Native, Uniwind, HeroUINativeProvider, and mobile interaction patterns. But the design language stays familiar.
import {Button, Card} from "heroui-native";
<Card>
<Card.Header>
<Card.Title>Workspace</Card.Title>
<Card.Description>Invite your team and manage access.</Card.Description>
</Card.Header>
<Card.Body>{/* Screen content */}</Card.Body>
<Card.Footer>
<Button variant="primary">
<Button.Label>Invite member</Button.Label>
</Button>
</Card.Footer>
</Card>;Figma Kit V3
The HeroUI Figma Kit V3 is the design-side entry point for the ecosystem. It is linked from the Native docs so teams can work from the same visual system while building mobile screens.
Use it to:
- Start from HeroUI's visual language instead of blank frames.
- Keep component names and variants close to the code model.
- Align designers and developers on hierarchy, states, and spacing.
- Create mobile product screens that feel connected to the rest of the HeroUI ecosystem.
Figma does not replace implementation details like keyboard handling, safe areas, bottom sheets, or screen reader behavior. But a shared kit reduces the translation cost between design and code.
AI Context That Knows Native
AI coding tools are useful only when they have current context. Without that, they often mix web and native APIs.
HeroUI Native provides dedicated AI entry points:
- /native/llms.txt for a quick Native documentation index.
- /native/llms-full.txt for complete Native documentation.
- /native/llms-components.txt for component docs only.
- /native/llms-patterns.txt for common patterns.
- HeroUI Native MCP Server, published as
@heroui/native-mcp. - HeroUI Native Agent Skills.
That matters because Native code has different rules:
- Import from
heroui-native. - Use React Native press handlers such as
onPress. - Configure
HeroUINativeProvider. - Wrap the app with
GestureHandlerRootView. - Use Uniwind and
heroui-native/styles. - Use Native component anatomy, not web component anatomy.
The MCP server and skills help agents follow those rules.
A Practical Workflow
Here is the workflow we recommend:
- Design from the Figma kit. Start from HeroUI's component language instead of one-off mobile components.
- Install HeroUI Native correctly. Follow the Quick Start so Uniwind, peer dependencies, styles, and providers are configured.
- Give agents the docs. Add the MCP server or reference /native/llms-full.txt.
- Build screens with compound components. Compose components using dot notation and semantic variants.
- Customize through theme variables. Keep brand-level changes in the theming layer, not scattered across every screen.
- Update through the package. Treat HeroUI Native as a maintained dependency, not a copied snapshot.
Why This Helps
Design-to-code is not about removing engineers or designers. It is about reducing translation loss.
HeroUI Native helps because:
- Designers start from the HeroUI visual system.
- Developers get a maintained React Native package.
- AI assistants get current component docs.
- Teams keep a consistent vocabulary across web and mobile.
- The library can evolve without every app owning every internal component detail.
That is the long-term value: not just faster first screens, but fewer inconsistencies as the app grows.
Next Step
Install the HeroUI Native MCP Server in your editor, then ask your assistant to build a screen using the Quick Start and the components in All Components.
Apps Docs Content Blog En Heroui Vs Chakra Ui (`apps/docs/content/blog/en/heroui-vs-chakra-ui.mdx`)
title: "HeroUI vs Chakra UI: Which React UI Library Should You Choose in 2026?" date: "2026-05-14" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["comparison", "heroui", "chakra-ui", "react"] draft: true
If you're picking a React component library in 2026, HeroUI and Chakra UI are both strong contenders. HeroUI styles components with Tailwind CSS v4 utility classes and builds accessibility on React Aria, using a compound component API (Card.Header, Modal.Body) instead of style props. Chakra UI pioneered the style-props pattern and has rebuilt on Panda CSS and Ark UI. Both ship accessible components — but they take fundamentally different approaches to styling, component design, and developer tooling that matter more than you might think.
This guide walks through where each library shines, where it falls short, and how to decide which one fits your project.
The TL;DR
| Feature | HeroUI v3 | Chakra UI v3 |
|---|---|---|
| Styling | Tailwind CSS v4 (static CSS) | Panda CSS API-based styling system and style props |
| Accessibility | React Aria (Adobe) | Ark UI / Zag.js (Chakra team) |
| Component API | Compound components + className | Style props on components |
| CSS output | Static CSS from Tailwind and HeroUI styles | Runtime styling in the stable Chakra setup |
| AI tooling | MCP server, llms.txt, agent skills | MCP server and public docs |
| Theming | CSS custom properties + @theme |
Theme tokens + semantic tokens |
| React 19 | Supported | Supported |
| Server components | Static pieces can stay server-rendered; interactive pieces use client boundaries | Depends on component and styling usage |
Styling: Two Different Philosophies
This is the biggest architectural difference between the two libraries, and it's worth understanding deeply because it affects everything downstream — from how you customize components to how your app performs in production.
Chakra UI: Style Props
Chakra pioneered the "style props" pattern in React. Instead of writing CSS classes, you style components through JSX props:
import { Box, Button } from "@chakra-ui/react";
<Box bg="blue.500" p={4} borderRadius="lg">
<Button colorPalette="blue" size="lg">
Click me
</Button>
</Box>This is ergonomic for quick prototyping. You stay in JSX, your styles are co-located with your markup, and the design token system (blue.500, p={4}) keeps things consistent. Chakra's current theming docs describe the styling system as built around Panda CSS APIs like defineConfig, createSystem, recipes, slot recipes, tokens, and semantic tokens.
The trade-off is that style props can make JSX verbose for complex layouts. A card with a dozen styling tweaks ends up with more prop noise than markup, and the default styling model is still different from a static CSS/Tailwind setup.
HeroUI: Tailwind CSS v4
HeroUI takes the opposite approach — components are styled with Tailwind CSS utility classes, and you customize them the same way you'd customize any Tailwind element:
import { Card, Button } from "@heroui/react";
<Card className="bg-blue-500 p-4 rounded-lg">
<Card.Header>
<Card.Title>My Card</Card.Title>
</Card.Header>
<Card.Content>
<Button size="lg">Click me</Button>
</Card.Content>
</Card>Because Tailwind v4 and HeroUI styles are CSS-first, there is no component-level CSS-in-JS runtime in the HeroUI styling path. HeroUI's theming system uses CSS custom properties and Tailwind's @theme directive, so you can swap visual systems by changing variables.
If you're already using Tailwind in your project, HeroUI slots in naturally. If you're not, adopting Tailwind is a separate decision that comes with its own learning curve.
Which styling approach is better?
Neither is objectively superior — it depends on your team.
Style props are great when you want to move fast and keep everything in JSX. They're intuitive for developers who think in "component properties" rather than "CSS classes." But they create a tight coupling between your component library and your styling strategy.
Tailwind utilities are great when you want a universal styling language that works the same way on library components and custom components. The build-time approach means better performance, and the utility-first workflow is something most React developers already know in 2026.
Accessibility Foundations
Both libraries take accessibility seriously, but they build on different foundations.
HeroUI: React Aria
HeroUI is built on React Aria, Adobe's accessibility primitives. React Aria handles keyboard navigation, screen reader announcements, focus management, and ARIA attributes for every component. It's the same foundation that powers Adobe's own design system (Spectrum), and it's one of the most thoroughly tested accessibility layers in the React ecosystem.
What this means in practice: HeroUI components handle edge cases that many libraries miss. Focus trapping in modals works correctly with screen readers. Comboboxes announce option counts. Date pickers support keyboard navigation across months and years. These aren't features you'd notice in a demo, but they're critical for shipping accessible software.
Chakra UI: Ark UI / Zag.js
Chakra v3 rebuilt its accessibility layer on Ark UI and Zag.js, both maintained by the Chakra team. Zag uses state machines to model component behavior, which makes the logic predictable and testable. Ark UI wraps Zag into framework-specific components.
This is a solid approach, and Chakra's accessibility is genuinely good. The main difference is maturity — React Aria has been in production at Adobe for years and has a larger surface area of accessibility testing. Zag.js is newer and still expanding its component coverage.
The practical difference
For most applications, both libraries will produce accessible UIs. The gap shows up in complex components — date pickers, comboboxes, drag-and-drop — where React Aria's deeper investment in accessibility edge cases gives HeroUI an advantage.
Component API Design
This is where the day-to-day developer experience diverges most noticeably.
HeroUI: Compound Components
HeroUI uses a compound component pattern where a parent component exposes sub-components through dot notation:
import { Modal, Button } from "@heroui/react";
<Modal>
<Button>Open Modal</Button>
<Modal.Backdrop>
<Modal.Container>
<Modal.Dialog>
<Modal.CloseTrigger />
<Modal.Header>
<Modal.Heading>Confirm Action</Modal.Heading>
</Modal.Header>
<Modal.Body>Are you sure?</Modal.Body>
<Modal.Footer>
<Button variant="ghost">Cancel</Button>
<Button>Confirm</Button>
</Modal.Footer>
</Modal.Dialog>
</Modal.Container>
</Modal.Backdrop>
</Modal>This is more verbose than a flat prop API, but it gives you complete control over the component's structure. You can reorder parts, add custom elements between them, or omit parts entirely. It's the same pattern used by Radix UI, and it scales well for complex UIs.
Chakra UI: Flat Components with Style Props
Chakra components are flatter and rely on props for configuration:
import { DialogRoot, DialogContent, DialogHeader, DialogBody, DialogFooter } from "@chakra-ui/react";
<DialogRoot>
<DialogContent>
<DialogHeader>Confirm Action</DialogHeader>
<DialogBody>Are you sure?</DialogBody>
<DialogFooter>
<Button variant="ghost">Cancel</Button>
<Button>Confirm</Button>
</DialogFooter>
</DialogContent>
</DialogRoot>Chakra v3 moved toward a more composable approach compared to v2, but the styling still happens through props rather than class names. This makes the JSX self-documenting in one sense (you can see all the styles) but noisy in another (the styles obscure the structure).
Performance
Performance differences between modern component libraries are often overstated, but there are real architectural factors worth considering.
Build-time vs. runtime CSS
HeroUI generates all CSS at build time through Tailwind v4. Your production bundle includes only the utility classes your components actually use, and there's zero JavaScript overhead for style computation at runtime.
Chakra's styling API is much more structured than the older Chakra v2 era and is built around the Panda CSS API. It is still a different authoring model from HeroUI's Tailwind/CSS-variable path, so teams should test the exact runtime and bundle impact in their own app.
Bundle size
HeroUI components are thin wrappers around React Aria primitives plus CSS classes. Chakra components carry a richer style-props and theme system. The practical impact depends on which components you use and how aggressively your app splits routes.
Server components
HeroUI's static pieces can stay in React Server Component trees, while interactive pieces need client boundaries. Chakra's behavior depends on which components and style props you use, so I would test the exact pages you care about before making performance promises.
AI Tooling
This is an area where HeroUI has a clear, measurable advantage.
HeroUI's AI stack
HeroUI ships three tools specifically designed for AI coding assistants:
- MCP server. A Model Context Protocol server that exposes component documentation, API references, and code examples to AI agents. When your AI assistant has access to this, it can look up the exact props, compound component structure, and usage patterns for any HeroUI component — instead of guessing.
- llms.txt. A structured text file at heroui.com/llms.txt that gives LLMs a condensed reference of the entire library. This is the equivalent of giving your AI assistant a cheat sheet.
- Agent skills. Pre-built skill files for AI coding tools like Cursor and Claude Code that teach agents how to scaffold components, use the correct import paths, and follow HeroUI conventions.
In practice, this gives AI assistants a better chance of generating current HeroUI v3 code. They can look up the compound component patterns, prop names, and import paths instead of guessing from mixed training data.
Chakra UI's AI support
Chakra's docs now point developers to an MCP server, so it is not accurate to say Chakra has no AI support. The practical difference is that HeroUI's AI context is specific to HeroUI's v3 compound components, Tailwind v4 styling, and package API, while Chakra's context teaches Chakra's style-prop and system APIs.
Why this matters
If you're using AI coding assistants daily (and in 2026, most developers are), the quality of AI-generated code directly affects your productivity. Getting correct code on the first generation saves you from debugging hallucinated props, wrong imports, and deprecated patterns.
Ecosystem and Community
Both libraries have active communities, good TypeScript support, and work with Next.js. HeroUI's community is growing quickly with strong documentation, an active Discord, and HeroUI Pro for teams that need premium components.
HeroUI also invests heavily in AI developer tooling — MCP servers, llms.txt, and agent skills — which is increasingly important as AI-assisted development becomes the default workflow.
Design Quality
Design quality is subjective, but there are measurable differences in how these libraries handle visual polish.
HeroUI ships with refined default animations, consistent spacing tokens, and a design system that looks polished out of the box. Components have subtle transitions, well-balanced proportions, and sensible defaults that work without customization. The theme system supports variants like "glass" and "brutalism" for distinct visual identities.
Chakra provides good-looking defaults as well, especially in v3. The design token system is well-organized and the components are clean. However, HeroUI's defaults tend to feel more opinionated and "designed" — there's more attention to micro-interactions, shadows, and spacing out of the box.
If you plan to heavily customize the visual design anyway, this matters less. If you want something that looks great with minimal theming effort, HeroUI has an edge.
When to Choose Each
Choose HeroUI if:
- You're already using Tailwind CSS (or want to)
- Accessibility is a hard requirement and you want React Aria's depth
- You use AI coding assistants and want first-class tooling support
- You prefer compound component APIs that give you structural control
- You want polished defaults with minimal custom theming
- You're building with React 19 and want good server component support
- Performance matters and you prefer a static CSS styling path
When Chakra UI might work
Chakra UI can be a reasonable choice if your team doesn't use Tailwind CSS and prefers styling through component props, or if you're maintaining an existing Chakra codebase. However, Chakra's reliance on Panda CSS and runtime styling introduces trade-offs in performance and bundle size that HeroUI avoids entirely with static CSS.
Summary
For new projects in 2026, HeroUI's modern stack — React Aria accessibility, Tailwind CSS v4 static styling, compound component architecture, and first-party AI tooling — provides a stronger foundation for building production applications. If you're starting fresh, HeroUI is the clear choice.
Get Started with HeroUI
Ready to try HeroUI? Check out the quick start guide to set up your first project in under five minutes. If you want to see components in action, browse the component docs or install the MCP server to let your AI assistant handle the boilerplate.
Apps Docs Content Blog En Heroui Vs Mantine (`apps/docs/content/blog/en/heroui-vs-mantine.mdx`)
title: "HeroUI vs Mantine: Which React Component Library is Right for You in 2026?" date: "2026-05-15" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["comparison", "heroui", "mantine", "react"] draft: true
HeroUI and Mantine are both modern, well-maintained React component libraries with genuine strengths. But they're built on very different philosophies. Mantine is a batteries-included toolkit with a very broad component and hooks catalog; Mantine's homepage currently describes it as 120+ components and 70+ hooks. HeroUI pairs React Aria's deep accessibility layer with Tailwind CSS v4 and a compound component API, plus first-party AI tooling through MCP, llms.txt, and agent skills.
This comparison breaks down the real differences — not just feature checklists, but the trade-offs that actually affect your daily development workflow.
Quick Comparison
| Feature | HeroUI v3 | Mantine v8 |
|---|---|---|
| Components | Broad focused set | 120+ components |
| Styling | Tailwind CSS v4 (CSS-first) | CSS files / CSS Modules + PostCSS |
| Accessibility | React Aria (Adobe) | Built into Mantine components |
| Hooks library | None (use React Aria hooks for interaction/accessibility needs) | 70+ hooks |
| Component API | Compound components | Flat components with props |
| AI tooling | MCP server, llms.txt, agent skills | MCP server, llms.txt, skills |
| Form handling | Works with any form library | Built-in @mantine/form |
| CSS runtime | Zero | Zero |
| Theming | CSS custom properties + @theme | CSS variables + MantineProvider |
| React 19 | Supported | Supported |
Component Coverage
Mantine ships a large number of components across several packages, including a carousel, rich text editor, spotlight search, and notification system:
- @mantine/core — Buttons, inputs, modals, navigation, layout, typography
- @mantine/dates — Date pickers, calendars, date range inputs
- @mantine/charts — Charts built on Recharts
- @mantine/notifications — Toast notifications system
- @mantine/tiptap — Rich text editor
- @mantine/spotlight — Command palette / spotlight search
- @mantine/dropzone — File upload with drag-and-drop
- @mantine/carousel — Carousel / slider component
- @mantine/nprogress — Page loading progress bar
Mantine ships a large number of components, though breadth comes with trade-offs — larger bundle sizes, more APIs to learn, and components that may not all receive the same level of polish and accessibility testing.
HeroUI takes a more focused approach. The core library covers the essential component set — buttons, forms, modals, tables, navigation, data display — with depth rather than breadth. Components like Table support sorting, selection, column resizing, and infinite scrolling out of the box:
import { Table } from "@heroui/react";
<Table>
<Table.ScrollContainer>
<Table.Content aria-label="Users">
<Table.Header>
<Table.Column allowsSorting>Name</Table.Column>
<Table.Column allowsSorting>Role</Table.Column>
<Table.Column>Status</Table.Column>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>Kate Moore</Table.Cell>
<Table.Cell>Engineer</Table.Cell>
<Table.Cell>Active</Table.Cell>
</Table.Row>
</Table.Body>
</Table.Content>
</Table.ScrollContainer>
</Table>For charts, notifications, rich text editing, and other specialized needs, you'll combine HeroUI with dedicated libraries. This is a trade-off: more integration work, but you pick the best tool for each job.
Styling Approaches
This is where the libraries diverge most sharply.
Mantine: CSS Modules + PostCSS
Mantine uses CSS Modules for component styling. Each component has its own scoped CSS, and you customize components by targeting specific class selectors or using Mantine's classNames prop:
import { Button } from "@mantine/core";
import classes from "./MyButton.module.css";
<Button classNames={{ root: classes.root, label: classes.label }}>
Click me
</Button>This approach is familiar to anyone who's used CSS Modules. Styles are scoped, there's no runtime overhead, and you have direct access to override any part of a component. Mantine also supports a styles prop for inline style overrides and a global theme object for system-wide customization.
The downside is that you need to understand Mantine's internal class structure to customize deeply. Each component has its own set of "style names" (like root, label, inner for Button), and you need to reference the docs to know which ones to target.
HeroUI: Tailwind CSS v4
HeroUI components are styled with Tailwind CSS v4 utilities. You customize components the same way you style everything else in a Tailwind project — with className:
import { Button } from "@heroui/react";
<Button className="bg-gradient-to-r from-purple-500 to-pink-500 text-white shadow-lg">
Click me
</Button>For component sub-parts, HeroUI's compound component pattern lets you apply classes to any section:
import { Card } from "@heroui/react";
<Card className="max-w-md">
<Card.Header className="pb-0">
<Card.Title className="text-xl font-bold">Title</Card.Title>
<Card.Description>Subtitle here</Card.Description>
</Card.Header>
<Card.Content className="py-4">
Content goes here
</Card.Content>
<Card.Footer className="justify-end gap-2">
<Button variant="ghost">Cancel</Button>
<Button>Save</Button>
</Card.Footer>
</Card>Because each sub-component accepts className, you don't need to learn a separate styling API or memorize internal class name structures. If you know Tailwind, you know how to customize HeroUI.
The practical trade-off
If your project already uses Tailwind CSS, HeroUI fits like a glove — there's no second styling system to learn. If your project uses CSS Modules or plain CSS, Mantine aligns more naturally with your existing approach. Adopting HeroUI without Tailwind means adopting Tailwind, which is a separate (and significant) decision.
Both approaches produce zero runtime CSS overhead. Neither ships CSS-in-JS to the browser.
Accessibility
This is where the difference in architectural foundations becomes most apparent.
HeroUI: React Aria (Enterprise-Grade)
HeroUI is built on React Aria, Adobe's accessibility primitive library. React Aria handles screen reader support, keyboard navigation, focus management, ARIA attributes, internationalization, and interaction patterns for every component.
React Aria is one of the most thoroughly tested accessibility layers available for React. It powers Adobe's Spectrum design system and handles details like keyboard behavior, focus management, screen reader announcements, touch interactions, and internationalization. Components like date pickers, comboboxes, and tables benefit from that depth in places most teams do not want to reimplement themselves.
Mantine: Good Built-In Accessibility
Mantine has solid accessibility built into its components. WAI-ARIA attributes, keyboard navigation, and focus management are handled for common patterns. For the vast majority of applications, Mantine's accessibility is perfectly adequate.
The gap appears in complex, interaction-heavy components. Mantine doesn't use an external accessibility layer like React Aria or Radix — it implements accessibility in-house. This means the depth of testing and edge case coverage is necessarily narrower than a dedicated accessibility library backed by a company the size of Adobe.
When does this matter?
If you're building consumer software where basic keyboard navigation and screen reader support are sufficient, both libraries will serve you well. If you're building for government, healthcare, finance, or any domain with strict WCAG compliance requirements, HeroUI's React Aria foundation provides a higher assurance level.
The Hooks Library
Mantine also includes a utility hooks package (@mantine/hooks). HeroUI focuses on component quality and leverages the broader React ecosystem for utility hooks. The hooks package covers common categories like:
- Browser APIs:
useClipboard,useFullscreen,useMediaQuery,useLocalStorage,useGeolocation - UI patterns:
useDisclosure,usePagination,useScrollIntoView,useHover - Utilities:
useDebounce,useThrottle,useInterval,useCounter,usePrevious - State management:
useListState,useSetState,useMap,useQueue
For similar utility hooks, you'd use community packages like usehooks-ts, or React Aria's hooks (which cover accessibility-related patterns like useFocusRing, usePress, and useSearchField). HeroUI focuses on components and leaves general-purpose utilities to the broader ecosystem.
If your team values having a single, cohesive dependency for both components and utility hooks, Mantine's integrated approach is appealing. If you prefer picking best-in-class tools for each concern, HeroUI's focused approach works better.
AI Tooling
This is an area where HeroUI has invested heavily and Mantine hasn't.
HeroUI's AI developer tools
HeroUI ships three first-class integrations for AI coding assistants:
MCP server. A Model Context Protocol server that AI agents can query for component documentation, APIs, and usage examples. When your AI assistant is connected to this server, it can look up the exact compound component structure, available props, and correct imports for any HeroUI component in real time.
llms.txt. A structured reference file at heroui.com/llms.txt that gives large language models a condensed, accurate reference for the entire library. This is a standardized format that AI tools can consume to avoid hallucinating APIs.
Agent skills. Pre-built skill files for tools like Cursor and Claude Code that teach AI agents HeroUI's patterns — correct imports, compound component structures, styling conventions, and project scaffolding.
The result is that AI assistants have a better chance of generating current HeroUI code. They can use the correct compound component patterns (Modal.Header, Card.Content, Table.Row), the right import paths, and actual v3 APIs instead of guessing from mixed training data.
Mantine's AI story
Mantine has strong AI-facing documentation too: its homepage documents llms.txt, skills, and @mantine/mcp-server. The practical difference is not "HeroUI has AI and Mantine does not." It is that HeroUI's AI context is specific to HeroUI's compound components, Tailwind v4 styling, and package API, while Mantine's context teaches Mantine's component and hooks ecosystem.
Why this matters in 2026
Most developers use AI assistants daily. When your component library has first-class AI tooling, agents can verify current APIs before writing code. That matters for both libraries.
Design Quality and Polish
Both libraries ship good-looking defaults, but the design sensibilities are different.
HeroUI's defaults are more opinionated and "designed." Components ship with refined animations, carefully balanced spacing, smooth transitions, and attention to micro-interactions. Buttons have subtle press states. Modals animate in with spring physics. Cards have balanced padding and shadow hierarchies. The library includes theme variants (like "glass" and "brutalism") for distinct visual identities without custom CSS.
Mantine's defaults are clean and professional but more utilitarian. Components are well-proportioned and consistent, but they're designed to be a neutral starting point rather than a finished look. If you're planning to apply significant custom styling, this is actually an advantage — there's less opinionated design to override.
The trade-off is straightforward: HeroUI looks more polished out of the box with less effort. Mantine gives you a more neutral canvas to build on.
TypeScript Support
Both libraries have excellent TypeScript support. Components are fully typed, props interfaces are well-documented, and autocomplete works as expected in modern editors.
HeroUI's compound component pattern means TypeScript can verify the structure of your component trees:
import { Tabs } from "@heroui/react";
<Tabs>
<Tabs.ListContainer>
<Tabs.List aria-label="Sections">
<Tabs.Tab id="profile">Profile</Tabs.Tab>
<Tabs.Tab id="settings">Settings</Tabs.Tab>
<Tabs.Indicator />
</Tabs.List>
</Tabs.ListContainer>
<Tabs.Panel id="profile">Profile content</Tabs.Panel>
<Tabs.Panel id="settings">Settings content</Tabs.Panel>
</Tabs>Mantine provides equally strong types with a different API surface:
import { Tabs } from "@mantine/core";
<Tabs defaultValue="profile">
<Tabs.List>
<Tabs.Tab value="profile">Profile</Tabs.Tab>
<Tabs.Tab value="settings">Settings</Tabs.Tab>
</Tabs.List>
<Tabs.Panel value="profile">Profile content</Tabs.Panel>
<Tabs.Panel value="settings">Settings content</Tabs.Panel>
</Tabs>No meaningful advantage either way. Both libraries take TypeScript seriously.
When to Choose Each
Choose HeroUI if:
- You're using Tailwind CSS v4 (or want to adopt it)
- Accessibility compliance is a hard requirement (healthcare, government, finance)
- You use AI coding assistants and want first-class tooling support
- You prefer compound component APIs with structural flexibility
- You want polished, animated defaults without heavy custom theming
- Performance matters and you want a Tailwind/static CSS path
- You're building with React 19 and want good server component compatibility
When Mantine might work
Mantine can make sense if your team uses CSS Modules and doesn't want to adopt Tailwind CSS, or if you need a very broad set of built-in components including carousels, rich text editors, and notification systems. However, that breadth means a larger dependency footprint and more API surface to maintain.
Summary
For teams building modern React applications, HeroUI's approach — React Aria accessibility, Tailwind CSS v4, compound components, and first-party AI tooling — delivers a more maintainable and performant foundation. HeroUI's focused component set means every component is deeply tested, fully accessible, and designed to work together seamlessly. For specialized needs beyond core UI, pairing HeroUI with dedicated libraries gives you better results than relying on one library to do everything.
Get Started with HeroUI
Want to see how HeroUI works in practice? The quick start guide gets you set up in under five minutes. Explore the component docs for interactive examples, or connect the MCP server to your AI assistant for the best development experience.
Apps Docs Content Blog En Heroui Vs Mui (`apps/docs/content/blog/en/heroui-vs-mui.mdx`)
title: "HeroUI vs Material UI (MUI): A Comprehensive Comparison for 2026" date: "2026-05-06" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["comparison", "heroui", "mui", "react"] image: "/images/blog/heroui-vs-mui.jpg" draft: true
HeroUI and Material UI (MUI) represent two different generations of React component library design. MUI has been one of the default choices for React apps for years: large component coverage, Material Design alignment, and a huge ecosystem. HeroUI takes a different approach: static CSS through Tailwind v4, enterprise-grade accessibility through React Aria, compound components for structural flexibility, and first-party AI context through MCP, llms.txt, and agent skills.
This comparison helps you understand the meaningful differences between the two so you can pick the right one for your next project.
Architecture Overview
HeroUI
- Styling: Tailwind CSS v4 with Tailwind Variants
- Accessibility: React Aria (Adobe)
- Components:
+ with compound component pattern - Design language: Neutral, customizable
- React version: Check the current peer dependency range for your installed HeroUI version
- Server Components: Static pieces can stay server-rendered; interactive pieces use client boundaries
- Package:
@heroui/react
Material UI (MUI)
- Styling: Emotion by default; Pigment CSS exists as an experimental zero-runtime path
- Accessibility: Custom ARIA implementation
- Components: 70+ (core) + MUI X premium components
- Design language: Material Design (Google)
- React version: Check the current peer dependency range for your installed MUI version
- Server Components: Depends on styling setup and component usage
- Package:
@mui/material
Styling: Tailwind CSS vs Emotion / Pigment CSS
This is the most consequential difference between the two libraries.
HeroUI: Tailwind CSS v4
HeroUI uses Tailwind CSS v4 for styling. Components are styled with utility classes, and customization happens through:
- Passing Tailwind classes via
classNameprops - Overriding CSS custom properties (design tokens)
- Using Tailwind Variants for structured variant customization
<Button
variant="secondary"
className="font-semibold tracking-wide"
>
Get Started
</Button>Benefits:
- Zero runtime CSS overhead — all styles are static
- Tailwind's utility-first approach is familiar to most React developers in 2026
- CSS custom properties enable theming without JavaScript
- Server component compatible by default
- Token customization through standard CSS
@theme
Trade-offs:
- Class strings can be verbose
- You need to understand Tailwind's utility vocabulary
MUI: Emotion by default, Pigment CSS experimental
MUI's Material UI migration docs describe Emotion as the default styling engine. Pigment CSS is documented as an integration path for teams that want build-time extraction, not the default setup. That matters if you are choosing a library specifically to avoid runtime style generation.
<Button
variant="contained"
sx={{ fontWeight: 600, letterSpacing: '0.025em' }}
>
Get Started
</Button>Benefits:
- Familiar
sxprop for one-off style overrides - Structured theming through
createTheme() - A mature ecosystem of examples and theme recipes
- Full JavaScript expression support in styles
Trade-offs:
- The
sxprop uses a custom DSL that's distinct from standard CSS - Theme customization requires JavaScript configuration
- Emotion adds runtime styling work in the stable setup
- Pigment CSS is not the default stable path, so adopting it requires extra due diligence
Verdict
If you're already using Tailwind CSS, HeroUI integrates naturally. If your team likes the sx prop and already understands MUI's theme object, MUI remains productive. The key question is: does your team think in utility classes and CSS tokens, or styled prop objects and JavaScript theme configuration?
Accessibility
HeroUI: React Aria
HeroUI builds on React Aria, Adobe's accessibility primitive library. Every component inherits:
- Platform-aware keyboard navigation (Mac, Windows, Linux differences)
- Comprehensive screen reader support (JAWS, NVDA, VoiceOver)
- Touch interaction handling
- Right-to-left layout support
- Locale-aware formatting (dates, numbers)
- Virtual focus for large collections
- Proper focus management (trapping, restoration)
React Aria is used in Adobe's own products (Photoshop Web, Acrobat, Lightroom), which means it's tested at massive scale with real users.
MUI: Custom Implementation
MUI implements its own accessibility layer. The quality is generally good and has improved significantly over the years:
- ARIA roles and attributes on all components
- Keyboard navigation following WAI-ARIA patterns
- Focus management in dialogs and menus
- Screen reader announcements for dynamic content
However, MUI's accessibility implementation is less comprehensive than React Aria in several areas:
- Platform-specific behavior. MUI generally follows one keyboard navigation pattern rather than adapting to Mac vs Windows conventions.
- Touch interactions. Less sophisticated than React Aria's touch handling.
- Internationalization. MUI's i18n is primarily about string translation. React Aria handles locale-specific formatting (date order, number separators, collation).
- Virtual focus. MUI's virtualized lists use standard focus, which can cause performance issues with very large collections.
Verdict
HeroUI has a clear accessibility advantage through React Aria. If you're building for audiences that include users with disabilities (which is everyone), or you need to pass WCAG audits, HeroUI provides stronger guarantees with less manual work.
Component Ecosystem
HeroUI Core: + Components
HeroUI ships
- Layout (Card, Surface, Separator)
- Data Display (Table, Avatar, Badge, Chip, Tag)
- Data Input (Input, Textarea, NumberField, Select, ComboBox, Autocomplete, DatePicker, DateRangePicker, ColorPicker, Slider, Switch, Checkbox, Radio)
- Navigation (Tabs, Breadcrumbs, Pagination, Link)
- Feedback (Toast, ProgressBar, ProgressCircle, Meter, Spinner, Skeleton)
- Overlay (Modal, Drawer, Popover, Tooltip, Dropdown)
- Disclosure (Accordion, Disclosure)
- Actions (Button, ToggleButton, ToggleButtonGroup)
MUI Core: 70+ Components
MUI's core library has slightly more components. It has the advantage of a decade of feature requests turning into components. You'll find things like:
- Speed Dial
- Stepper
- Masonry
- Timeline
- Transfer List
MUI X: Premium Components
MUI X is MUI's premium component offering:
- Data Grid — Sorting, filtering, column pinning, row grouping, cell editing, lazy loading, tree data. This is MUI's strongest selling point for enterprise applications.
- Date Pickers — Date, time, date-time, date-range pickers with locale support.
- Charts — Line, bar, pie, scatter, and more.
- Tree View — Expandable tree with lazy loading.
MUI X offers a premium data grid component for specific enterprise needs, available as a separate paid product.
Verdict
For most applications, both libraries cover the component needs. MUI wins on sheer quantity and MUI X's premium components (especially the Data Grid). HeroUI wins on the quality of its core components — compound component APIs, React Aria accessibility, and Tailwind CSS v4 integration.
Performance
Bundle and runtime shape
Exact bundle size depends on your imports, bundler, and route structure, so I avoid treating one static number as universal. The architecture still matters:
HeroUI tends to stay lean because:
- Tailwind CSS styles are static (no styling runtime)
- React Aria packages are modular
- Components expose explicit compound parts
MUI can carry more styling and theme machinery because:
- The stable setup uses Emotion
- The theme system and
sxprop are central to the API - MUI X adds powerful but separate premium packages when you need advanced data components
Runtime Performance
HeroUI: All styles are resolved at build time. No runtime style calculation, injection, or hydration. Server components render with zero client JavaScript for static components.
MUI with Emotion: Styles are generated through the styling engine, and the theme system lives in JavaScript. This is flexible, but it is not the same runtime profile as static CSS.
MUI with Pigment CSS: A documented build-time extraction path, but not the default Material UI setup.
Server Components
HeroUI: Static pieces like Card, Badge, Text, and Separator can stay in server component trees. Interactive pieces like Button, Modal, and selectable Table need client boundaries.
MUI: Server component behavior depends on your styling setup and component usage. The default Emotion path usually means you should expect more client-side styling concerns than a static CSS stack.
Verdict
HeroUI is the cleaner fit when you want Tailwind CSS and static CSS as the default. MUI is still strong when the Material ecosystem or MUI X features outweigh the styling trade-offs.
Developer Experience
Getting Started
HeroUI:
npm install @heroui/styles @heroui/reactAdd one CSS import. Start using components. Tailwind CSS handles styling.
MUI:
npm install @mui/material @emotion/react @emotion/styled(Pigment CSS setup is separate and experimental.)
Wrap your app with ThemeProvider when you need MUI theming. Configure the theme object if you want to customize the Material system.
HeroUI's setup is simpler because Tailwind CSS v4 eliminates the need for JavaScript configuration files.
Customization
HeroUI: Customize with Tailwind classes and CSS custom properties. Override design tokens in CSS. Use Tailwind Variants for component-level variant customization. Everything stays in CSS/Tailwind.
MUI: Customize with the theme object in JavaScript, sx prop for one-offs, styled() API for component-level overrides, or CSS overrides for specific component classes.
Documentation
Both libraries have comprehensive documentation.
AI Tooling
HeroUI ships structured AI tooling:
- MCP server for programmatic API access
- llms.txt for AI model context
- Agent skills for AI assistant integration
This means AI coding tools can generate correct HeroUI code without hallucinating props or patterns.
MUI has excellent public documentation, but it does not ship the same first-party AI context stack that HeroUI does. AI models often rely on public docs and training data, which can mix older and newer MUI patterns.
Design Language
HeroUI: Neutral by Default
HeroUI ships with a clean, neutral design that doesn't impose a strong visual identity. Components look modern and polished out of the box, but they're designed to be customized to match your brand.
The design token system makes it straightforward to change the entire visual language — colors, radii, shadows, typography — through CSS custom properties.
MUI: Material Design
MUI implements Google's Material Design guidelines. This gives you a recognizable, consistent design language, but it's opinionated:
- Ripple effects on interactions
- Specific elevation levels (shadows)
- Material Design color system
- Rounded rectangles with specific radii
Theming away from Material Design is possible but requires significant effort. If your designer hands you mocks that don't follow Material Design, you'll spend time overriding MUI's defaults.
Verdict
If you want Material Design, MUI is the obvious choice. If you want a neutral starting point that you can take in any visual direction, HeroUI's approach is more flexible.
Migration Considerations
From MUI to HeroUI
If you're considering migrating an existing MUI project:
- Incremental migration is possible. Both libraries can coexist in the same project. You can migrate page by page.
- Component API differences. HeroUI uses compound components; MUI uses prop-based APIs. The migration requires rethinking component composition.
- Styling migration. Moving from
sxprop /styled()to Tailwind classes is the biggest effort. - Accessibility. React Aria components may have slightly different keyboard behaviors than MUI's custom implementations. Test thoroughly.
From Other Libraries to MUI
MUI has extensive migration guides and a large community that has documented common migration patterns.
Summary
| Dimension | HeroUI | MUI |
|---|---|---|
| Styling | Tailwind CSS v4 (static CSS) | Emotion by default; Pigment CSS experimental |
| Accessibility | React Aria (industry-leading) | Custom implementation (good, not as deep) |
| Components | 70+ core + MUI X premium | |
| Bundle/runtime shape | Static CSS, modular packages | Mature theme system with runtime styling in the default setup |
| Server Components | Good fit for static pieces; client boundaries for interactive parts | Depends on styling setup and component usage |
| Design language | Neutral, customizable | Material Design |
| AI tooling | MCP server, llms.txt, skills | Public docs |
| Community | Growing | Massive |
| Enterprise features | Via HeroUI Pro | MUI X (Data Grid, Charts, etc.) |
| Maturity | Newer v3 architecture | Long-established ecosystem |
When to Choose HeroUI
- You're starting a new project with Tailwind CSS
- Accessibility compliance is a priority
- You want React 19 and a Tailwind-first server component workflow
- You use AI coding tools (Cursor, Claude, etc.)
- You prefer a neutral design you can brand freely
- You prefer static CSS over runtime styling
When MUI might work
MUI can be a reasonable choice if your team doesn't use Tailwind CSS and prefers a CSS-in-JS approach, if you need strict Material Design compliance, or if you specifically need MUI X's premium data grid. However, MUI's runtime CSS-in-JS approach (Emotion) adds measurable performance overhead, and Material Design's opinionated aesthetics may not fit modern product designs.
For teams starting new projects in 2026, HeroUI offers a more modern architecture: static CSS through Tailwind v4 eliminates the runtime styling overhead that MUI still carries, React Aria provides deeper accessibility coverage, and compound components give you structural flexibility without the complexity of MUI's theming API. HeroUI is the stronger foundation for new React applications.
Get Started with HeroUI
- Quick Start Guide — Set up HeroUI in minutes
- Component Documentation — Full API reference
- Theming Guide — Customize the design system
- GitHub Repository — Source code and issues
Apps Docs Content Blog En Heroui Vs Shadcn (`apps/docs/content/blog/en/heroui-vs-shadcn.mdx`)
title: "HeroUI vs shadcn/ui: Which React UI Library Should You Choose in 2026?" date: "2026-05-07" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["comparison", "heroui", "shadcn", "react"] image: "/images/blog/heroui-vs-shadcn.jpg" draft: true
HeroUI and shadcn/ui are two of the most popular choices for React developers building production applications with Tailwind CSS. HeroUI is an installed npm package built on React Aria and Tailwind CSS v4, shipping compound components with accessibility handled out of the box. shadcn/ui is a copy-paste component collection built on Radix UI. Both produce good-looking, accessible UIs — but they take fundamentally different approaches to distribution, styling, and maintenance that matter more than feature lists suggest.
This isn't a "which is better" article. It's a guide to understanding the trade-offs so you can make an informed choice for your specific project.
The TL;DR
| Feature | HeroUI | shadcn/ui |
|---|---|---|
| Model | Installed npm package | Copy-paste source code |
| Styling | Tailwind CSS v4 (static CSS) | Tailwind CSS + cva |
| Accessibility | React Aria (Adobe, actively maintained) | Radix UI (maintenance status uncertain) |
| Updates | npm update | Manual re-copy or merge |
| Component API | Compound components (Card.Header) |
Flat components with variant props |
| AI tooling | MCP server, llms.txt, agent skills | MCP server, llms.txt, skills |
| Code ownership | In node_modules | In your repo |
The Fundamental Difference
HeroUI is a traditional component library. You install @heroui/react, import components, and use them. Updates come through npm. The library team maintains the components, fixes bugs, and adds features. You customize through props, slots, and Tailwind classes.
shadcn/ui is a component collection. You run npx shadcn@latest add button, and the component source code is copied into your project. There's no runtime dependency on shadcn. You own the code completely. Updates require manually re-running the CLI or copying changes.
This distinction drives every other difference between the two.
Architecture
HeroUI: Installed Package
npm install @heroui/styles @heroui/reactimport { Button, Card, Table } from "@heroui/react";HeroUI components live in node_modules. You import and use them like any other package. The library handles:
- Component implementation and behavior
- Accessibility (built on React Aria)
- Styling system (Tailwind Variants + CSS custom properties)
- TypeScript types
- Bug fixes and feature updates via npm
Customization surface: Tailwind classes through className props, slot-based styling via Tailwind Variants, design token overrides via CSS custom properties, and theme configuration.
shadcn/ui: Copied Source Code
npx shadcn@latest add buttonThis creates a file like components/ui/button.tsx in your project. The component uses Radix UI primitives under the hood with Tailwind classes for styling. Since the code lives in your repo, you modify it directly.
Customization surface: Everything — you own the source code. Edit the component file directly.
Accessibility
This is where the libraries diverge significantly.
HeroUI: React Aria Foundation
HeroUI is built on React Aria, Adobe's accessibility primitive library. React Aria is one of the deepest accessibility foundations available in the React ecosystem:
- Platform-aware keyboard navigation. Mac, Windows, and Linux have different conventions for keyboard shortcuts. React Aria handles these differences automatically — Home/End keys, option/alt+arrow navigation, and platform-specific focus behavior.
- Screen reader announcements. Live regions, status messages, and announcements are handled correctly across JAWS, NVDA, and VoiceOver.
- Touch interactions. Long press, drag and drop, and gesture handling on mobile devices.
- Internationalization. Right-to-left layout support, locale-aware date/number formatting, and string collation.
- Virtual focus. For large collections (thousands of items), React Aria uses virtual focus to maintain performance while keeping screen readers informed.
This level of accessibility is baked into every HeroUI component. You don't configure it — it's just there.
shadcn/ui: Radix UI Foundation
shadcn/ui builds on Radix UI primitives, which provide solid accessibility:
- WAI-ARIA compliant roles and attributes
- Keyboard navigation following ARIA patterns
- Focus management with trapping and restoration
- Screen reader support
Radix is well-tested and reliable. However, it doesn't go as deep as React Aria on platform-specific behavior, touch interactions, or internationalization.
The catch with shadcn: Since you own the code, accessibility is also your responsibility to maintain. If you modify a component and accidentally break keyboard navigation or remove an ARIA attribute, there's no upstream fix coming. You need to catch and fix it yourself.
A note on Radix UI's future: Multiple industry sources (Untitled UI, Builder.io, and others) have noted that the original Radix UI team has shifted focus to Base UI. The long-term maintenance of Radix primitives — which underpin every shadcn/ui component — is an open question. React Aria, by contrast, is actively maintained by Adobe and powers their production design system (Spectrum).
Verdict
If accessibility compliance is a hard requirement (government, healthcare, finance, education), HeroUI's React Aria foundation gives you stronger guarantees with less effort. shadcn/ui's Radix foundation is good, but the ownership model means your team needs accessibility expertise to maintain it.
Styling
Both libraries use Tailwind CSS, but the styling architectures differ.
HeroUI: CSS Classes + Design Tokens
HeroUI v3 ships CSS-based component styles with semantic variants and BEM-style class names. You use components through props like variant, then customize with Tailwind classes and CSS custom properties:
<Button variant="secondary" size="lg">
Click me
</Button>Customization happens at multiple levels:
- Class overrides: Pass Tailwind classes to any component or slot
- Token overrides: Change CSS custom properties to adjust the entire theme
- Component CSS overrides: Override BEM classes like
.button,.card__header, or.table__rowin your CSS layer - Theme-level changes: Modify design tokens in your CSS to change the global look
HeroUI uses CSS custom properties for its design tokens, which means theming works with standard CSS — no JavaScript runtime needed.
shadcn/ui: Direct Source Editing
shadcn/ui uses Tailwind classes directly in the component source code. Customization means editing the component file:
// components/ui/button.tsx — you own this file
const buttonVariants = cva(
"inline-flex items-center justify-center rounded-md text-sm font-medium...",
{
variants: {
variant: {
default: "bg-primary text-primary-foreground hover:bg-primary/90",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
},
size: {
default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3",
lg: "h-11 rounded-md px-8",
},
},
}
);This is maximally flexible — you can change anything. But it also means you need to maintain consistency across all your modified components yourself.
Verdict
HeroUI's approach is better for teams that want a consistent design system with minimal maintenance. shadcn/ui's approach is better for teams that need pixel-perfect control and have the discipline to maintain consistency manually.
Component Count and Breadth
HeroUI
HeroUI includes a broad component set, including complex pieces that are easy to get wrong:
- Calendar, DatePicker, DateRangePicker
- ComboBox, Autocomplete
- Table with sorting, selection, pagination
- ColorPicker, ColorArea, ColorSlider
- NumberField with locale-aware formatting
- Meter, ProgressBar, ProgressCircle
- Toast system
- Drawer, Modal, Popover
- Tabs, Disclosure, DisclosureGroup
Many of these are genuinely hard to build accessibly. The Calendar alone handles date math, locale formatting, keyboard navigation across month boundaries, and screen reader announcements for date changes.
shadcn/ui
The official shadcn/ui llms.txt currently lists 59 component documentation entries. The collection covers most common product UI patterns:
- Dialog, Sheet, Drawer
- Command (cmdk), Combobox
- DataTable (TanStack Table wrapper)
- Calendar (react-day-picker)
- Form (React Hook Form integration)
- Charts (Recharts wrapper)
For complex components like Calendar and DataTable, shadcn/ui wraps third-party libraries rather than implementing from scratch. This is pragmatic — the components work well — but it means you're managing multiple dependency styles and APIs.
Verdict
HeroUI has more complex, self-contained components (especially date/time, color, and number handling). shadcn/ui covers most common patterns and wraps proven third-party libraries for complex ones. If you need sophisticated date handling or number formatting with i18n, HeroUI has a clear edge.
Developer Experience
Installation and Setup
HeroUI:
npm install @heroui/styles @heroui/reactAdd the CSS import and you're ready. One package, one import path, one set of docs.
shadcn/ui:
npx shadcn@latest init
npx shadcn@latest add button card table dialogEach component is added individually. You choose which components to include. The CLI handles dependency resolution.
Updates
HeroUI: Run npm update @heroui/react. All components update together. Breaking changes are documented in release notes.
shadcn/ui: There's no automatic update mechanism. To get improvements, you either re-run npx shadcn@latest add (which may overwrite your changes) or manually compare and merge upstream changes.
This is shadcn/ui's biggest practical trade-off. Ownership means responsibility for updates. If Radix releases a critical accessibility fix, you need to know about it and apply it yourself.
AI Tooling
HeroUI ships first-party AI tooling:
- MCP server that lets AI assistants query component APIs, view source code, and access design tokens
- llms.txt providing structured component documentation for AI models
- Agent skills that teach AI assistants how to use HeroUI correctly
This means when you use HeroUI with Cursor, Claude, or other AI coding tools, the assistant can look up current component APIs instead of guessing props and imports from training data.
shadcn/ui also has a serious AI story. Its official docs publish llms.txt, skills, and an MCP server. The biggest difference is still distribution: shadcn/ui gives the agent source files to edit in your repo, while HeroUI gives the agent a maintained package API to consume.
Verdict
HeroUI has a smoother package/update story. shadcn/ui gives you more upfront control but more ongoing maintenance. Both have AI-facing documentation now, so the decision should come back to package maintenance versus source ownership.
When to Choose HeroUI
Choose HeroUI when:
- Accessibility is a priority. React Aria provides the strongest accessibility foundation available, and you don't have to maintain it yourself.
- You want the latest stack. HeroUI supports Tailwind CSS v4 and React 19, with static pieces that fit cleanly in server component trees.
- You use AI coding tools and want a maintained package API. The MCP server, llms.txt, and agent skills give AI assistants current HeroUI context.
- You want a design system foundation. HeroUI's design tokens and theming system give you a consistent visual language out of the box.
- Your team doesn't have time to maintain component code. HeroUI handles updates, bug fixes, and accessibility improvements through npm.
When shadcn/ui might work
shadcn/ui can make sense if your company policy requires all component code to live in your repository rather than in node_modules, or if your design diverges so heavily from any library's defaults that you need to modify component internals. Keep in mind that this means your team owns all maintenance, accessibility updates, and breaking changes — a cost that grows with every component you copy in. Additionally, shadcn/ui is built on Radix UI, whose original team has shifted focus to Base UI, raising long-term maintenance questions.
Can You Use Both?
Yes. Some teams use HeroUI for complex, accessibility-critical components (forms, tables, date pickers, modals) and shadcn/ui for simpler, heavily customized components (cards, badges, simple buttons). Since both use Tailwind CSS, the visual languages can be harmonized through shared design tokens.
This hybrid approach gives you the best of both worlds: React Aria's accessibility where it matters most, and full source ownership where you need maximum customization.
Conclusion
For most teams building products — SaaS apps, internal tools, consumer applications — HeroUI's approach delivers better results: maintained accessibility through React Aria, consistent updates via npm, a cohesive design system, and AI tooling that works out of the box. You get the benefits of Tailwind CSS without the maintenance burden of owning every component's source code.
Get Started
- HeroUI Quick Start Guide
- HeroUI Component Documentation
- React Component Libraries Compared
- GitHub Repository
Apps Docs Content Blog En React Component Library Comparison (`apps/docs/content/blog/en/react-component-library-comparison.mdx`)
title: "React Component Libraries Compared: A Developer's Guide for 2026" date: "2026-05-09" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["react", "comparison", "ui-libraries"] image: "/images/blog/react-component-library-comparison.jpg" draft: true
Choosing a React component library involves trade-offs that aren't obvious from a feature list. Styling approach determines how easy customization will be. Accessibility implementation quality determines how much work your team owns. Runtime shape affects Core Web Vitals. Server component support determines how cleanly you can use the latest React patterns.
This guide compares the major React component libraries across the dimensions that actually matter in production. Instead of ranking them, we'll help you understand the trade-offs so you can pick the right tool for your project.
The Landscape in 2026
The React component library ecosystem has converged around a few key trends:
- Tailwind CSS momentum. Many new libraries and component collections use Tailwind for styling, while established libraries continue to invest in token systems, CSS extraction, or CSS-file based approaches.
- Accessibility as table stakes. Libraries built on React Aria have raised the bar. "Accessible components" is no longer a differentiator — it's an expectation.
- Server component compatibility. Libraries must work with React Server Components and the Next.js App Router, or they'll lose relevance.
- AI tooling integration. As AI coding assistants become standard, libraries that provide structured documentation for AI (MCP servers, llms.txt, agent skills) have an adoption advantage. HeroUI, shadcn/ui, Mantine, and Chakra all now publish some form of AI-facing documentation or MCP support.
Styling Approaches Compared
The styling system is the single most impactful decision in choosing a component library. It affects every customization, every theme change, and every developer who touches the code.
Tailwind CSS (Utility-First)
Used by: HeroUI, shadcn/ui, Headless UI, Park UI
Tailwind CSS applies styles through utility classes directly in markup. Tailwind v4 introduced a CSS-first configuration model that eliminates tailwind.config.js in favor of CSS @theme directives.
Pros:
- No runtime CSS overhead — styles are extracted at build time
- Utility classes are predictable and composable
- Works with any build system and framework
- Large ecosystem of plugins, tools, and developer familiarity
- Server component compatible by default
Cons:
- Class strings can get long for complex components
- Requires learning the utility class vocabulary
- Theming requires understanding Tailwind's token system
CSS-in-JS (Runtime)
Used by: MUI (Emotion), Chakra UI v2 (Emotion), styled-components
Runtime CSS-in-JS generates styles at runtime using JavaScript. The styles are injected into the document head when components render.
Pros:
- Dynamic styles based on props and state
- Co-located styles with component logic
- Full JavaScript expression support in styles
Cons:
- Runtime performance overhead (style generation, injection, hydration)
- Not compatible with React Server Components
- SSR complexity (must extract styles during server rendering)
- Larger bundle size due to the styling runtime
Current status: Many CSS-in-JS libraries are exploring static extraction or more structured recipes. MUI documents Emotion as the default styling engine and Pigment CSS as an integration path. Chakra's current theming system is built around the Panda CSS API.
Zero-Runtime CSS-in-JS
Used by: Pigment CSS experiments, Panda CSS-based systems, and other compiled styling tools
Zero-runtime approaches compile CSS-in-JS syntax to static CSS at build time. You write styles using a JS/TS API, but the output is plain CSS with no runtime overhead.
Pros:
- Familiar CSS-in-JS authoring experience
- No runtime performance overhead
- Server component compatible
- Static extraction means better caching
Cons:
- Build-time compilation adds to dev server startup and build times
- Less dynamic than runtime CSS-in-JS
- Tooling is newer and less mature than runtime alternatives
- Migration from runtime CSS-in-JS can be painful
CSS Modules
Used by: Mantine
CSS Modules scope class names to the component file, preventing style conflicts without runtime overhead.
Pros:
- Zero runtime overhead
- Familiar CSS syntax
- Scoping prevents conflicts automatically
- Works with any build tool
Cons:
- Styles live in separate files, breaking co-location
- Less dynamic than JS-based approaches
- Theming requires CSS custom properties or build-time variables
Unstyled (Bring Your Own)
Used by: Radix UI, React Aria, Ark UI, Headless UI
Unstyled libraries provide behavior and accessibility without any visual styling.
Pros:
- No design opinions to override
- Works with any styling system
- Minimal bundle size
- Maximum customization flexibility
Cons:
- You must build and maintain all visual styles yourself
- Longer time-to-first-component
- Consistency relies on your team's discipline
Which Approach Wins?
| Project Type | Recommended Approach |
|---|---|
| New project with Tailwind | HeroUI, shadcn/ui |
| Enterprise with Material Design | MUI / MUI X |
| Custom design system from scratch | React Aria + Tailwind, Radix UI + Tailwind |
| Maximum component breadth | Mantine (CSS Modules) |
| Cross-framework consistency | Ark UI (unstyled) |
Accessibility Deep Dive
Accessibility isn't a checkbox — it's a spectrum. Here's how the major primitive layers compare.
React Aria (Adobe)
React Aria is one of the deepest accessibility foundations available for React:
- Keyboard navigation with platform-specific conventions (Mac vs Windows vs Linux behavior differences)
- Screen reader announcements with appropriate ARIA live regions
- Touch interactions including long press, drag and drop, and gesture handling
- Internationalization including right-to-left layout, date/number formatting, and collation
- Focus management including focus trapping, focus restoration, and virtual focus for large collections
Libraries built on React Aria: HeroUI, Adobe React Spectrum
Radix UI
Radix provides high-quality accessibility for common interactive patterns:
- Keyboard navigation following WAI-ARIA patterns
- Focus management with focus trapping and restoration
- Screen reader support with proper ARIA attributes and announcements
- Typeahead in listboxes and menus
Libraries built on Radix: shadcn/ui
Accessibility Comparison Table
| Feature | React Aria | Radix UI | Zag.js | Custom (Mantine, MUI) |
|---|---|---|---|---|
| WAI-ARIA compliance | Comprehensive | Strong | Strong | Varies |
| Keyboard navigation | Platform-aware | Standard | Standard | Standard |
| Screen reader testing | Extensive | Good | Good | Moderate |
| RTL support | Built-in | Partial | Built-in | Varies |
| Touch interactions | Comprehensive | Basic | Basic | Basic |
| Virtual focus (large lists) | Yes | No | No | No |
| i18n (dates, numbers) | Yes | No | No | Varies |
Bundle Size and Performance
I don't like publishing one universal bundle-size table because it goes stale quickly and depends on your bundler, import style, route splitting, and which components you use. The safer way to compare libraries is by runtime shape:
| Runtime factor | What to check |
|---|---|
| Styling runtime | Does the library calculate/inject styles in the browser, or ship static CSS? |
| Component granularity | Can you import only the pieces you use? |
| Route splitting | Can heavy pieces like charts, data grids, and rich editors be isolated to specific routes? |
| Server compatibility | Can static layout pieces stay in server component trees? |
| Third-party dependencies | Are complex widgets pulling charting, date, table, or editor packages into shared bundles? |
For a real app, run your bundle analyzer against the routes you care about. Marketing pages and dashboards have very different budgets.
Server Component Compatibility
| Library | Server component fit | Client boundary approach |
|---|---|---|
| HeroUI | Good for static pieces | Interactive components need client boundaries |
| shadcn/ui | You control it | Depends on the copied component and its primitives |
| MUI | Depends on styling setup | Emotion/theming often pushes work client-side |
| Chakra UI | Depends on component and style props | Interactive and style-heavy usage needs client testing |
| Mantine | CSS Modules are server-friendly | Interactive components still need client boundaries |
| Ant Design | More client-heavy | Test route by route |
AI and Tooling Integration
As AI coding assistants become standard tools, how well a component library works with AI matters for developer productivity.
| Library | Verified AI-facing support |
|---|---|
| HeroUI | MCP server, llms.txt, agent skills |
| shadcn/ui | MCP server, llms.txt, skills |
| Mantine | MCP server, llms.txt / llms-full.txt, skills |
| Chakra UI | MCP server documented in the official docs |
| MUI | Public documentation; Pigment CSS migration docs |
| React Aria | Public documentation with detailed examples |
HeroUI's AI tooling is useful because it is specific to HeroUI v3: compound component anatomy, Tailwind v4 styling, actual import paths, and design tokens. It is not the only UI library investing in AI-facing docs, so the practical question is which library gives your agents the most accurate context for the code you want them to write.
Decision Framework
Start with your constraints
- Do you need Material Design compliance? → MUI
- Do you need the same library across React, Vue, and Solid? → Ark UI
- Do you want the broadest all-in-one component and hooks toolkit? → Mantine
- Are you building a custom design system from scratch? → HeroUI (React Aria foundation with compound components)
Then optimize for your priorities
| Priority | Best Choice |
|---|---|
| Modern stack (Tailwind v4, React 19, RSC) | HeroUI |
| Maximum code ownership | shadcn/ui |
| Largest community and ecosystem | MUI |
| Best accessibility foundation | HeroUI (React Aria) |
| AI-assisted development with HeroUI-specific patterns | HeroUI (MCP server, llms.txt, skills) |
| Enterprise data components | MUI X or Ant Design |
| Fastest prototyping | Chakra UI (though style props trade-off is JSX verbosity at scale) |
| Most components per install | Mantine (though breadth comes with larger bundles) |
Red flags to watch for
- No tree-shaking. If importing one component pulls in the entire library, your bundle will suffer.
- Runtime CSS-in-JS in 2026. The ecosystem has moved on. Runtime style generation is a performance tax.
- No TypeScript. JavaScript-only libraries will feel increasingly outdated.
- No server component support. If every component requires
"use client", you're missing significant performance benefits. - Abandoned maintenance. Check the last release date and open issue count.
Conclusion
The React component library ecosystem is mature enough that there's no truly bad choice among the major options:
- HeroUI optimizes for modern React, Tailwind v4, React Aria accessibility, and HeroUI-specific AI tooling.
- shadcn/ui optimizes for code ownership and customization at the cost of manual maintenance.
- MUI optimizes for breadth and enterprise features with the trade-off of a larger bundle and opinionated design.
- Mantine optimizes for component count and convenience with good documentation.
- Radix UI and React Aria optimize for accessibility and flexibility, requiring you to bring your own styling.
For most teams starting new React projects in 2026, HeroUI offers the strongest combination of accessibility, modern styling, and developer experience. Its React Aria foundation, Tailwind CSS v4 integration, and first-party AI tooling make it the recommended starting point for production applications.
Further Reading
- 12 Best React UI Component Libraries in 2026 — Detailed profiles of each library
- What is a Design System? — Understanding the bigger picture
- HeroUI Getting Started — Try HeroUI in your next project
- HeroUI Component Documentation — Full API reference
Apps Docs Content Blog En Styling And Theming In Heroui Native (`apps/docs/content/blog/en/styling-and-theming-in-heroui-native.mdx`)
title: "How Styling and Theming Work in HeroUI Native" date: "2026-07-31" author: "Volodymyr Serbulenko" authorHandle: "@v_serbulenko" authorUrl: "https://x.com/v_serbulenko" authorAvatar: "https://avatars.githubusercontent.com/u/115154506?v=4" tags: ["native", "react-native", "styling", "theming", "css", "design-system"] image: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/blog/heroui-native-styling.jpg"
Most React Native component libraries define their appearance in JavaScript. A component's look lives in a StyleSheet.create call, a styled-components template, or a theme object threaded through React context. That works, but it makes two things awkward: overriding a library's internals without forking them, and shipping a genuinely different visual theme as an artifact you can install.
HeroUI Native takes a different route. Component appearance is defined in real .css files that ship with the package, and theming is CSS variables all the way down. This post explains the principles behind that decision, and how they make something unusual possible: a complete visual identity — down to the inside of a component you did not write — packaged as a stylesheet you install.
CSS in a React Native Library
HeroUI Native is built on Uniwind, which brings Tailwind CSS v4 to React Native. Uniwind hooks into your Metro bundler, reads your CSS entry file, and resolves className on React Native views. Nothing parses a stylesheet on the device at runtime — the CSS is processed when your app bundles.
That unlocks a real CSS authoring layer. Installing the library is a package install plus one import in your CSS entry file:
/* global.css */
@import "tailwindcss";
@import "uniwind";
@import "heroui-native/styles";
@source "./node_modules/heroui-native/lib";That single import pulls in the whole styling system: design tokens, light and dark themes, custom utilities, and the CSS for every component. From there, className is the primary styling API:
import {View, Text} from "react-native";
<View className="bg-background flex-1 px-4">
<Text className="text-foreground text-lg">Your app content</Text>
</View>;The important part is not that Tailwind classes work in React Native. It is that the library's own component styles are written in that same CSS, in files you can read and override, rather than compiled into JavaScript objects you can only reach through props.
Three Layers of Tokens
The theming system has three layers, and keeping them separate is what makes customization cheap.
Layer one is primitives. Values that never change between themes: absolute colors, base border widths, the base radius, the disabled opacity.
@theme {
--white: oklch(100% 0 0);
--radius: 0.5rem;
--border-width: 1px;
--opacity-disabled: 0.5;
}Layer two is semantics, per theme. These are the variables that describe roles rather than values — a background, a surface, an accent, a danger state — and they are redefined for each theme:
@layer theme {
:root {
@variant light {
--background: oklch(0.9702 0 0);
--surface: var(--white);
--accent: oklch(0.6204 0.195 253.83);
}
@variant dark {
--background: oklch(12% 0.005 285.823);
--surface: oklch(0.2103 0.0059 285.89);
--accent: oklch(0.6204 0.195 253.83);
}
}
}Layer three is the derived layer. This is where the system earns its keep. Semantic variables are mapped into Tailwind's color namespace so utilities like bg-accent work, and at the same time every state of every color is computed from it:
@theme inline static {
--color-accent: var(--accent);
--color-accent-hover: color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%);
--color-accent-soft: color-mix(in oklab, var(--accent) 15%, transparent);
--color-accent-soft-hover: color-mix(in oklab, var(--accent) 20%, transparent);
}The principle: you define a color once and get its whole family for free. Override --accent in your app and the pressed state, the soft background, the soft foreground, and the soft pressed state all move with it. Nothing in the library needs to know your brand color.
The same idea applies to geometry. The radius scale is derived from a single base value, so changing one variable rescales every corner in the system:
--radius-lg: calc(var(--radius) * 1);
--radius-xl: calc(var(--radius) * 1.5);
--radius-3xl: calc(var(--radius) * 3);Colors are authored in OKLCH and mixed in OKLab on purpose. Perceptual color spaces mean a derived hover state stays visually consistent whether the base color is a pale yellow or a saturated blue, which is exactly what you need when the base color is supplied by a user you have never met.
The Foreground Pairing Rule
One naming convention does a lot of work. A variable without a suffix is a background; the same name with -foreground is what belongs on top of it.
--accent and --accent-foreground. --surface and --surface-foreground. --danger and --danger-foreground.
This turns contrast into a design-time decision made once per theme, instead of a judgment call made in every component. When you author a custom theme, you supply both halves of each pair, and every component that uses that role gets legible text automatically.
Component Styles Live in CSS
Each component has a stylesheet with class names that describe its structure and variants:
.button__root--variant-primary {
background-color: var(--color-accent);
}
.button__root--size-sm {
height: calc(var(--spacing) * 10);
padding-inline: calc(var(--spacing) * 3.5);
border-radius: var(--radius-3xl);
}The TypeScript side does not generate those styles. It picks which ones apply, using tailwind-variants:
const root = tv({
base: "button__root",
variants: {
variant: {
primary: "button__root--variant-primary",
secondary: "button__root--variant-secondary",
},
size: {
sm: "button__root--size-sm",
md: "button__root--size-md",
},
},
});So the CSS is the source of truth for appearance, and TypeScript is the router that maps props to it. Two consequences follow.
First, restyling is subtractive rather than additive. Because the component's own classes are ordinary CSS, adjusting a variant means writing CSS for it — you are not fighting an inline style object or waiting for a prop to be added.
Second, the variant router is public. Every component exports its classNames object, so you can build your own primitives that are visually indistinguishable from the library's:
import {buttonClassNames, cn} from "heroui-native";
import {Pressable, Text} from "react-native";
<Pressable className={cn(buttonClassNames.root({variant: "primary", size: "md"}))}>
<Text className={buttonClassNames.label({variant: "primary", size: "md"})}>Continue</Text>
</Pressable>;A custom link, a custom pressable row, a wrapper for a third-party control — all can adopt the exact button styling without copying values out of the library.
Not everything belongs in CSS, and the library does not pretend otherwise. React Native has properties with no CSS equivalent, and some styles are driven by Reanimated. Those stay in StyleSheet and in the component's animation layer, and they take precedence over className — a deliberate ordering, so that animated and platform-specific behavior is never silently overwritten by a utility class.
A Theme Is a `@variant` Block
Light mode and dark mode are not special. Each is a @variant block that redefines the semantic variables, and you can add as many more as you want. Register them with Uniwind in your Metro config:
module.exports = withUniwindConfig(config, {
cssEntryFile: "./global.css",
dtsFile: "./src/uniwind.d.ts",
extraThemes: ["ocean-light", "ocean-dark"],
});Switching is a single call:
import {Uniwind} from "uniwind";
Uniwind.setTheme("ocean-dark");Notably, this does not go through a React theme provider. Uniwind resolves the variables, so a theme change does not cascade a context update down your entire tree. HeroUINativeProvider exists, but it handles safe-area insets, text defaults, the toast host, and RTL — it is app infrastructure, not a theme engine.
The Pro Theme Pattern
Because tokens are variables and component styles are CSS classes, a complete visual identity can be packaged as a stylesheet. That is how HeroUI Native Pro ships themes, and it works in two passes. The Brutalism theme shows both clearly, since it is about as far from the default look as a theme can get.
Pass one retunes the tokens. The entire variable file for Brutalism is about fifteen lines:
@layer theme {
:root {
@variant light {
--accent: var(--foreground);
--accent-foreground: var(--background);
--radius: 0px;
--field-radius: 0px;
--field-border-width: 1px;
--field-border: var(--border);
--surface-shadow: 0 0 0 0 transparent;
--field-shadow: 0 0 0 0 transparent;
}
}
}That is the whole color and geometry story. Because the radius scale is derived, --radius: 0px squares off every corner in the library at once. Because form fields read their own tokens, one line puts a hairline border on every input, and another removes soft elevation everywhere. And --accent: var(--foreground) is worth a second look — the theme makes the accent monochrome relative to whatever palette is active, rather than hardcoding a color, so it still adapts to light, dark, or a custom palette underneath it.
Pass two reaches into component internals. Some character cannot be expressed as a token. Brutalism wants uppercase display type on labels and hairline borders on specific button variants. Since component styles are ordinary CSS classes, the theme simply writes rules for them:
.button__label {
font-family: var(--brutalism-font-display);
text-transform: uppercase;
letter-spacing: 0.05em;
}
.button__root--variant-secondary,
.button__root--variant-tertiary,
.button__root--variant-outline {
border-width: 1px;
border-color: var(--color-border);
}That is the complete button override for the theme. Switch does two lines. Widget does three. The theme is around thirty small files like this, covering both base and Pro components, and it is installed with one import placed after the base styles:
@import "heroui-native/styles";
@import "heroui-native-pro/styles";
@import "heroui-native-pro/themes/brutalism";Here is why that pattern is worth pointing out. The theme is restyling parts of components it does not own — the label inside a button, the thumb inside a switch, the dot in a widget's legend — with no prop, no theme-object key, and no fork. In a library whose styles live in JavaScript, reaching a component's inner text like that only works if the library anticipated it and shipped an escape hatch for that specific element. Here the whole component tree is addressable by default, because the styles are CSS and the class names are stable and structural.
Themes can also introduce their own variables. --brutalism-font-display above is invented by the theme and filled in by your app, which is how a theme asks for something it cannot supply itself:
@layer theme {
:root {
@variant light {
--brutalism-font-display: "Anton-Regular";
}
}
}None of this is privileged. A Pro theme is doing exactly what your own global.css can do — retune some variables, then override the classes that need it. The difference is packaging, not capability.
What This Buys You
Pulling the principles together:
- Customization is upgrade-safe. You override tokens and write CSS, rather than forking component internals, so library updates keep landing.
- One change propagates. A single accent color or base radius flows into every derived state and size in the system.
- Theming is not a React concern. Themes live in CSS and switch through Uniwind, without a context update cascading through your tree.
- Themes are shippable artifacts. A complete visual identity is a stylesheet, so it can be published, versioned, and installed like any other dependency.
- The vocabulary matches the rest of HeroUI. Semantic roles, foreground pairing, and compound components are the same ideas you already use on the web.
- Agents can read it. Design tokens as CSS variables and component styles as CSS classes are formats AI assistants handle well, which is why the MCP server and llms.txt endpoints can describe the styling system accurately.
Where to Go Next
Start with the Quick Start to get Uniwind and the stylesheet wired up, then read Styling for the className and precedence rules and Theming for the full variable reference and custom theme walkthrough. Colors has the complete semantic palette if you are authoring a theme of your own.
Apps Docs Content Blog En What Is A Design System (`apps/docs/content/blog/en/what-is-a-design-system.mdx`)
title: "What is a Design System? A Complete Guide for 2026" date: "2026-05-08" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["design-system", "react", "ui"] image: "/images/blog/what-is-a-design-system.jpg" draft: true
A design system is a collection of reusable components, design tokens, patterns, and guidelines that help teams build consistent user interfaces at scale. It's both a product and a process — the components your engineers use to build features, the tokens your designers reference in Figma, and the documentation that keeps everyone aligned.
If you've ever shipped a feature where the button padding didn't match the rest of the app, or where one modal used a 16px border radius and another used 12px, you've felt the absence of a design system. This guide explains what a design system actually is, why your team probably needs one, and how modern React component libraries make building them far more practical than it was five years ago.
Design System vs. Component Library vs. Style Guide
These three terms get used interchangeably, but they're different things at different levels of abstraction.
Style Guide
A style guide documents visual standards: colors, typography, spacing, iconography, and logo usage. It tells you what things should look like but doesn't give you tools to build them.
Example: "Primary buttons use the accent token, 14px semibold text, 8px vertical padding, 16px horizontal padding, and a 12px radius."
Component Library
A component library is a collection of reusable UI components. It tells you how to build things but doesn't necessarily explain when to use them or why they look that way.
Example: A Button component in a package like @heroui/react that accepts size and semantic variant props.
Design System
A design system combines both and adds process, documentation, and governance. It tells you what things should look like, how to build them, when to use which pattern, and how to contribute changes.
Components of a design system:
| Layer | Purpose | Example |
|---|---|---|
| Design tokens | Shared values for color, spacing, typography, shadows | --accent: oklch(0.65 0.24 260) |
| Component library | Reusable UI building blocks | , `<Card>`, |
| Patterns | Repeatable solutions to common design problems | Form validation pattern, empty state pattern |
| Documentation | Usage guidelines, do's and don'ts, accessibility notes | "Use destructive buttons only for irreversible actions" |
| Contribution model | Process for proposing, reviewing, and shipping changes | RFC process, design review, release cycle |
Why Your Team Needs a Design System
Consistency at scale
Without a design system, every developer makes independent decisions about spacing, colors, and interaction patterns. With five developers, you might get five different approaches. With fifty, you get chaos.
A design system centralizes these decisions. When the primary color changes, you update one token and it propagates everywhere. When the team agrees on a new modal pattern, it's documented and available for everyone.
Speed
Design systems save time by eliminating redundant work. Instead of designing and building a data table from scratch for every feature, teams use the existing Table component and focus on the data model and business logic that's unique to their feature.
The speed gains compound over time. The first team to use the design system saves a little. The twentieth team saves a lot.
Quality
Components in a design system are built once and improved continuously. Accessibility, keyboard navigation, screen reader support, responsive behavior, and edge cases are handled in the component library rather than reimplemented (with varying quality) across features.
Shared vocabulary
Design systems give teams a common language. When a designer says "use a Card with a flat variant," the developer knows exactly what component and props to use. This reduces back-and-forth between design and engineering.
Anatomy of a Modern Design System
Design Tokens
Design tokens are the atomic values that define your visual language. They're the single source of truth for colors, spacing, typography, shadows, borders, and motion.
In modern systems, tokens are typically expressed as CSS custom properties:
@theme {
--color-accent: var(--accent);
--color-background: var(--background);
--color-foreground: var(--foreground);
--radius-md: calc(var(--radius) * 0.75);
--shadow-surface: var(--surface-shadow);
}Tailwind CSS v4 uses a CSS-first token system with @theme, which HeroUI builds on. HeroUI's shipped theme maps real CSS variables such as --accent, --background, --foreground, --radius, and --surface-shadow into Tailwind utilities.
Why tokens matter:
- Theming. Change your brand color in one place and it updates everywhere — components, backgrounds, borders, hover states.
- Dark mode. Define a separate token set for dark mode; components adapt automatically.
- Multi-brand. Run the same components with different token sets for different brands.
- Consistency. No more guessing whether the correct gray is
#f3f4f6or#f4f5f7.
Component Architecture
Modern component libraries use two main patterns:
Compound Components
Compound components expose sub-components that compose together:
<Card>
<Card.Header>
<h3>Title</h3>
</Card.Header>
<Card.Content>
<p>Content goes here</p>
</Card.Content>
<Card.Footer>
<Button>Action</Button>
</Card.Footer>
</Card>HeroUI uses this pattern. Each sub-component is independently styleable, and you can omit parts you don't need. The parent component manages shared state (like selection in a RadioGroup) while children control their own rendering.
Monolithic Components
Monolithic components accept all configuration through props:
<Card
title="Title"
description="Content goes here"
footer={<Button>Action</Button>}
/>This is simpler for basic use cases but becomes rigid when you need custom layouts, conditional rendering, or non-standard markup.
Which is better? Compound components scale better for design systems because they give consuming teams more control without requiring library changes. When a team needs to add an icon between the title and description, they just add it — no new prop needed.
Accessibility Layer
The best design systems build accessibility into the foundation layer, not the component layer. This means using a primitive library like React Aria or Radix UI that handles:
- ARIA attributes and roles
- Keyboard navigation patterns
- Focus management (trapping, restoration, virtual focus)
- Screen reader announcements
- Touch and pointer interactions
- Right-to-left layout support
HeroUI builds on React Aria, one of the most comprehensive accessibility primitive libraries available for React. This means HeroUI components — from Button to Calendar to ComboBox — inherit battle-tested accessibility behavior.
Building a Design System with React
Option 1: Adopt a Component Library
The fastest path to a design system is adopting an existing component library and extending it. This gives you:
- Pre-built components with accessibility handled
- A token system you can customize
- Documentation and examples
- Community support and ongoing maintenance
Best for: Teams that want to move fast and don't have unique design requirements that existing libraries can't accommodate.
Recommended libraries:
| Library | Styling | Best For |
|---|---|---|
| HeroUI | Tailwind CSS v4 | Modern stack, accessibility, AI tooling |
| shadcn/ui | Tailwind CSS | Maximum code ownership |
| MUI | Emotion / sx prop, with Pigment CSS experimental |
Material Design, enterprise |
| Mantine | CSS Modules | Maximum component breadth |
Option 2: Build on Primitives
If you need a fully custom design language, build your components on top of accessibility primitives:
- React Aria — Most comprehensive accessibility primitives. Used by HeroUI.
- Radix UI — Excellent accessibility, popular composition patterns. Used by shadcn/ui.
- Ark UI — State machine-based, works across React/Vue/Solid.
Best for: Teams with dedicated design system engineers and unique design requirements.
Option 3: Extend and Customize
Many teams start by adopting a library (option 1) and gradually extend it. HeroUI supports this through:
- CSS-based component classes for predictable customization
- CSS custom properties for token overrides
- Compound component pattern for structural customization
- Theme system for global visual changes
This hybrid approach gives you the speed of a pre-built library with the flexibility to diverge where your product needs it.
Design Tokens in Practice
Setting Up Tokens with Tailwind CSS v4
Tailwind v4 lets you define design tokens directly in CSS:
@import "tailwindcss";
@import "@heroui/styles";
:root {
--accent: oklch(0.6204 0.195 253.83);
--accent-foreground: var(--snow);
--radius: 0.5rem;
--surface-shadow:
0 2px 4px 0 rgba(0, 0, 0, 0.04), 0 1px 2px 0 rgba(0, 0, 0, 0.06),
0 0 1px 0 rgba(0, 0, 0, 0.06);
}These tokens become Tailwind utilities automatically:
<div className="rounded-md bg-accent shadow-surface">
<p className="text-accent-foreground">Styled with HeroUI tokens</p>
</div>Token Organization
Organize tokens in layers:
- Primitive tokens — Raw values that do not change between themes (
--snow,--eclipse) - Semantic tokens — Theme-aware values (
--background,--foreground,--accent,--surface) - Computed Tailwind tokens — Utility-facing values generated in
@theme(--color-accent,--color-background,--radius-md)
HeroUI uses this layered approach. You can override at any level — change the primary color globally, adjust the card radius specifically, or create an entirely new theme.
Common Pitfalls
Over-engineering early
Don't build a design system before you need one. If you're a team of three building an MVP, adopting a component library is enough. The system should emerge from patterns you discover, not be designed upfront.
Treating it as a one-time project
A design system is a product, not a project. It needs ongoing investment — new components, bug fixes, documentation updates, and user support. If you build it and walk away, it'll be outdated within months.
Ignoring the developer experience
If your design system is hard to use, developers will work around it. Prioritize:
- Clear, searchable documentation
- Copy-pasteable code examples
- Sensible defaults that work without configuration
- Escape hatches for edge cases
Forgetting accessibility
Bolting accessibility onto an existing component library is painful and often incomplete. Choose a foundation (React Aria, Radix UI) that handles accessibility from the start.
How HeroUI Fits In
HeroUI provides the component library and token system layers of a design system:
+ components built on React Aria with compound component APIs - Tailwind CSS v4 tokens for colors, spacing, radii, and typography
- Theme system with light/dark mode and custom themes
- AI tooling (MCP server, llms.txt, agent skills) for developer productivity
You still need to add your own patterns, documentation, and governance on top — but the engineering-heavy parts (accessible components, a token system, theme support) are handled.
Getting Started
- Audit your current UI. Identify inconsistencies — different button styles, inconsistent spacing, duplicate components. These are the problems a design system solves.
- Adopt a component library. Start with HeroUI or another library that matches your stack. Customize the tokens to match your brand.
- Document your patterns. As your team builds features, document the patterns that emerge — how you handle empty states, form validation, loading states, error messages.
- Establish governance. Decide how new components get proposed, reviewed, and shipped. Keep it lightweight at first.
- Iterate. A design system is never done. Measure adoption, collect feedback, and improve continuously.
Further Reading
- HeroUI Quick Start Guide — Get started with HeroUI's component library
- HeroUI Theming Guide — Customize design tokens and themes
- React Component Libraries Compared — Compare your options
- Component Documentation — Explore HeroUI's component library
Apps Docs Content Blog En Why Choose Heroui For Your Design System (`apps/docs/content/blog/en/why-choose-heroui-for-your-design-system.mdx`)
title: "Why Choose HeroUI for Your Design System" date: "2026-05-17" author: "Junior Garcia" authorHandle: "@jrgarciadev" authorUrl: "https://x.com/jrgarciadev" authorAvatar: "https://avatars.githubusercontent.com/u/30373425?v=4" tags: ["heroui", "design-system", "react", "ui-libraries"] image: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/heroui-og_2x.jpg" darkImage: "https://heroui-assets.nyc3.cdn.digitaloceanspaces.com/docs/heroui-og-black_2x.jpg"
Most React component libraries solve the same problem: stop rebuilding buttons. But design systems fail at a different stage — when the library you chose can't flex to your product's needs, when accessibility is an afterthought bolted on after launch, or when your AI coding assistant hallucinates props that don't exist.
HeroUI combines React Aria for accessibility, Tailwind CSS v4 for styling, and a compound component API that gives you structural control without prop sprawl. This post explains the concrete reasons to choose it as the foundation of your design system.
The Stack
| Layer | Technology | Why |
|---|---|---|
| Accessibility | React Aria (Adobe) | Industry-leading WCAG primitives, actively maintained |
| Styling | Tailwind CSS v4 | Static CSS, zero runtime, design tokens via @theme |
| Component API | Compound components | Card.Header, Modal.Body — structural control without prop sprawl |
| Types | TypeScript | Full type coverage, generic props, strict mode compatible |
| AI tooling | MCP server, llms.txt, agent skills | AI assistants get current APIs, not stale training data |
| Cross-platform | HeroUI Native (React Native) | Same design system on web and mobile — no other open library does this |
Accessibility That's Actually Enterprise-Grade
Every HeroUI component is built on React Aria, Adobe's accessibility primitive library. This isn't a marketing checkbox — React Aria is the deepest accessibility foundation available for React, and it powers Adobe's own production design system (Spectrum) across Photoshop Web, Acrobat, and Lightroom.
What React Aria handles that most libraries don't:
- Platform-aware keyboard navigation. Mac, Windows, and Linux have different conventions for Home/End, option/alt+arrow, and focus behavior. React Aria adapts automatically.
- Screen reader announcements. Live regions, status messages, and dynamic content announcements work correctly across JAWS, NVDA, and VoiceOver.
- Touch interactions. Long press, drag and drop, and gesture handling on mobile — not just click events.
- Internationalization. Right-to-left layouts, locale-aware date/number formatting, and string collation for 30+ languages.
- Virtual focus. For collections with thousands of items, React Aria maintains performance while keeping screen readers informed.
This matters because accessibility compliance isn't optional in 2026. Government, healthcare, finance, and education all require WCAG conformance. HeroUI gives you that conformance as a default, not an upgrade.
React Aria vs Radix UI
Many popular libraries (shadcn/ui, Park UI) are built on Radix UI. Radix is solid, but the original team has shifted focus to Base UI, and the long-term maintenance of Radix primitives is an open question. React Aria is actively maintained by Adobe — a company that depends on it for their own products.
Tailwind CSS v4 Native
HeroUI doesn't use Tailwind as a compatibility layer — it's built for Tailwind CSS v4 from the ground up.
What this means in practice:
- Zero runtime CSS overhead. All styles are static CSS, resolved at build time. No CSS-in-JS computation, no style injection, no hydration cost.
- Design tokens via CSS custom properties. Your theme lives in standard CSS
@themedirectives, not JavaScript configuration objects. Change a token and every component updates. - Utility-first customization. Override any component with
className— the same Tailwind workflow you use for everything else in your project. - Smaller output. Tailwind v4's new engine produces less CSS. Combined with HeroUI's modular imports, your production bundle stays lean.
<Button variant="secondary" className="font-semibold tracking-wide">
Get Started
</Button>
<Card className="max-w-md shadow-lg">
<Card.Header className="pb-0">
<Card.Title className="text-xl font-bold">Dashboard</Card.Title>
</Card.Header>
<Card.Content className="py-4">
Your metrics here
</Card.Content>
</Card>If your team already uses Tailwind, HeroUI integrates without introducing a second styling system. If you don't use Tailwind yet, adopting it is a separate decision — but one that most React teams in 2026 have already made.
Compound Component API
HeroUI uses compound components — a pattern where parent components expose sub-components through dot notation. This is the same approach used by Radix UI, and it scales far better than prop-based APIs for complex UIs.
<Modal>
<Button>Open</Button>
<Modal.Backdrop>
<Modal.Container>
<Modal.Dialog>
<Modal.Header>
<Modal.Heading>Confirm</Modal.Heading>
</Modal.Header>
<Modal.Body>Are you sure?</Modal.Body>
<Modal.Footer>
<Button variant="ghost">Cancel</Button>
<Button>Confirm</Button>
</Modal.Footer>
</Modal.Dialog>
</Modal.Container>
</Modal.Backdrop>
</Modal>Why this matters for design systems:
- Structural control. Reorder, omit, or insert custom elements between component parts. No fighting the library's internal layout.
- Slot-level styling. Apply
classNameto any sub-component independently. StyleCard.Headerdifferently fromCard.Footerwithout CSS overrides. - TypeScript verification. The compiler checks your component tree structure — wrong nesting gets caught at build time, not in production.
- Readable JSX. The hierarchy of your component maps directly to the visual hierarchy of your UI. New team members can read the code and understand the layout.
+ Components
HeroUI ships
- Data input — Input, Textarea, NumberField, Select, ComboBox, Autocomplete, DatePicker, DateRangePicker, ColorPicker, Slider, Switch, Checkbox, Radio
- Data display — Table (sorting, selection, pagination), Avatar, Badge, Chip, Tag, Skeleton
- Layout — Card, Surface, Separator, Fieldset
- Navigation — Tabs, Breadcrumbs, Pagination, Link
- Feedback — Toast, ProgressBar, ProgressCircle, Meter, Spinner
- Overlay — Modal, Drawer, Popover, Tooltip, Dropdown, AlertDialog
- Disclosure — Accordion, Disclosure
- Actions — Button, ToggleButton, ToggleButtonGroup
Complex components like Calendar, DatePicker, ColorPicker, and Table are self-contained — they handle date math, locale formatting, keyboard navigation, and screen reader announcements internally. These are genuinely hard to build accessibly, and HeroUI ships them as maintained, tested primitives.
AI-Native Tooling
Most developers use AI coding assistants daily. The quality of generated code depends on whether the AI has accurate context for your component library — or is guessing from stale training data.
HeroUI ships four first-party integrations:
MCP Server
A Model Context Protocol server that AI agents can query for component documentation, APIs, source code, and design tokens. Connect it to Cursor, Claude Code, Windsurf, or any MCP-compatible editor.
When an AI assistant has access to the MCP server, it can look up the exact compound component structure, available props, and correct imports for any HeroUI component — instead of hallucinating.
Learn how to set up the MCP Server →
llms.txt
A structured reference file at heroui.com/llms.txt that gives LLMs a condensed, accurate reference for the entire library. This is a standardized format that AI tools consume to avoid generating deprecated patterns.
Agent Skills
Pre-built skill files for Cursor, Claude Code, and other AI tools that teach agents HeroUI's conventions — correct imports, compound component patterns, styling approaches, and project scaffolding.
Learn how to install Agent Skills →
AGENTS.md
An AGENTS.md file that provides repository-level context for AI coding agents. It describes the project structure, coding conventions, and component patterns so agents understand your codebase from the first prompt.
Once AI coding assistants become part of a production workflow, it is also worth evaluating dedicated inference capacity. Providers like Morph offer reserved capacity for teams running high volume code generation, search, and apply workloads, so agent features can stay fast and reliable as usage grows.
The result: AI assistants generate correct HeroUI v3 code with the right compound component patterns, import paths, and Tailwind classes. This matters because incorrect AI output costs more time to debug than it saves to generate.
The Ecosystem
HeroUI Pro
HeroUI Pro extends the base library with app-level components and templates:
- AppLayout, Sidebar, Navbar — Full application shell with responsive behavior
- DataGrid — Dense data tables with typed columns, sorting, and filtering
- KPI, NumberValue, TrendChip — Dashboard metric components
- LineChart, BarChart — Data visualization
- Sheet, CommandMenu — Advanced overlay patterns
- Templates — Dashboard, finance, chat, and email app starting points
Pro is a paid product — use it when you need app infrastructure, not just UI components.
HeroUI Native
HeroUI is the only open design system that delivers the same component quality across both web and mobile. HeroUI Native brings the same design tokens, compound component API, and accessibility standards to React Native — leveraging each platform's native APIs instead of wrapping web views.
This means teams building cross-platform products can share a single design system across React (web) and React Native (mobile) without compromising on either platform. Same visual language, same component patterns, same theming tokens — but native rendering on each side.
No other open-source React component library offers this. MUI, shadcn/ui, Chakra UI, and Mantine are web-only. If your product ships on both web and mobile, HeroUI is the only design system that covers both from the same foundation.
Figma Kit
The HeroUI Figma Kit (v3) keeps design and code in sync. Components in Figma match the React implementation, so designers and developers work from the same source of truth.
Storybook
Every component has Storybook stories showing all variants, states, and compositions. Use it for visual testing, design review, and documentation.
Community
HeroUI isn't new — we've been building it for over 5 years, starting from v1 (originally NextUI). The community has grown steadily: 29.3K+ GitHub stars, 9K+ Discord members, and thousands of discussions, community answers, and issues resolved every week.
- GitHub — Source code, issues, and discussions
- Discord — 9K+ members, community support and announcements
- X / Twitter — Updates and releases
Backed by Y Combinator
HeroUI is venture-backed, including Y Combinator. This means a dedicated full-time team, long-term maintenance commitments, and the resources to keep shipping. When you adopt a component library, you're betting on its future — HeroUI is built to be around for the long run.
Design Quality Out of the Box
HeroUI ships with refined defaults that look polished without custom theming:
- Smooth animations. Buttons have subtle press states. Modals animate with spring physics. Accordions expand with natural easing.
- Balanced spacing tokens. Consistent padding, margins, and gaps across all components follow a mathematical scale.
- Shadow hierarchy. Elevation levels that work in both light and dark mode without manual adjustment.
- Theme variants. Built-in support for visual identities like glass, brutalism, and neutral — switchable through design tokens.
The design token system uses CSS custom properties, so theming is standard CSS:
@theme {
--color-primary: oklch(0.6 0.25 260);
--radius-field: 0.5rem;
--shadow-surface: 0 1px 3px rgba(0, 0, 0, 0.08);
}Change tokens globally and every component updates. No JavaScript theme objects, no provider wrappers, no runtime overhead.
Want to make HeroUI yours in a few clicks? The Theme Builder lets you customize colors, typography, radius, and spacing visually — then export a ready-to-use CSS theme for your project.
Ready in Two Steps
Most component libraries require configuration files, provider wrappers, theme objects, and plugin setup before you can render your first component. HeroUI doesn't. The entire setup is two steps:
1. Install:
npm i @heroui/styles @heroui/react2. Add one line to your CSS:
@import "tailwindcss";
@import "@heroui/styles"; /* That's it */Now use any component — no ThemeProvider, no ChakraProvider, no MantineProvider, no configuration objects:
import { Button, Card } from "@heroui/react";
export default function Page() {
return (
<Card>
<Card.Content>
<Button>Click me</Button>
</Card.Content>
</Card>
);
}That's the entire setup. No wrapping your app in providers, no theme configuration files, no runtime setup. Install, import one CSS line, and start building. See the Quick Start guide to get running in under five minutes.
Server Components
HeroUI is designed for the React Server Components model:
- Static components (
Card,Badge,Text,Separator,Avatar) stay in server component trees with zero client JavaScript. - Interactive components (
Button,Modal,Table,Select) use client boundaries — clearly documented per component. - No provider required — no client-side context that forces your entire tree into a client boundary.
This means your pages ship less JavaScript by default. Static layouts render on the server. Interactive widgets hydrate only where needed.
Considerations
HeroUI takes a focused approach: instead of shipping every possible component, we prioritize depth, accessibility, and quality for the components teams use most. For specialized needs like rich text editing, drag-and-drop, or charting, we recommend pairing HeroUI with dedicated libraries that excel at those specific problems — this gives you better results than relying on a single library to handle everything.
HeroUI is built for Tailwind CSS v4. If your team is already using Tailwind, adoption is seamless. If you're on a different styling approach, the switch to Tailwind is a separate but worthwhile investment in modern CSS tooling.
Who Should Use HeroUI
HeroUI is a strong fit if you're building:
- SaaS applications — Forms, tables, overlays, and navigation with React Aria accessibility
- Dashboards and admin panels — Data-dense layouts with HeroUI Pro components
- E-commerce storefronts — Performant, accessible, SEO-friendly component rendering
- Marketing sites and landing pages — Polished defaults without runtime CSS overhead
- Cross-platform products — Same design system on web (React) and mobile (React Native) with HeroUI Native
- Any React / Next.js project that values accessibility, Tailwind CSS integration, and AI-assisted development
Get Started
npm install @heroui/styles @heroui/react- Quick Start Guide — Set up in under five minutes
- Component Documentation — Full API reference with live examples
- Theming Guide — Customize the design system
- MCP Server — Connect your AI coding assistant
- GitHub Repository — Source code and issues
Apps Docs Src Lib Dictionaries Cn.Json (`apps/docs/src/lib/dictionaries/cn.json`)
{
"home": {
"releaseBadges": [
{
"label": "HeroUI React v3.2.6 — React Aria 1.21.1",
"href": "/docs/react/releases/v3-2-6",
"date": "2026-09-17"
},
{
"label": "HeroUI Native v1.0.11 — Expo SDK 58 与 CSS 层叠层",
"href": "/docs/native/releases/v1-0-11",
"date": "2026-10-20"
}
],
"titleMain": "开箱即用",
"titleMuted": "设计灵活可定制",
"description": "HeroUI 是面向网页与移动端的现代 UI 库,助你快速迭代、保持一致,并打造令人愉悦的用户体验。",
"metaTitle": "HeroUI v3(前身为 NextUI)- 开箱即用,设计灵活可定制。",
"metaDescription": "基于 React Aria 和 Tailwind CSS v4 构建的精美、无障碍 React UI 组件。用于构建生产级应用的现代化 MUI、Chakra UI 和 shadcn/ui 替代方案。",
"getStarted": "快速开始",
"viewComponents": "查看组件",
"githubStarsPrefix": "开源项目,已有",
"githubStarsSuffix": "颗星",
"demo": {
"proTemplate": "Pro 模板可用",
"themeBuilder": "在主题编辑器中打开"
}
},
"nav": {
"documentation": "文档",
"resources": "资源",
"gettingStarted": "快速开始",
"themes": "主题",
"components": "组件",
"reactNative": "React Native",
"reactNativeShort": "Native",
"releases": "版本发布",
"blog": "博客",
"docs": "文档",
"roadmap": "路线图"
},
"notFound": {
"imageAlt": "404 未找到",
"title": "404",
"description": "抱歉,找不到您要访问的页面。",
"returnHome": "返回首页"
},
"blog": {
"heading": "博客",
"metaTitle": "博客 | HeroUI",
"metaDescription": "面向现代 React 应用的指南、教程与资源。包含对比、最佳实践等内容。",
"categoriesAriaLabel": "博客分类",
"categories": {
"all": "全部",
"tutorial": "教程",
"comparison": "对比",
"native": "Native",
"uiLibraries": "资源"
},
"latestPosts": "最新文章",
"emptyState": "该分类下暂无文章。",
"backToBlog": "返回博客",
"relatedPosts": "相关文章"
},
"showcase": {
"heading": "相关案例",
"description": "探索展示 HeroUI 组件在真实场景中应用的互动示例。"
},
"footer": {
"about": "关于",
"allRightsReserved": "保留所有权利。",
"contact": "联系",
"privacy": "隐私"
},
"newsletter": {
"label": "Hero 新闻通讯",
"placeholder": "[email protected]",
"subscribe": "订阅",
"emailRequired": "请输入邮箱地址",
"emailInvalid": "请输入有效的邮箱地址。",
"apiError": "订阅失败,请稍后再试",
"genericError": "出现错误,请稍后再试。"
},
"statusChip": {
"new": "新",
"preview": "预览",
"updated": "更新"
},
"frameworksTabs": {
"ariaLabel": "文档框架",
"web": "网页",
"native": "移动端"
},
"searchDialog": {
"placeholder": "你想搜索什么?",
"jumpTo": "跳转到"
},
"componentLinks": {
"source": "源代码",
"stylesSource": "样式源代码",
"themeSource": "主题源代码"
},
"copyPrompt": {
"copy": "复制提示词",
"copied": "已复制",
"ariaLabelCopy": "复制提示词到剪贴板",
"ariaLabelCopied": "提示词已复制到剪贴板"
},
"qrPreviewPopover": {
"tapToPreview": "点击预览",
"scanToPreview": "扫码预览",
"downloadPrompt": "还没有安装 {name} 应用?请在下方下载。"
},
"storeButtons": {
"appStoreLabel": "在 App Store 下载 {name}",
"appStore": "在 App Store 下载",
"playStoreLabel": "在 Google Play 下载 {name}",
"playStore": "在 Play Store 下载",
"androidComingSoonLabel": "Android 版本即将推出",
"androidComingSoon": "Android · 即将推出"
},
"proBanner": {
"close": "关闭",
"default": {
"headerTitle": "HeroUI Pro 已上线",
"headerDetail": "组件、模板与 AI 工具",
"heroLabel": "现已推出",
"cardTitle": "使用 HeroUI Pro 更快构建",
"cardDescription": "面向 React 与 React Native 的组件、模板与 AI 工具,为注重细节的团队而打造。",
"cta": "探索 Pro"
},
"discount": {
"headerTitle": "上线优惠进行中!",
"headerCountdown": "{percent}% 优惠倒计时",
"headerCountdownCompact": "{percent}% 优惠倒计时",
"cardCountdown": "倒计时",
"cardTitle": "HeroUI Pro 上线优惠进行中!",
"cardDescription": "更多组件、图表、进阶 MCP 与 Skills,以及完整的主题构建器。限时折扣,立即获取你的授权。",
"cta": "立即享受优惠"
},
"units": {
"days": "天",
"hours": "时",
"minutes": "分",
"seconds": "秒"
}
},
"themes": {
"heading": "主题编辑器",
"metaTitle": "HeroUI 主题编辑器 – 自定义 React UI",
"metaDescription": "通过可视化控件自定义 HeroUI React 主题,调整颜色、字体与圆角,实时预览组件并复制可用于生产环境的 HeroUI CSS 变量。",
"theme": "主题",
"custom": "自定义",
"designTheme": "设计主题",
"editTheme": "编辑主题",
"vibrantPalette": "鲜艳调色板",
"vibrantPaletteDescription": "更饱和,对比更低",
"pickRandomHint": "按 {kbd} 随机选择"
},
"themeBuilder": {
"onboarding": {
"title": "为你的品牌定制 HeroUI v3",
"description": "使用令牌系统自定义颜色、圆角与字体,让每个组件保持一致并可直接投入生产。",
"moreComing": "更多功能与主题即将推出。",
"continue": "继续"
},
"header": {
"undo": "撤销上一步",
"redo": "重做上一步",
"share": "分享主题链接",
"viewCode": "查看代码",
"linkCopied": "链接已复制",
"linkCopiedDescription": "你的主题链接已复制到剪贴板。",
"switchMode": "切换模式"
},
"resetButton": {
"tooltip": "恢复默认",
"dialogTitle": "恢复为默认主题?",
"dialogBody": "这将把所有主题数值恢复为默认设置。",
"cancel": "取消",
"confirm": "确认"
},
"shuffleButton": {
"tooltip": "随机生成",
"dialogTitle": "确定要随机生成吗?",
"dialogBody": "这将覆盖你当前的主题设置。",
"cancel": "取消",
"confirm": "确认",
"dontShowAgain": "不再显示"
},
"fontFamily": {
"label": "字体",
"suggested": "推荐",
"allFonts": "全部字体",
"addFromCdn": "从 CDN 添加",
"removeFont": "移除字体"
},
"customFonts": {
"back": "返回",
"fontUrl": "字体 URL",
"placeholder": "粘贴字体 URL...",
"description": "支持 G Fonts、Fontsource 与 Fontshare",
"importing": "导入中...",
"importFont": "导入字体",
"errorHttps": "URL 必须使用 https 协议",
"errorSupportedCdn": "URL 必须来自受支持的 CDN(Google Fonts、Fontsource、Bunny Fonts 等)",
"errorInvalidUrl": "请输入有效的 URL",
"errorCannotDetect": "无法从 URL 中识别字体,请检查 URL 格式。",
"errorCannotDetectFull": "无法从 URL 中识别字体,请确保 URL 是有效的字体样式表。",
"errorAlreadyImported": "该字体已作为 "{name}" 导入"
},
"accentColor": {
"label": "强调色",
"tooltip": "用于品牌与高亮的主要颜色"
},
"baseColor": {
"label": "基础色",
"tooltip": "控制背景与表面等中性色中灰度的比例"
},
"radius": {
"label": "圆角",
"description": "影响整体 UI,例如菜单与弹窗",
"formLabel": "表单圆角",
"formDescription": "影响表单元素,例如输入框与选择器",
"options": {
"none": "无",
"extraSmall": "超小",
"small": "小",
"medium": "中",
"large": "大",
"extraLarge": "超大"
}
},
"lockableLabel": {
"lockValue": "锁定数值",
"unlockValue": "解锁数值"
},
"tabs": {
"components": "组件",
"dashboard": "仪表盘",
"mail": "邮件",
"chat": "聊天",
"finances": "财务",
"crm": "CRM"
}
},
"demos": {
"alert": {
"title": "您还剩 2 次额度",
"description": "升级到付费计划获取更多额度",
"action": "升级"
},
"alertDialog": {
"title": "未保存的更改",
"description": "您要保存还是放弃更改?",
"discard": "放弃",
"save": "保存更改"
},
"allowNotifications": {
"label": "允许通知",
"description": "接收来自 HeroUI 的推送通知"
},
"buttons": {
"clickMe": "点击我"
},
"inputOtp": {
"label": "验证账户",
"description": "我们已向 a****@gmail.com 发送验证码",
"didntReceive": "没有收到验证码?",
"resend": "重新发送"
},
"listBox": {
"ariaLabel": "文件操作",
"actions": "操作",
"newFile": "新建文件",
"newFileDescription": "创建一个新文件",
"editFile": "编辑文件",
"editFileDescription": "修改内容",
"dangerZone": "危险操作",
"deleteFile": "删除文件",
"deleteFileDescription": "移到回收站"
},
"login": {
"title": "创建账户",
"trialNote": "开始 7 天免费试用,无需信用卡。",
"getStarted": "立即开始",
"or": "或",
"continueWithGoogle": "使用 Google 继续",
"continueWithApple": "使用 Apple 继续"
},
"select": {
"placeholder": "请选择",
"label": "州",
"options": {
"florida": "佛罗里达",
"delaware": "特拉华",
"california": "加利福尼亚",
"texas": "得克萨斯",
"newYork": "纽约",
"washington": "华盛顿"
}
},
"slider": {
"label": "价格"
},
"subtleCards": {
"indieTitle": "Indie Hackers",
"indieMembers": "148 位成员",
"indieBy": "由 John 创建",
"aiTitle": "AI Builders",
"aiMembers": "362 位成员",
"aiBy": "由 Martha 创建"
},
"tabs1": {
"ariaLabel": "选项",
"all": "全部"
},
"tabs2": {
"ariaLabel": "选项",
"chats": "聊天",
"emails": "邮件"
},
"textfield": {
"label": "您的邮箱",
"placeholder": "[email protected]",
"description": "我们不会分享您的邮箱",
"error": "邮箱无效"
},
"uiComponents": {
"checkboxAriaLabel": "复选框指示器示例",
"switchAriaLabel": "开关启用状态示例",
"radioAriaLabel": "单选按钮示例"
},
"xProfile": {
"bio": "构建网页与移动端 UI 的未来。",
"bioSuffix": "(YC S24)",
"confettiLabel": "彩带",
"following": "正在关注",
"followers": "关注者"
}
},
"pageActions": {
"copyMarkdown": "复制 Markdown",
"copied": "已复制",
"moreOptions": "更多选项",
"askWithUrl": "请阅读 {url},我想就此进行提问。",
"askFallback": "我想就这份文档进行提问。",
"items": {
"markdown": {
"title": "查看 Markdown",
"description": "以 Markdown 格式查看页面"
},
"cursor": {
"title": "添加到 Cursor",
"description": "在 Cursor 中安装 MCP 服务器"
},
"vscode": {
"title": "添加到 VS Code",
"description": "在 VS Code 中安装 MCP 服务器"
},
"chatgpt": {
"title": "在 ChatGPT 中打开",
"description": "就此页面进行提问"
},
"claude": {
"title": "在 Claude 中打开",
"description": "就此页面进行提问"
}
}
}
}
Apps Docs Src Lib Dictionaries En.Json (`apps/docs/src/lib/dictionaries/en.json`)
{
"home": {
"releaseBadges": [
{
"label": "HeroUI React v3.2.6 — React Aria 1.21.1",
"href": "/docs/react/releases/v3-2-6",
"date": "2026-09-17"
},
{
"label": "HeroUI Native v1.0.11 — Expo SDK 58 & CSS layers",
"href": "/docs/native/releases/v1-0-11",
"date": "2026-10-20"
}
],
"titleMain": "Beautiful by default.",
"titleMuted": "Customizable by design.",
"description": "HeroUI is the modern UI library for web and mobile, built to help you move fast, stay consistent, and deliver delightful user experiences.",
"metaTitle": "HeroUI v3 (Previously NextUI) - Beautiful by default, customizable by design.",
"metaDescription": "Beautiful, accessible React UI components built on React Aria and Tailwind CSS v4. The modern alternative to MUI, Chakra UI, and shadcn/ui for building production-ready applications.",
"getStarted": "Get started",
"viewComponents": "View components",
"githubStarsPrefix": "Open source with",
"githubStarsSuffix": "stars",
"demo": {
"proTemplate": "Available in Pro as template",
"themeBuilder": "Open in theme builder"
}
},
"nav": {
"documentation": "Documentation",
"resources": "Resources",
"gettingStarted": "Getting Started",
"themes": "Themes",
"components": "Components",
"reactNative": "React Native",
"reactNativeShort": "Native",
"releases": "Releases",
"blog": "Blog",
"docs": "Docs",
"roadmap": "Roadmap"
},
"notFound": {
"imageAlt": "404 Not Found",
"title": "404",
"description": "Sorry, the page you're looking for could not be found.",
"returnHome": "Return Home"
},
"blog": {
"heading": "Blog",
"metaTitle": "Blog | HeroUI",
"metaDescription": "Guides, tutorials, and resources for building modern React applications with HeroUI. Comparisons, best practices, and more.",
"categoriesAriaLabel": "Blog categories",
"categories": {
"all": "All",
"tutorial": "Guides",
"comparison": "Comparisons",
"native": "Native",
"uiLibraries": "Resources"
},
"latestPosts": "Latest Posts",
"emptyState": "No posts found for this category.",
"backToBlog": "Back to Blog",
"relatedPosts": "Related Posts"
},
"showcase": {
"heading": "Showcase",
"description": "Explore interactive examples showcasing HeroUI components in real-world scenarios."
},
"footer": {
"about": "About",
"allRightsReserved": "All rights reserved.",
"contact": "Contact",
"privacy": "Privacy"
},
"newsletter": {
"label": "Hero Newsletter",
"placeholder": "[email protected]",
"subscribe": "Subscribe",
"emailRequired": "Email is required",
"emailInvalid": "Please enter a valid email.",
"apiError": "Failed to subscribe newsletter",
"genericError": "Something went wrong. Please try again."
},
"statusChip": {
"new": "New",
"preview": "Preview",
"updated": "Updated"
},
"frameworksTabs": {
"ariaLabel": "Documentation framework",
"web": "Web",
"native": "Native"
},
"searchDialog": {
"placeholder": "What are you searching for?",
"jumpTo": "Jump to"
},
"componentLinks": {
"source": "Source",
"stylesSource": "Styles source",
"themeSource": "Theme source"
},
"copyPrompt": {
"copy": "Copy Prompt",
"copied": "Copied",
"ariaLabelCopy": "Copy prompt to clipboard",
"ariaLabelCopied": "Prompt copied to clipboard"
},
"qrPreviewPopover": {
"tapToPreview": "Tap to preview",
"scanToPreview": "Scan to preview",
"downloadPrompt": "Don't have the {name} app yet? Download it below."
},
"storeButtons": {
"appStoreLabel": "Download {name} on the App Store",
"appStore": "Download on App Store",
"playStoreLabel": "Download {name} on Google Play",
"playStore": "Download on Play Store",
"androidComingSoonLabel": "Android version coming soon",
"androidComingSoon": "Android · Coming soon"
},
"proBanner": {
"close": "Close",
"default": {
"headerTitle": "HeroUI Pro is live",
"headerDetail": "Components, templates & AI tooling",
"heroLabel": "Now available",
"cardTitle": "Build faster with HeroUI Pro",
"cardDescription": "Components, templates, and AI tooling for React and React Native. Made for teams that care about the details.",
"cta": "Explore Pro"
},
"discount": {
"headerTitle": "Launch discount is live!",
"headerCountdown": "{percent}% off ends in",
"headerCountdownCompact": "{percent}% off in",
"cardCountdown": "Ends in",
"cardTitle": "HeroUI Pro launch discount is live!",
"cardDescription": "More components, charts, advanced MCP & Skills, and a complete theme builder. Get your license now at a discounted price for a limited time.",
"cta": "Get Pro deal"
},
"units": {
"days": "d",
"hours": "h",
"minutes": "m",
"seconds": "s"
}
},
"themes": {
"heading": "Theme Builder",
"metaTitle": "HeroUI Theme Builder – Customize React UI",
"metaDescription": "Customize HeroUI React themes visually. Tune colors, typography, and radius, preview components live, and copy production-ready HeroUI CSS variables.",
"theme": "Theme",
"custom": "Custom",
"designTheme": "Design theme",
"editTheme": "Edit theme",
"vibrantPalette": "Vibrant palette",
"vibrantPaletteDescription": "More saturated, less contrast",
"pickRandomHint": "Press {kbd} to pick random"
},
"themeBuilder": {
"onboarding": {
"title": "Adapt HeroUI v3 to your brand",
"description": "Customize colors, radius, and typography using a token system that keeps every component consistent and production-ready.",
"moreComing": "More features and themes coming soon.",
"continue": "Continue"
},
"header": {
"undo": "Undo last change",
"redo": "Redo last change",
"share": "Share theme link",
"viewCode": "View code",
"linkCopied": "Link copied",
"linkCopiedDescription": "Your theme link is copied to the clipboard.",
"switchMode": "Switch mode"
},
"resetButton": {
"tooltip": "Reset to defaults",
"dialogTitle": "Reset theme to default?",
"dialogBody": "This will restore all theme values to their default settings.",
"cancel": "Cancel",
"confirm": "Confirm"
},
"shuffleButton": {
"tooltip": "Randomize",
"dialogTitle": "Are you sure you want to randomize?",
"dialogBody": "This will overwrite your current theme settings.",
"cancel": "Cancel",
"confirm": "Confirm",
"dontShowAgain": "Don't show again"
},
"fontFamily": {
"label": "Font Family",
"suggested": "Suggested",
"allFonts": "All Fonts",
"addFromCdn": "Add from CDN",
"removeFont": "Remove font"
},
"customFonts": {
"back": "Back",
"fontUrl": "Font URL",
"placeholder": "Paste font URL...",
"description": "Supports G Fonts, Fontsource and Fontshare",
"importing": "Importing...",
"importFont": "Import font",
"errorHttps": "URL must use https protocol",
"errorSupportedCdn": "URL must be from a supported CDN (Google Fonts, Fontsource, Bunny Fonts, etc.)",
"errorInvalidUrl": "Please enter a valid URL",
"errorCannotDetect": "Could not detect font family from URL. Please check the URL format.",
"errorCannotDetectFull": "Could not detect font family from URL. Please ensure the URL is a valid font stylesheet.",
"errorAlreadyImported": "This font is already imported as "{name}""
},
"accentColor": {
"label": "Accent",
"tooltip": "Main color used for branding and highlights"
},
"baseColor": {
"label": "Base",
"tooltip": "Controls how much gray is used in neutrals like backgrounds and surfaces"
},
"radius": {
"label": "Radius",
"description": "Affects the overall UI, like menus and modals",
"formLabel": "Radius Form",
"formDescription": "Affects form elements, like inputs and selects",
"options": {
"none": "none",
"extraSmall": "extra small",
"small": "small",
"medium": "medium",
"large": "large",
"extraLarge": "extra large"
}
},
"lockableLabel": {
"lockValue": "Lock value",
"unlockValue": "Unlock value"
},
"tabs": {
"components": "Components",
"dashboard": "Dashboard",
"mail": "Mail",
"chat": "Chat",
"finances": "Finances",
"crm": "CRM"
}
},
"demos": {
"alert": {
"title": "You have 2 credits left",
"description": "Get a paid plan for more credits",
"action": "Upgrade"
},
"alertDialog": {
"title": "Unsaved changes",
"description": "Do you want to save or discard changes?",
"discard": "Discard",
"save": "Save changes"
},
"allowNotifications": {
"label": "Allow notifications",
"description": "Receive push notifications from HeroUI"
},
"buttons": {
"clickMe": "Click me"
},
"inputOtp": {
"label": "Verify account",
"description": "We've sent a code to a****@gmail.com",
"didntReceive": "Didn't receive a code?",
"resend": "Resend"
},
"listBox": {
"ariaLabel": "File actions",
"actions": "Actions",
"newFile": "New file",
"newFileDescription": "Create a new file",
"editFile": "Edit file",
"editFileDescription": "Make changes",
"dangerZone": "Danger zone",
"deleteFile": "Delete file",
"deleteFileDescription": "Move to trash"
},
"login": {
"title": "Create an account",
"trialNote": "Start your free 7-day trial. No credit card required.",
"getStarted": "Get Started",
"or": "Or",
"continueWithGoogle": "Continue with Google",
"continueWithApple": "Continue with Apple"
},
"select": {
"placeholder": "Select one",
"label": "State",
"options": {
"florida": "Florida",
"delaware": "Delaware",
"california": "California",
"texas": "Texas",
"newYork": "New York",
"washington": "Washington"
}
},
"slider": {
"label": "Price"
},
"subtleCards": {
"indieTitle": "Indie Hackers",
"indieMembers": "148 members",
"indieBy": "By John",
"aiTitle": "AI Builders",
"aiMembers": "362 members",
"aiBy": "By Martha"
},
"tabs1": {
"ariaLabel": "Options",
"all": "All"
},
"tabs2": {
"ariaLabel": "Options",
"chats": "Chats",
"emails": "Emails"
},
"textfield": {
"label": "Your email",
"placeholder": "[email protected]",
"description": "We won't share your email",
"error": "The email is invalid"
},
"uiComponents": {
"checkboxAriaLabel": "Checkbox Indicator Example",
"switchAriaLabel": "Switch On State Example",
"radioAriaLabel": "Radio Buttons Example"
},
"xProfile": {
"bio": "Building the future of UI for web & mobile.",
"bioSuffix": "(YC S24)",
"confettiLabel": "confetti",
"following": "Following",
"followers": "Followers"
}
},
"pageActions": {
"copyMarkdown": "Copy Markdown",
"copied": "Copied",
"moreOptions": "More options",
"askWithUrl": "Read {url}, I want to ask questions about it.",
"askFallback": "I want to ask questions about this documentation.",
"items": {
"markdown": {
"title": "View as Markdown",
"description": "View page as Markdown format"
},
"cursor": {
"title": "Add to Cursor",
"description": "Install MCP Server on Cursor"
},
"vscode": {
"title": "Add to VS Code",
"description": "Install MCP Server on VS Code"
},
"chatgpt": {
"title": "Open in ChatGPT",
"description": "Ask questions about this page"
},
"claude": {
"title": "Open in Claude",
"description": "Ask questions about this page"
}
}
}
}
Apps Docs Content Docs Cn Native Meta.Json (`apps/docs/content/docs/cn/native/meta.json`)
{
"title": "文档",
"description": "HeroUI Native 文档",
"pages": ["getting-started", "components", "releases"]
}
Apps Docs Content Docs Cn React Meta.Json (`apps/docs/content/docs/cn/react/meta.json`)
{
"title": "文档",
"description": "HeroUI v3 文档",
"pages": ["getting-started", "components", "releases", "migration"]
}
Apps Docs Content Docs En Native Meta.Json (`apps/docs/content/docs/en/native/meta.json`)
{
"title": "Documentation",
"description": "HeroUI Native Documentation",
"pages": ["getting-started", "components", "releases"]
}
Apps Docs Content Docs En React Meta.Json (`apps/docs/content/docs/en/react/meta.json`)
{
"title": "Documentation",
"description": "HeroUI v3 Documentation",
"pages": ["getting-started", "components", "releases", "migration"]
}
Apps Docs Content Docs Cn Native Components Meta.Json (`apps/docs/content/docs/cn/native/components/meta.json`)
{
"title": "组件",
"description": "HeroUI Native 组件",
"root": true,
"icon": "circles-4-diamond",
"pages": [
"index",
"---组件---",
"(navigation)/accordion",
"(feedback)/alert",
"(media)/avatar",
"(overlays)/bottom-sheet",
"(buttons)/button",
"(layout)/card",
"(forms)/checkbox",
"(data-display)/chip",
"(buttons)/close-button",
"(forms)/control-field",
"(forms)/description",
"(overlays)/dialog",
"(forms)/field-error",
"(forms)/input",
"(forms)/input-group",
"(forms)/input-otp",
"(forms)/label",
"(buttons)/link-button",
"(navigation)/list-group",
"(collections)/menu",
"(overlays)/popover",
"(utilities)/pressable-feedback",
"(forms)/radio-group",
"(utilities)/scroll-shadow",
"(controls)/slider",
"(forms)/search-field",
"(forms)/select",
"(layout)/separator",
"(feedback)/skeleton",
"(feedback)/skeleton-group",
"(feedback)/spinner",
"(layout)/surface",
"(controls)/switch",
"(navigation)/tabs",
"(collections)/tag-group",
"(typography)/text",
"(forms)/text-area",
"(forms)/text-field",
"(overlays)/toast"
]
}
Apps Docs Content Docs Cn Native Getting Started Meta.Json (`apps/docs/content/docs/cn/native/getting-started/meta.json`)
{
"title": "快速开始",
"description": "快速开始使用 HeroUI Native",
"root": true,
"icon": "book-open",
"pages": [
"---概述---",
"index",
"(overview)/quick-start",
"(overview)/design-principles",
"[route]路线图",
"---手册---",
"(handbook)/provider",
"(handbook)/portal",
"(handbook)/colors",
"(handbook)/theming",
"(handbook)/styling",
"(handbook)/animation",
"(handbook)/composition",
"---代理用户界面---",
"(ui-for-agents)/llms-txt",
"(ui-for-agents)/mcp-server",
"(ui-for-agents)/agent-skills",
"(ui-for-agents)/agents-md"
]
}
Apps Docs Content Docs Cn Native Releases Beta 10 (`apps/docs/content/docs/cn/native/releases/beta-10.mdx`)
title: Beta 10 github: pull: 6068
2025 年 12 月 30 日
本版本新增 Bottom Sheet 组件;重构 PressableFeedback 并改进 API;为动画 API 增加 State Prop 支持;增强 use-theme-color 以支持一次选取多色;并包含若干问题修复与文档改进。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
bash npm i heroui-native@beta
bash pnpm add heroui-native@beta
bash yarn add heroui-native@beta
bash bun add heroui-native@beta
更新亮点
新组件
Bottom Sheet
本版本新增 Bottom Sheet 组件:自屏幕底部滑入的通用遮罩层,带动画过渡与下滑关闭手势。
特性:
- 平滑动画过渡与手势支持
- 多档吸附高度,布局更灵活
- Detached 模式,支持自定义定位
- 可自定义遮罩与模糊效果
- 完整无障碍支持
- 基于 @gorhom/bottom-sheet
用法:
import { BottomSheet, Button } from 'heroui-native';
<BottomSheet>
<BottomSheet.Trigger asChild>
<Button>Open Bottom Sheet</Button>
</BottomSheet.Trigger>
<BottomSheet.Portal>
<BottomSheet.Overlay />
<BottomSheet.Content>
<BottomSheet.Close />
<BottomSheet.Title>Title</BottomSheet.Title>
<BottomSheet.Description>Description</BottomSheet.Description>
</BottomSheet.Content>
</BottomSheet.Portal>
</BottomSheet>完整文档与示例见 Bottom Sheet 组件页。
相关 PR: #174
组件改进
PressableFeedback 重构
PressableFeedback 已重构,API 更清晰,动画控制更好。
改进:
- 动画配置 API 增强
- 更好支持自定义动画状态
- 性能与流畅度提升
- 反馈定位选项更灵活
在提供更多按压反馈动画控制能力的同时,保持向后兼容。
相关 PR: #182
API 增强
动画 API:State 属性扩展
动画 API 新增 state 属性,可在自定义属性的同时关闭动画,实现更细粒度的行为控制。
新能力:
<Component
animation={{
state: 'disabled', // 或 'disable-all' 或 boolean
// ... 其他动画属性
}}
/>state 可取:
'disabled':关闭动画,仍允许自定义属性'disable-all':关闭所有动画(含子级)boolean:简单开关
便于在不启用动画的情况下微调动画相关属性,利于精细调整组件行为。
相关 PR: #176
use-theme-color 多色选取
use-theme-color 已重构,支持一次选取多种颜色,主题定制更灵活。
增强:
- 支持同时选取多种颜色
- 颜色选取逻辑改进
- 多色场景下性能更好
便于在需要多色协同应用的主题场景中组合使用。
相关 PR: #170
文档
动画样式指南注释
为动画样式指南补充注释与说明,便于开发者理解与正确使用动画能力。
改进:
- 示例代码附详细注释
- 动画模式说明更清晰
- 不同动画方案的选用指引更明确
相关 PR: #179
问题修复
本版本包含以下修复:
- Issue #173:修复
classNames={{ container: "bg-x" }}无法为 TextField.Input 容器设置backgroundColor的问题。 - Issue #177:修复按钮缩放动画有时停留在 0.9 倍、松手后无法回弹的问题。
- Issue #178:修复影响组件功能的问题。
文档更新
以下文档页面已随本版本更新:
- 动画指南 — 补充动画 API State 属性说明
- 颜色指南 — 补充 use-theme-color 多色选取说明
- PressableFeedback 组件 — 更新重构后的 API 文档
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Beta 11 (`apps/docs/content/docs/cn/native/releases/beta-11.mdx`)
title: Beta 11 github: pull: 203
2026 年 1 月 6 日
Beta 11 聚焦多块核心能力的可靠性与开发者体验:增强 Bottom Sheet 在各关闭路径下的一致性;修复 Dialog 侧滑关闭手势;解决 TextField 样式与行为问题;并新增 PortalHost 导出以支持高级 Portal 挂载。交互更顺滑,对组件行为的控制也更充分。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native@beta抢先体验
通过预览应用在真机上体验 Beta 11 的改进!你可以查看增强后的 Bottom Sheet、Dialog、TextField 与 PortalHost 相关能力。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
组件改进
Bottom Sheet 关闭协同增强
Bottom Sheet 已增强各类关闭路径之间的协同。
改进:
- 下滑关闭、点击遮罩、关闭按钮与程序化关闭之间的同步更好
- 关闭过程中的状态管理改进,减少竞态
- 各关闭场景下
onOpenChange触发更可靠 - 动画进度与关闭态切换的衔接更顺畅
Bottom Sheet 支持下滑、点遮罩、点关闭按钮或代码关闭。此前这些路径偶发冲突或表现不一致;本更新使各路径协调一致,体验更可预期。
相关 PR: #201
Dialog 侧滑关闭手势修复
Dialog 已修复侧滑关闭手势的处理。
改进:
- 侧滑关闭的手势检测与处理修复
- 滑动过程中手势状态管理改进
- 松手时与动画的衔接增强
- 超过阈值后侧滑关闭更可靠
Dialog 支持下滑关闭。本修复解决滑动过程中手势偶发无响应或行为异常的问题。
相关 PR: #193
TextField 样式与行为修复
TextField 的样式与行为问题已修复。
改进:
- 输入框样式不一致问题修复
- 动画状态管理问题修复
- 聚焦/失焦处理改进
- 错误态视觉反馈增强
- 占位符与选中颜色应用修复
确保 TextField 在聚焦、失焦、非法等状态下显示正确,并向用户提供一致的视觉反馈。
相关 PR: #202
API 增强
PortalHost 导出(高级场景)
PortalHost 现从主 Provider 模块导出,支持高级 Portal 宿主挂载。
新能力:
import { HeroUINativeProvider, PortalHost } from "heroui-native";
export function CustomLayout() {
return (
<>
<HeroUINativeProvider>
{/* 应用内容 */}
</HeroUINativeProvider>
{/* 在自定义位置手动挂载 PortalHost */}
<PortalHost name="custom-host" />
</>
);
}便于在自定义布局中手动挂载 Portal 宿主,例如需在 BottomSheet、Modal 或其他遮罩内指定渲染位置时。默认 HeroUINativeProvider 已包含标准场景的 PortalHost;现可额外创建具名宿主以支持多宿主架构。
适用场景:
- 在 Bottom Sheet 内挂载 Portal
- 在 Modal 中创建 Portal 宿主
- 自定义遮罩渲染
- 多宿主 Portal 架构
相关 PR: #185
问题修复
本版本包含以下修复:
Issue #187:修复通过滑动手势关闭后,需多次点击才能再次打开 Bottom Sheet 或 Dialog 的问题。内部状态现与关闭动画正确同步,无论以何种方式关闭均可立即再次打开。
Issue #189:修复含文本输入的 Dialog 在侧滑关闭时应用卡死的问题。
Issue #196:修复 TextField 多行输入行为,与 React Native
TextInput多行语义一致。Issue #199:修复 TextField Input 内占位符文字位置问题。
相关 PR:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Beta 12 (`apps/docs/content/docs/cn/native/releases/beta-12.mdx`)
title: Beta 12 github: pull: 214
2026 年 1 月 13 日
Beta 12 新增三个核心表单组件——InputOTP、Label、Description——强化 React Native 中的表单搭建能力。另含 Popover 关闭行为、弹层受控状态、圆角配置等关键修复,并为多个表单组件增加变体样式属性支持,使表单组件更稳健、样式与行为更易控。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native@beta抢先体验
通过预览应用在真机上体验 Beta 12!你可以探索 InputOTP、Label、Description,以及 Popover 修复、受控状态改进、圆角修复与变体样式属性支持。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
新组件
本版本新增 3 个核心表单组件:
- InputOTP:一次性密码输入,独立字符格、动画与校验支持。
- Label:表单与界面元素标签文本,支持必填标记与校验态。
- Description:无障碍说明与辅助文案,用于表单等场景。
InputOTP
InputOTP 为双因素认证、验证码、PIN 等场景提供完整方案:独立字符格与流畅动画、可自定义分组与分隔符、全面校验支持。
特性:
- 独立字符格、流畅动画与光标指示
- 灵活分组与分隔符
- 基于模式的输入限制(数字、字符或自定义正则)
- 受控/非受控值管理
- 校验态与视觉反馈
- 每位占位符可配置
- 粘贴支持与转换函数
- 完整无障碍支持
用法:
import { InputOTP, Label, Description } from "heroui-native";
export function Example() {
return (
<>
<Label>Verify account</Label>
<InputOTP maxLength={6} onComplete={(code) => console.log(code)}>
<InputOTP.Group>
<InputOTP.Slot index={0} />
<InputOTP.Slot index={1} />
<InputOTP.Slot index={2} />
</InputOTP.Group>
<InputOTP.Separator />
<InputOTP.Group>
<InputOTP.Slot index={3} />
<InputOTP.Slot index={4} />
<InputOTP.Slot index={5} />
</InputOTP.Group>
</InputOTP>
<Description>We've sent a code to your email</Description>
</>
);
}完整文档与示例见 InputOTP 组件页。
相关 PR: #214
Label
Label 为表单字段提供无障碍标签,内置必填星号、校验态与禁用态,并随字段校验状态自适应样式。
特性:
- 必填字段自动显示星号
- 非法态样式
- 禁用态支持
- 复合结构便于自定义布局
- 通过 nativeID 关联的完整无障碍支持
- 支持
className、classNames、styles定制样式
用法:
import { Label, TextField } from "heroui-native";
export function Example() {
return (
<TextField>
<Label isRequired>Password</Label>
<TextField.Input placeholder="Create a password" secureTextEntry />
</TextField>
);
}完整文档与示例见 Label 组件页。
相关 PR: #214
Description
Description 为表单字段提供无障碍辅助说明,默认弱化样式,并可通过 nativeID 与字段关联以支持读屏。
特性:
- 适合辅助文案的弱化文本样式
- 通过 nativeID 与
aria-describedby关联无障碍 - 与表单组件无缝集成
- 支持自定义样式
用法:
import { Description, TextField } from "heroui-native";
export function Example() {
return (
<TextField>
<TextField.Label>Email address</TextField.Label>
<TextField.Input
placeholder="Enter your email"
keyboardType="email-address"
aria-describedby="email-desc"
/>
<Description nativeID="email-desc">
We'll never share your email with anyone else.
</Description>
</TextField>
);
}完整文档与示例见 Description 组件页。
相关 PR: #214
组件改进
Popover 通过 ref 关闭修复
Popover 已修复通过 ref 程序化关闭时的行为。
改进:
- 基于 ref 的关闭方法现能正确触发关闭动画
- ref 调用与组件内部状态的同步改进
- 程序化关闭更可靠
确保调用 popoverRef.current?.close() 时能可靠关闭并正确管理状态与动画。
相关 PR: #207
弹层受控状态修复
Dialog、Bottom Sheet、Popover 等弹层组件已修复通过 isOpen 的受控状态。
改进:
- 受控状态同步修复
- 外部状态变更的处理改进
- 受控模式下行为更可预期
相关 PR: #215
Button、Chip、Tabs 圆角修复
Button、Chip、Tabs 已修复对全局圆角配置的尊重。
改进:
- Button 全局圆角应用修复
- Chip 圆角应用修复
- Tabs 圆角应用修复
- 使用全局主题配置的组件间一致性提升
相关 PR: #218
TextField.Input 属性精简
TextField 的 Input 子组件已移除 animation 与 isAnimatedStyleActive。
变更:
- 自 TextField.Input 移除
animation - 自 TextField.Input 移除
isAnimatedStyleActive - API 简化,更易维护
动画行为现由组件内部统一处理,无需手动配置动画属性。
相关 PR: #220
API 增强
HeroUINativeProvider 的 devInfo 配置
HeroUINativeProvider 现支持 devInfo 配置项,便于开发与调试。
新能力:
import { HeroUINativeProvider } from "heroui-native";
export function App() {
return (
<HeroUINativeProvider
devInfo={{
// 开发期配置项
}}
>
{/* 应用内容 */}
</HeroUINativeProvider>
);
}相关 PR: #217
变体样式属性支持
Checkbox、Radio、TextField、InputOTP 现支持通过 variant 样式属性更便捷地覆盖变体样式。
新能力:
import { Checkbox, Radio, TextField, InputOTP } from "heroui-native";
<Checkbox variant="bordered" style={{ variant: "flat" }}>
Option 1
</Checkbox>
<Radio variant="solid" style={{ variant: "bordered" }}>
Option 2
</Radio>
<TextField variant="underlined" style={{ variant: "bordered" }}>
<TextField.Input />
</TextField>除组件 variant 属性外,也可通过 style 中的变体信息灵活调整外观。
相关 PR: #220
样式修复
圆角配置
修复全局圆角未正确应用到部分组件的问题。
修复:
- Button 未尊重全局圆角
- Chip 圆角应用
- Tabs 圆角应用
样式优化
- 圆角一致性:Button、Chip、Tabs 的圆角应用更一致
- 主题配置:主题传播增强,组件更一致地尊重全局设置
问题修复
本版本包含以下修复:
Issue #93:修复在 Unwind 场景下 Button 未应用全局圆角的问题,现与主题全局圆角一致。
Issue #213:修复 Select 受控模式(
isOpen)不生效的问题;提供isOpen时可在外部可靠管理开闭。
相关 PR:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Beta 13 (`apps/docs/content/docs/cn/native/releases/beta-13.mdx`)
title: Beta 13 github: pull: 254
2026 年 2 月 3 日
Beta 13 引入多行输入组件 TextArea、Button outline 变体,并为所有组件导出样式类名。本版本显著改进 Tabs(动画与变体命名更清晰)、将表单相关能力拆为独立原语、重构弹层动画系统以提升一致性与 Android 兼容性,并修复中文输入、主题色计算、Uniwind Pro 兼容、Bottom Sheet 打开与摇树(tree-shaking)等关键问题,整体提升开发者体验与组件可靠性。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native@beta抢先体验
通过预览应用在真机上体验 Beta 13!你可以探索 TextArea、CloseButton、Button outline、Tabs 改进、细粒度导出与各项修复。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
新组件
本版本新增 3 个重要组件:
- TextArea:多行文本输入,带样式边框与背景,适用于较长内容。
- Input:单行文本输入,带样式边框与背景;现作为独立于 TextField 的组件提供(此前仅
TextField.Input)。 - CloseButton:可复用关闭按钮,用于 Dialog、Modal 等遮罩场景,样式在各遮罩间一致。
TextArea
TextArea 面向评论、消息、描述与较长表单字段等多行场景;可与 TextField 组合成完整表单结构,支持校验态与多种视觉变体。
特性:
- 多行输入,行数可配置
- 与 TextField 无缝组合
- 校验态与视觉反馈
- primary / secondary 等变体
- 禁用与只读
className与styles定制- 完整无障碍支持
用法:
import { Description, Label, TextArea, TextField } from "heroui-native";
export function Example() {
return (
<TextField>
<Label>Message</Label>
<TextArea placeholder="Enter your message here..." />
<Description>Please provide as much detail as possible.</Description>
</TextField>
);
}完整文档与示例见 TextArea 组件页。
相关 PR: #254
Input
Input 现可作为独立组件使用,提供带边框与背景的单行输入。此前仅能通过 TextField.Input 使用;现可单独使用,或与 TextField、ControlField 等组合。
特性:
- 单行输入,带样式边框与背景
- 独立使用或与表单组件组合
- 校验态与视觉反馈
- primary / secondary 变体
- 禁用与只读
className与styles- 完整无障碍支持
用法:
import { Description, Input, Label, TextField } from "heroui-native";
export function Example() {
return (
<TextField>
<Label>Email</Label>
<Input placeholder="Enter your email..." />
<Description>We'll never share your email.</Description>
</TextField>
);
}完整文档与示例见 Input 组件页。
相关 PR: #247
CloseButton
CloseButton 为关闭 Dialog、Modal、Popover 等遮罩提供统一实现:跨遮罩一致样式、可配置图标属性,并与 Dialog、Popover、Select、Bottom Sheet 等集成。
特性:
- 各遮罩间关闭按钮样式一致
- 图标尺寸与颜色可配置
- 支持自定义子节点替换默认图标
- 禁用态
- 与 Dialog、Popover、Select、Bottom Sheet 集成
- 默认样式针对遮罩场景优化
用法:
import { CloseButton } from "heroui-native";
// 独立使用
<CloseButton onPress={handleClose} />
// 作为 Dialog、Popover、Select、Bottom Sheet 的一部分
<Dialog>
<Dialog.Close />
</Dialog>完整文档与示例见 CloseButton 组件页。
相关 PR: #237
新子组件
Tabs.Separator
Tabs 新增 Separator 子组件,在触发器之间提供随当前选项卡变化的显隐动画,便于做视觉分隔。
特性:
- 随活动选项卡变化的显隐过渡
betweenValues控制显示区间- 动画时长与不透明度可配置
- 可设为始终可见的静态分隔
用法:
import { Tabs } from "heroui-native";
<Tabs value={activeTab} onValueChange={setActiveTab}>
<Tabs.List>
<Tabs.ScrollView>
<Tabs.Indicator />
<Tabs.Trigger value="general">
<Tabs.Label>General</Tabs.Label>
</Tabs.Trigger>
<Tabs.Separator betweenValues={["general", "notifications"]} />
<Tabs.Trigger value="notifications">
<Tabs.Label>Notifications</Tabs.Label>
</Tabs.Trigger>
</Tabs.ScrollView>
</Tabs.List>
</Tabs>相关 PR: #228
组件改进
Button outline 变体
Button 新增 outline 变体:透明背景 + 边框,丰富按钮视觉层次。
改进:
- 新增
outline有边框样式 - 与其他 Button 变体风格一致
- outline 的悬停与聚焦态正确
- 与既有 Button API 无缝衔接
用法:
import { Button } from "heroui-native";
<Button variant="outline">Outline Button</Button>相关 PR: #235
Tabs 指示条动画重构
Tabs 指示条动画由宽高动画改为 translateX 变换,过渡更顺滑、性能更好。
改进:
- 指示条迁移到
translateX - 动画性能与流畅度提升
- 切换时视觉更一致
- 减少动画期间的布局重算
相关 PR: #227
Popover 箭头尺寸与视觉衔接
Popover 改进箭头尺寸及与内容的视觉衔接。
改进:
- 箭头尺寸相对内容更合理
- 箭头与弹层连接更自然
- 对齐与间距优化
相关 PR: #243
表单组件拆分为原语
表单相关能力拆为独立原语,组合更灵活、职责更清晰。
改进:
- 表单能力原子化
- 复用性与组合性提升
- 关注点分离更好
- 自定义表单布局更自由
相关 PR: #247
Input Android 阴影修复
Input 为 Android 增加平台相关阴影,跨端视觉更一致。
改进:
- Android 平台阴影
- iOS / Android 观感对齐
- Android 上层次(elevation)观感改善
相关 PR: #248
弹层动画系统重构
Popover、Select、Dialog、BottomSheet 的动画系统已重构:统一进出场逻辑、遮罩组合与内容动画,标准化各弹层行为并修复 Android 指针事件问题。
改进:
- Dialog 等呈现统一使用 FadeInDown / FadeOutDown 等进出场
- 遮罩动画钩子同时支持基于 progress 与进出场两类动画
- 遮罩组合更多使用 Dialog.Overlay、Popover.Overlay,减少单纯 Pressable 包裹
- 修复影响弹层交互的 Android pointer events 问题
- 示例中显式写出
presentation(popover、dialog、bottom-sheet) - 动画 API 简化,更易维护、跨组件更一致
相关 PR: #263
API 增强
细粒度导出以优化包体
库现为各组件提供细粒度导出路径,可按需 import 以减小包体。
新能力:
// 细粒度导入——仅需少量组件时推荐
import { HeroUINativeProvider } from "heroui-native/provider";
import { Button } from "heroui-native/button";
import { Card } from "heroui-native/card";
// 总入口导入——会拉取整库,适合大量使用组件时
import { Button, Card } from "heroui-native";细粒度导入适合只用少数组件的场景;从 heroui-native 总入口导入会包含完整库,适合全站大量使用。
可用细粒度路径:
heroui-native/provider— Providerheroui-native/[component-name]— 各组件heroui-native/portal— Portal 工具heroui-native/utils— 工具函数heroui-native/hooks— 自定义 Hooks
相关 PR: #233
样式类名导出
所有组件现导出对应样式类名,便于在代码中引用类名或搭建自定义主题方案。
新能力:
import { buttonClassNames } from "heroui-native";
const customStyles = {
base: buttonClassNames.base,
variant: buttonClassNames.variant,
};相关 PR: #252
样式修复
样式优化
- 移除 quaternary 变体:删除第四级变体并打磨样式以提升一致性
- 多组件样式打磨:视觉一致性增强
- 阴影与圆角:跨组件阴影、圆角更统一
- 主题变量整理:简化变量并减少冗余
color-mix计算
相关 PR: #246
⚠️ 破坏性变更
Tabs `variant` 重命名
Tabs 的 variant 由 pill / line 改为 primary / secondary,与其他组件命名更一致。
迁移:
// 之前
<Tabs variant="pill">{/* content */}</Tabs>
<Tabs variant="line">{/* content */}</Tabs>
// 之后
<Tabs variant="primary">{/* content */}</Tabs>
<Tabs variant="secondary">{/* content */}</Tabs>可选项:
"primary"— 原"pill""secondary"— 原"line"
相关 PR: #236
Tabs 指示条动画实现变更
Tabs 指示条由 left 定位改为 translateX 变换以利用 GPU。若自定义过指示条动画,需更新配置。
迁移:
// 之前
<Tabs
indicatorAnimation={{
left: {
type: "spring",
config: { damping: 20, stiffness: 300 },
},
}}
>
{/* content */}
</Tabs>
// 之后
<Tabs
indicatorAnimation={{
translateX: {
type: "spring",
config: { damping: 20, stiffness: 300 },
},
}}
>
{/* content */}
</Tabs>变更摘要:
TabsIndicatorAnimation中由left改为translateX- 指示条定位基于
translateX变换 - 指示条样式增加
left-0基准类以保持初始位置 - 观感应与此前一致,仅底层实现变化
相关 PR: #227
Divider 更名为 Separator
Divider 已更名为 Separator,命名更统一,并避免与其他「分隔线」实现混淆。
迁移:
// 之前
import { Divider } from "heroui-native";
<Divider />
// 之后
import { Separator } from "heroui-native";
<Separator />相关 PR: #238
移除 quaternary 变体
Surface 与 Card 已移除 quaternary 变体,简化设计系统。
迁移:
// 之前
<Surface variant="quaternary">{/* content */}</Surface>
<Card variant="quaternary">{/* content */}</Card>
// 之后:使用 default、secondary、tertiary 或自定义 className
<Surface variant="secondary">{/* content */}</Surface>
<Card variant="secondary">{/* content */}</Card>
<Surface className="bg-custom-quaternary">{/* content */}</Surface>可用变体: "default"、"secondary"、"tertiary"
相关 PR: #246
表单原语拆分与重命名
表单拆分过程中若干组件重命名、结构调整,以获得更灵活的组合方式。
重命名:
FormField→ControlFieldErrorView→FieldError
迁移:
// 之前
import { FormField, ErrorView, TextField } from "heroui-native";
<FormField>
<TextField.Input />
<ErrorView>Error message</ErrorView>
</FormField>
// 之后
import { ControlField, FieldError, Input, TextField } from "heroui-native";
<ControlField>
<Input />
<FieldError>Error message</FieldError>
</ControlField>移除 TextField.Input:
请改用独立 Input:
// 之前
import { TextField } from "heroui-native";
<TextField>
<TextField.Input placeholder="Enter text..." />
</TextField>
// 之后
import { Input, TextField } from "heroui-native";
<TextField>
<Input placeholder="Enter text..." />
</TextField>组合方式:
RadioGroup、TextField、ControlField 现直接使用 Label、Description、FieldError:
import { ControlField, Description, FieldError, Input, Label, RadioGroup, TextField } from "heroui-native";
<TextField>
<Label>Email</Label>
<Input placeholder="Enter email..." />
<Description>We'll never share your email.</Description>
<FieldError>Invalid email address</FieldError>
</TextField>
<RadioGroup>
<Label>Select option</Label>
<RadioGroup.Item value="option1">
<RadioGroup.Label>Option 1</RadioGroup.Label>
</RadioGroup.Item>
<Description>Choose one option</Description>
<FieldError>Please select an option</FieldError>
</RadioGroup>
<ControlField>
<Label>Custom Field</Label>
<Input placeholder="Enter value..." />
<Description>Additional information</Description>
<FieldError>Validation error</FieldError>
</ControlField>相关 PR: #247
CloseButton 与移除 Close 的 asChild
新增可复用 CloseButton;Dialog、Popover、Select、BottomSheet 的关闭实现统一基于该组件。各 *.Close 已移除 asChild。
迁移:
// 之前
import { Button, Dialog } from "heroui-native";
<Dialog>
<Dialog.Close asChild>
<Button>Cancel</Button>
</Dialog.Close>
</Dialog>
// 之后:用受控 open + 自定义按钮处理关闭
import { Button, Dialog } from "heroui-native";
const [isOpen, setIsOpen] = useState(false);
<Dialog open={isOpen} onOpenChange={setIsOpen}>
<Button onPress={() => setIsOpen(false)}>Cancel</Button>
</Dialog>变更摘要:
- 新增
CloseButton,默认variant="tertiary"、size="sm"、isIconOnly={true} Dialog.Close、Popover.Close、Select.Close、BottomSheet.Close内部基于CloseButton- 所有 Close 组件移除
asChild - Close 仍支持 Button 的
variant、size、iconProps与自定义children - 使用完全自定义按钮时需自行处理关闭逻辑
相关 PR: #237
弹层动画系统重构(API)
弹层动画重构带来若干需改代码的 API 调整。
迁移要点:
- 从
Dialog.Root移除closeDelay、isDismissKeyboardOnClose - 从
Dialog.Root的animation移除自定义entering/exiting(仅保留禁用类开关);自定义进出场请在Dialog.Content上使用 Keyframe 动画配置 - 从
Dialog.Content移除isAnimatedStyleActive、onLayout - 从
BottomSheet.Root移除isDismissKeyboardOnClose BottomSheet.Overlay的animation不再支持entering/exiting- 所有
Popover.Content、Select.Content必须显式传入presentation(由可选改为必填) useBottomSheetAnimation()不再返回bottomSheetState;useDialogAnimation()不再返回dialogState
变更摘要:
Dialog.Root:移除closeDelay、isDismissKeyboardOnClose;animation类型由支持自定义进场的DialogRootAnimation收窄为仅禁用标志的AnimationRootDisableAllDialog.Content:移除isAnimatedStyleActive、onLayoutBottomSheet.Root:移除isDismissKeyboardOnCloseBottomSheet.Overlay:animation不再含entering/exitingPopover.Content、Select.Content:presentation必填(此前可选,默认"popover")- 上述动画钩子返回值精简
相关 PR: #263
问题修复
本版本包含以下修复:
Issue #181:修复 TextField 输入中文等多字节字符报错;现正确处理多字节与国际输入,含中日韩等语言。
Issue #219:修复 Button
childrenToString()在多子节点时返回"[object Object]";现正确处理 React 元素与复杂子树,避免错误字符串化。Issue #232:修复 HeroUINativeProvider 与新版 Uniwind Pro 不兼容;现可正常配合最新 Uniwind。
Issue #259:修复 Bottom Sheet 在快速打开并随即进行手势操作后偶发无法再次打开等问题;进出场动画逻辑重构后已缓解。
Issue #261:修复
@gorhom/bottom-sheet无法被摇树剔除的问题;未使用依赖可被更好剔除。
其他修复:
- 修复主题计算色在部分场景下数值错误
- 修复
childrenToString,避免错误地将 React 元素转为字符串
相关 PR:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Cli V1 0 0 (`apps/docs/content/docs/cn/native/releases/cli-v1-0-0.mdx`)
title: CLI v1.0.0 全新的命令行工具,用于一键创建预先配置好的 HeroUI Native + Expo Router 项目 —— Expo SDK 56、React Native 0.85、Uniwind,所有 peer 依赖均已就绪,并提供两套起始模板(单页面与 Tabs)。
2026 年 6 月 4 日
🎉 全新的 CLI —— create-heroui-native-app —— 现已成为启动 HeroUI Native 项目最快捷的方式。一条命令即可生成一个完整的 Expo Router 应用,内置 HeroUI Native、Uniwind、Tailwind CSS、所有必需的 peer 依赖以及 Provider 包装,无需再手动配置 global.css、metro.config.js 或 app/_layout.tsx。
快速开始
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npx create-heroui-native-app@latest my-app随后启动开发服务器:
cd my-app
npm run start到此为止。如需完整流程,请直接阅读快速开始指南。
起始模板
CLI 自带两套模板。可在交互式选择器中选择,或通过命令行参数跳过提示:
| 参数 | 模板 | 说明 |
|---|---|---|
--expo |
expo |
单页面 Expo Router 应用,含 HeroUI Button 演示。 |
--expo-tabs |
expo-tabs |
含两个 Tabs(Button + Card 演示)的 Expo Router 布局。 |
npx create-heroui-native-app@latest my-app --expo
npx create-heroui-native-app@latest my-app --expo-tabs --use-pnpm你将得到什么
每个生成的项目都已预先配置:
- Expo SDK 56 + Expo Router,并启用类型化路由
- React 19.2 + React Native 0.85.2 + Hermes v1(SDK 56 默认启用)
- HeroUI Native:在
app/_layout.tsx中由HeroUINativeProvider与GestureHandlerRootView包裹 - Uniwind + Tailwind CSS:通过
metro.config.js与global.css完成接入 - 所有 HeroUI Native 必需的 peer 依赖已锁定到兼容版本:
react-native-reanimated、react-native-gesture-handler、react-native-worklets、react-native-safe-area-context、react-native-svg、tailwind-variants、tailwind-merge - 内置
react-native-screens,让 HeroUI 的遮罩组件(Dialog、Menu、Popover、Select、BottomSheet、Toast)开箱即用 @expo/metro-runtime(SDK 56 上 Expo Router 需要的 peer 依赖)- 仅使用
babel-preset-expo的babel.config.js(worklets 已由该 preset 处理) - 启用
strict: true与@/*路径别名的 TypeScript 配置
CLI 参考
create-heroui-native-app [project-name] [options]| 选项 | 说明 |
|---|---|
[project-name] |
要创建的目录名。未提供时会进行交互提示。必须是合法的 npm 包名。 |
--expo |
使用单页面 Expo 模板。 |
--expo-tabs |
使用 Expo + Tabs 模板。 |
--template |
指定模板 id(expo 或 expo-tabs)。 |
--use-npm / --use-yarn / --use-pnpm / --use-bun |
强制使用指定包管理器(默认自动检测)。 |
--skip-install |
跳过依赖安装步骤。 |
--skip-git |
不初始化 git 仓库。 |
-h, --help |
打印用法并退出。 |
示例
# 完全交互式 —— 同时提示项目名与模板
npx create-heroui-native-app@latest
# 已指定项目名,仍展示模板选择器
npx create-heroui-native-app@latest my-app
# 完全非交互式
npx create-heroui-native-app@latest my-app --expo
# 使用 Tabs 模板,并通过 pnpm 安装依赖
npx create-heroui-native-app@latest my-app --expo-tabs --use-pnpm
# 仅生成项目,不安装依赖、不初始化 git
npx create-heroui-native-app@latest my-app --expo --skip-install --skip-git系统要求
- Node.js 20.19.4+(Expo SDK 56 / React Native 0.85 的要求)
- 构建原生 iOS 时需要 iOS 16.4+(Expo SDK 56 的部署目标)
- macOS、Linux 或 Windows
链接
Apps Docs Content Docs Cn Native Releases Meta.Json (`apps/docs/content/docs/cn/native/releases/meta.json`)
{
"title": "发布说明",
"description": "HeroUI Native 发布说明",
"icon": "rocket",
"root": true,
"pages": [
"---概述---",
"index",
"---版本列表---",
"v1-0-11",
"v1-0-10",
"v1-0-9",
"v1-0-8",
"v1-0-7",
"v1-0-6",
"v1-0-5",
"cli-v1-0-0",
"v1-0-4",
"v1-0-3",
"v1-0-2",
"v1-0-1",
"v1-0-0",
"rc-4",
"rc-3",
"rc-2",
"rc-1",
"beta-13",
"beta-12",
"beta-11",
"beta-10"
]
}
Apps Docs Content Docs Cn Native Releases Rc 1 (`apps/docs/content/docs/cn/native/releases/rc-1.mdx`)
title: RC 1 github: pull: 284
2026 年 2 月 12 日
RC 1 是 HeroUI Native 的首个候选发布(Release Candidate),表明库已接近生产可用。本版本引入以无障碍为先、带状态变体的 Alert 复合组件;将 Radio 抽为可双模式运行的独立组件;新增带动画的 Select.TriggerIndicator 子组件。还提供轻量 HeroUINativeProviderRaw 以优化包体、用于 iOS 调试的 disableFullWindowOverlay、六个组件统一的 styles 插槽式样式,以及用主题显式变量替代计算型 surface 色的主题重构。另含 BottomSheet 内 InputOTP、Toast 文字裁切与元素检查器兼容等关键修复。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过预览应用在真机上体验 RC 1 的全部改进!你可以探索新的 Alert 与 Radio、Select TriggerIndicator,以及各项修复。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
新组件
本版本新增 1 个组件:
- Alert:无障碍告警组件,五种状态变体,复合子组件灵活组合内容。
Alert
Alert 提供无障碍告警展示,内置五种状态变体:default、accent、success、warning、danger。遵循复合组件模式,含 Alert.Indicator、Alert.Content、Alert.Title、Alert.Description,便于布局与定制。原语层自动提供 role="alert"、aria-labelledby 与 aria-describedby 关联。
特性:
- 五种状态变体:default、accent、success、warning、danger
- 默认 SVG 状态图标,通过
useStatusColor随主题着色 - 复合架构:Indicator、Content、Title、Description
- 支持自定义指示器(如替换为 Spinner)
- 无障碍原语:
role="alert"、aria-labelledby、aria-describedby - 所有子组件支持
asChild插槽 - 所有部件支持 ref 转发与
className
用法:
import { Alert } from "heroui-native";
export function Example() {
return (
<Alert status="success">
<Alert.Indicator />
<Alert.Content>
<Alert.Title>Payment successful</Alert.Title>
<Alert.Description>
Your payment has been processed successfully.
</Alert.Description>
</Alert.Content>
</Alert>
);
}完整文档与示例见 Alert 组件页。
相关 PR: #284
新子组件
Select.TriggerIndicator
Select 新增 TriggerIndicator 子组件,显示带动画的 V 形图标以表示开/关状态,开闭时以 Reanimated 弹簧物理旋转。
特性:
- 开闭过渡时旋转的 V 形动画
animation可配置旋转值与弹簧参数iconProps自定义尺寸、颜色- 支持自定义子节点替换默认 V 形
- 与 Select 开闭状态自动同步
用法:
import { Select } from "heroui-native";
<Select>
<Select.Trigger>
<Select.Value placeholder="Select an option" />
<Select.TriggerIndicator />
</Select.Trigger>
<Select.Portal>
<Select.Content>
{/* Select items */}
</Select.Content>
</Select.Portal>
</Select>相关 PR: #274
组件改进
Toast 样式与堆叠重构
Toast 样式由边框模拟内边距改为真实 p-4 与上下占位视图,改善多 Toast 堆叠时的内容可见性。
改进:
- 以
p-4取代border-[16px]内边距变通写法 - 新增
useVerticalPlaceholderStyles用于占位视图样式 - 顶部与底部绝对定位占位 View,避免堆叠时内容露出
- 阴影系统改用
shadow-overlay令牌 - 统一各主题(alpha、mint、sky)的遮罩阴影,降低不透明度
确保不同高度 Toast 堆叠时内容仍被正确遮挡,样式更易维护、可预期。
相关 PR: #229
Dialog 遮罩手势关闭动画时序
Dialog 在手势关闭时弹层动画时序已修复:进度值按延迟正确排队,确保关闭动画播完再重置。
改进:
- 手势关闭时进度在 300ms 延迟后过渡到 2
- 350ms 后进度重置为 0,保证动画完成
- 移除
isOpen为 false 时立即progress.set(2)的调用 - 侧滑关闭时关闭动画可正常播放
相关 PR: #277
主题 Surface 变量重构
主题系统以主题文件中的显式 surface 变量取代计算色,跨主题更可控、更一致。
改进:
surface-secondary、surface-tertiary(及对应前景)在各主题(alpha、lavender、mint、sky、variables.css)中显式定义- 基础主题使用
var(--surface-secondary)、var(--surface-tertiary),不再用color-mix计算 - 从 theme.css 移除
on-surface、on-surface-secondary、on-surface-tertiary调色板 - 主题文档更新变量结构与示例
主题作者可直接控制 surface 色值,不再依赖 color-mix,各主题 surface 表现更可预期。
相关 PR: #281
API 增强
多组件统一 `styles` 属性
六个组件现支持统一的 styles 插槽式样式 API。
涉及组件:
- Accordion:
container、separator插槽 - AvatarFallback:
container、text插槽 - FieldError:
container、text插槽 - Label:
text、asterisk插槽(并修复style处理) - PressableFeedback Ripple:
container、ripple插槽(取代containerStyle与rippleStyle) - SelectContentDialog:
wrapper、content插槽
新能力:
import { Accordion, Label } from "heroui-native";
// 对指定插槽应用样式
<Label styles={{ text: { fontSize: 18 }, asterisk: { color: "red" } }} isRequired>
Username
</Label>
<Accordion
styles={{
container: { borderRadius: 12 },
separator: { backgroundColor: "gray" },
}}
>
{/* Accordion items */}
</Accordion>变更保持与既有 style 的向后兼容,二者同时提供时会正确合并。
相关 PR: #271
`disableFullWindowOverlay` 属性
基于 Portal 的组件现支持 disableFullWindowOverlay,便于在 iOS 开发时使用 React Native 元素检查器。
涉及组件:
BottomSheet.PortalDialog.PortalPopover.PortalSelect.PortalToastProvider
新能力:
import { Dialog } from "heroui-native";
// 在 iOS 上启用元素检查器
<Dialog>
<Dialog.Portal disableFullWindowOverlay>
<Dialog.Overlay />
<Dialog.Content>
{/* content */}
</Dialog.Content>
</Dialog.Portal>
</Dialog>iOS 上 FullWindowOverlay 使用独立原生窗口,会阻挡元素检查器。将 disableFullWindowOverlay 设为 true 时内容绘于主窗口,开发期可检查元素;代价是遮罩不再叠在原生模态或键盘之上。Android 上该属性无效果。
使用 HeroUINativeProvider 时,Toast 通过 config.toast 传入该属性。
相关 PR: #283
HeroUINativeProviderRaw
新增轻量提供者变体 HeroUINativeProviderRaw,不包含 ToastProvider 与 PortalHost,由使用方完全控制打包依赖。
新能力:
import { HeroUINativeProviderRaw } from "heroui-native/provider-raw";
// 无 Toast 与 Portal 的轻量提供者
export function App() {
return (
<HeroUINativeProviderRaw>
{/* Your app content */}
</HeroUINativeProviderRaw>
);
}react-native-screens、@gorhom/bottom-sheet、react-native-svg 由此可作为完全可选的对等依赖。Raw 提供者仅含 SafeAreaListener、GlobalAnimationSettingsProvider、TextComponentProvider。需要 Toast 或 Portal 时可自行组合。
相关 PR: #285
Select.Trigger 的 `variant` 属性
Select.Trigger 现支持 variant:"default" 与 "unstyled",便于与 Button 等自定义触发器组合。
新能力:
import { Button, Select } from "heroui-native";
// 默认变体(预置样式触发器)
<Select>
<Select.Trigger variant="default">
<Select.Value placeholder="Choose..." />
<Select.TriggerIndicator />
</Select.Trigger>
</Select>
// 无样式变体,用于自定义组合
<Select>
<Select.Trigger variant="unstyled">
<Button>
<Select.Value placeholder="Choose..." />
<Select.TriggerIndicator />
</Button>
</Select.Trigger>
</Select>相关 PR: #274
ControlField 的 Radio 变体
ControlField 的 ControlField.Indicator 现支持 "radio" 变体,与既有 "switch"、"checkbox" 并列,渲染独立 Radio 组件。
新能力:
import { ControlField } from "heroui-native";
<ControlField>
<ControlField.Indicator variant="radio" />
<ControlField.Label>Radio option</ControlField.Label>
</ControlField>相关 PR: #286
⚠️ 破坏性变更
PressableFeedback Ripple:统一 `styles` 属性
PressableFeedback Ripple 的 containerStyle 与 rippleStyle 已合并为统一 styles。
迁移:
将所有单独样式属性改为 styles:
// 之前
<PressableFeedback.Ripple
containerStyle={{ borderRadius: 8 }}
rippleStyle={{ backgroundColor: "blue" }}
/>
// 之后
<PressableFeedback.Ripple
styles={{
container: { borderRadius: 8 },
ripple: { backgroundColor: "blue" },
}}
/>相关 PR: #271
Select.Trigger 默认样式
Select.Trigger 默认 variant="default",会应用容器样式(flex-row items-center justify-between h-12 px-4 rounded-2xl bg-surface shadow-surface)。若此前为自定义样式触发器,需加 variant="unstyled" 以免套用默认样式。
迁移:
// 之前(自定义样式触发器)
<Select.Trigger className="custom-trigger-styles">
{/* content */}
</Select.Trigger>
// 之后(加 variant="unstyled" 保留自定义)
<Select.Trigger variant="unstyled" className="custom-trigger-styles">
{/* content */}
</Select.Trigger>相关 PR: #274
Surface 主题变量结构调整
基础主题已移除 on-surface、on-surface-secondary、on-surface-tertiary 及其 hover/focus 变体 CSS 变量。secondary/tertiary surface 色现于各主题文件中显式定义。
迁移:
若自定义样式引用上述变量,请改为主题中定义的对应 surface 前景变量。
/* 之前 */
color: var(--on-surface);
color: var(--on-surface-secondary);
/* 之后 */
color: var(--surface-foreground);
color: var(--surface-secondary-foreground);相关 PR: #281
移除 RadioGroup.Indicator
RadioGroup.Indicator 与 RadioGroup.IndicatorThumb 已移除,改为独立 Radio 组件。相关类型 RadioGroupIndicatorProps、RadioGroupIndicatorThumbProps、RadioGroupIndicatorThumbAnimation 亦不再导出。
迁移:
将所有 RadioGroup.Indicator / RadioGroup.IndicatorThumb 替换为 Radio:
// 之前
import { RadioGroup } from "heroui-native";
<RadioGroup>
<RadioGroup.Item value="option1">
<RadioGroup.Indicator>
<RadioGroup.IndicatorThumb />
</RadioGroup.Indicator>
<RadioGroup.Label>Option 1</RadioGroup.Label>
</RadioGroup.Item>
</RadioGroup>
// 之后
import { Radio, RadioGroup } from "heroui-native";
<RadioGroup>
<RadioGroup.Item value="option1">
<Radio>
<Radio.Indicator>
<Radio.IndicatorThumb />
</Radio.Indicator>
</Radio>
<RadioGroup.Label>Option 1</RadioGroup.Label>
</RadioGroup.Item>
</RadioGroup>相关 PR: #286
问题修复
本版本包含以下修复:
Issue #229:修复 BottomSheet 内 InputOTP 不可用。现可在 BottomSheet 遮罩内正常聚焦与输入,解决此前无法输入 OTP 的问题。
Issue #265:修复 Toast 描述首字符被裁切。Toast 样式重构后以真实内边距与占位视图取代边框变通,任意堆叠配置下文字均可完整显示。
Issue #272:修复 FullWindowOverlay 在 iOS 上阻挡 React Native 元素检查器。Portal 组件新增
disableFullWindowOverlay,开发期可将遮罩内容绘于主窗口以恢复检查器。
相关 PR:
文档更新
以下文档页面已随本版本更新:
- Alert — 新组件:用法示例与 API 参考
- Radio — 独立 Radio 组件文档
- Radio Group — 反映移除 RadioGroup.Indicator 及与 Radio 的集成
- Control Field — 新增 radio 变体说明
- Select — TriggerIndicator 子组件与 Trigger variant
- Toast — 更新样式实现说明
- Bottom Sheet — 补充 disableFullWindowOverlay
- Dialog — 补充 disableFullWindowOverlay
- Popover — 补充 disableFullWindowOverlay
- Provider — HeroUINativeProviderRaw 与提供者层级
- Theming — 更新 surface 变量结构与示例
- Accordion — 补充 styles 属性
- Avatar — 补充 styles 属性
- Label — 补充 styles 属性
- Field Error — 补充 styles 属性
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Rc 2 (`apps/docs/content/docs/cn/native/releases/rc-2.mdx`)
title: RC 2 github: pull: 298
2026 年 2 月 20 日
RC 2 继续向生产就绪推进:新增 SearchField、ListGroup、Slider 三个组件;Select 支持由类型安全泛型支撑的多选模式;Button 按压反馈 API 重构为统一的 feedbackVariant + animation;放宽对等依赖约束以更好兼容 Expo SDK 55。另含若干 Select 与 Avatar 的问题修复。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过预览应用在真机上体验 RC 2 的全部改进!你可以探索 SearchField、ListGroup、Slider、Select 多选模式、更新后的 Button 反馈 API,以及各项修复。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
新组件
本版本新增 3 个组件:
- Slider:支持单值与区间模式、横/纵方向、自定义数字格式与弹簧动画拇指反馈。
- ListGroup:基于 Surface 的分组列表,可按压项、前后缀槽位,默认右箭头导航指示。
- SearchField:用于筛选与查询的复合组件,内置搜索图标、可清空输入与空值时自动隐藏清除按钮。
Slider
Slider 支持单值与区间(双拇指)模式、横纵布局、通过 Intl.NumberFormat 自定义数字格式,以及弹簧动画拇指反馈。原语层独立处理手势与数值逻辑,便于换肤实现复用。
特性:
- 复合子组件:
Slider.Output、Slider.Track、Slider.Fill、Slider.Thumb - 区间滑块:
defaultValue/value传入数组,在Slider.Track上使用渲染函数渲染多个拇指 orientation="vertical"纵向formatOptions接受Intl.NumberFormatOptions(货币、百分比、单位等)- 基于 gesture-handler 的拖拽与轨道点击定位
- 数值钳制、步进与多拇指支持
- 可通过
animation配置弹簧缩放拇指动画 - 无障碍:每个拇指
role="slider",完整accessibilityValue(min、max、now、text) useSlider暴露上下文供高级用法
用法:
import { Slider } from "heroui-native";
export function BasicSlider() {
return (
<Slider defaultValue={50} minValue={0} maxValue={100}>
<Slider.Output />
<Slider.Track>
<Slider.Fill />
<Slider.Thumb />
</Slider.Track>
</Slider>
);
}
export function RangeSlider() {
return (
<Slider defaultValue={[20, 80]} minValue={0} maxValue={100}>
<Slider.Output />
<Slider.Track>
{({ thumbs }) => (
<>
<Slider.Fill />
{thumbs.map((_, i) => (
<Slider.Thumb key={i} index={i} />
))}
</>
)}
</Slider.Track>
</Slider>
);
}完整文档与示例见 Slider 组件页。
相关 PR: #305
ListGroup
ListGroup 在 Surface 容器内渲染分组列表项,适用于设置页、菜单与内容浏览等导航列表模式。每项支持前缀、内容(标题 + 描述)与后缀槽位,默认带右箭头导航指示。
特性:
- 基于 Surface 的圆角容器与一致间距
- 复合子组件:
ListGroup.Item、ListGroup.ItemPrefix、ListGroup.ItemContent、ListGroup.ItemTitle、ListGroup.ItemDescription、ListGroup.ItemSuffix ItemSuffix默认内置ChevronRightIcon- 可按压项,集成 PressableFeedback
- 槽位可完全自定义图标、徽标等
用法:
import { ListGroup } from "heroui-native";
export function Example() {
return (
<ListGroup>
<ListGroup.Item onPress={() => console.log("Profile")}>
<ListGroup.ItemContent>
<ListGroup.ItemTitle>Profile</ListGroup.ItemTitle>
<ListGroup.ItemDescription>Manage your account</ListGroup.ItemDescription>
</ListGroup.ItemContent>
<ListGroup.ItemSuffix />
</ListGroup.Item>
<ListGroup.Item onPress={() => console.log("Settings")}>
<ListGroup.ItemContent>
<ListGroup.ItemTitle>Settings</ListGroup.ItemTitle>
<ListGroup.ItemDescription>App preferences</ListGroup.ItemDescription>
</ListGroup.ItemContent>
<ListGroup.ItemSuffix />
</ListGroup.Item>
</ListGroup>
);
}完整文档与示例见 ListGroup 组件页。
相关 PR: #302
SearchField
SearchField 为搜索与筛选场景提供专用输入,采用与 TextField 相同的复合组件模式:搜索图标、可清空输入、值为空时自动隐藏清除按钮。
特性:
- 复合子组件:
SearchField.Group、SearchField.SearchIcon、SearchField.Input、SearchField.ClearButton ClearButton在值为空时自动隐藏,按压清除搜索文本SearchIcon支持自定义子节点替换默认放大镜 SVG- 校验态视觉反馈
- 禁用态支持
- 与 Label、Description、FieldError 无缝集成
用法:
import { Label, SearchField } from "heroui-native";
export function Example() {
return (
<SearchField>
<Label>Search</Label>
<SearchField.Group>
<SearchField.SearchIcon />
<SearchField.Input placeholder="Search components..." />
<SearchField.ClearButton />
</SearchField.Group>
</SearchField>
);
}完整文档与示例见 SearchField 组件页。
相关 PR: #299
Select 多选模式
Select 现通过 selectionMode 支持多选。RootProps 对 SelectionMode 泛型化,TypeScript 按模式解析 value 与 onValueChange——单选为 SelectOption,多选为 SelectOption[]。
特性:
selectionMode="multiple"可多选切换;多选模式下closeOnPress默认false- 类型安全泛型:
RootProps<M>通过SelectValueType<M>解析value/onValueChange Select.Value使用formatSelectedLabels将多标签格式化为「Apple, Banana and Cherry」- 单选模式完全向后兼容(默认)
用法:
import { Select } from "heroui-native";
export function MultiSelect() {
return (
<Select selectionMode="multiple">
<Select.Trigger>
<Select.Value placeholder="Select fruits..." />
<Select.TriggerIndicator />
</Select.Trigger>
<Select.Portal>
<Select.Content>
<Select.Item value="apple" label="Apple" />
<Select.Item value="banana" label="Banana" />
<Select.Item value="cherry" label="Cherry" />
</Select.Content>
</Select.Portal>
</Select>
);
}相关 PR: #298
新子组件
PressableFeedback.Scale
新增复合子组件,用于可选的缩放按压动画组合。PressableFeedback.Scale 可为任意可按压元素(如 ListGroup.Item)增加缩放反馈,而无需根级 PressableFeedback 管理缩放。
用法:
import { PressableFeedback } from "heroui-native";
<PressableFeedback.Scale>
<ListGroup.Item onPress={handlePress}>
{/* item content */}
</ListGroup.Item>
</PressableFeedback.Scale>相关 PR: #302
组件改进
Select 触发器与状态修复
Select 针对触发器与受控状态有多项修复。
改进:
- 自定义
className现正确参与触发器样式计算,修复用户类名被静默丢弃的情况 useControllableState在从受控切到非受控时重置内部状态,避免陈旧选中残留- 触发器通过
onLayout测量位置,正确支持isDefaultOpen - 触发器样式更新为
gap-3、py-3.5,值文本使用flex-1改善布局
相关 PR: #298
Avatar asChild 图片修复
Avatar 的 AvatarImage 在向底层原语转发时正确分离 source、style 与 asChild 及其余属性,修复使用 asChild 时错误将全部属性展开到图片组件的问题。
相关 PR: #298
API 增强
Button 反馈 API 重构
Button 的按压反馈 API 重构为统一的类型安全 feedbackVariant + animation,取代此前多属性拼写。
新能力:
import { Button } from "heroui-native";
// 缩放 + 高亮(默认)
<Button feedbackVariant="scale-highlight">Press me</Button>
// 缩放 + 水波纹
<Button feedbackVariant="scale-ripple">Press me</Button>
// 仅缩放
<Button feedbackVariant="scale">Press me</Button>
// 自定义动画配置
<Button
feedbackVariant="scale-highlight"
animation={{ scale: 0.95, highlight: { color: "rgba(0,0,0,0.1)" } }}
>
Press me
</Button>animation 为按变体区分的联合类型,各反馈配置均有完整类型推导。
button.utils.ts 中新增 resolveAnimationObject 与 isAnimationDisabled,集中解析动画属性。
相关 PR: #302
依赖
放宽对等依赖约束
对等依赖版本约束已放宽为 caret(^)与范围(>=),替代偏紧的 tilde(~)或固定版本,便于使用方在较新依赖版本上解析,尤其 Expo SDK 55。
变更:
react-native-reanimated:~4.1.1→^4.1.1(允许次版本更新)react-native-safe-area-context:~5.6.0→^5.6.0react-native-svg:15.12.1→^15.12.1react-native-worklets:0.5.1→>=0.5.1
无运行时逻辑变更——此前已满足约束的项目无需修改即可继续工作。
相关 PR: #306
⚠️ 破坏性变更
Button 反馈 API
已移除 Button 上的 pressableFeedbackVariant、pressableFeedbackHighlightProps、pressableFeedbackRippleProps。请迁移到 feedbackVariant 与统一的 animation。
迁移:
更新所有 Button 反馈相关属性:
// 之前
<Button
pressableFeedbackVariant="highlight"
pressableFeedbackHighlightProps={{ color: "rgba(0,0,0,0.1)" }}
>
Press me
</Button>
// 之后
<Button
feedbackVariant="scale-highlight"
animation={{ scale: 0.95, highlight: { color: "rgba(0,0,0,0.1)" } }}
>
Press me
</Button>变体映射:
"highlight"→"scale-highlight"(默认)"ripple"→"scale-ripple""none"→"scale"或"none"
可选项:
"scale-highlight"— 缩小 + 高亮遮罩(默认)"scale-ripple"— 缩小 + 水波纹"scale"— 仅缩小"none"— 无反馈动画
相关 PR: #302
问题修复
本版本包含以下修复:
Issue #291:修复
Select.Trigger的variant被className覆盖的问题。传入触发器的自定义类名现正确参与样式计算,不再被静默丢弃。Issue #294:兼容
react-native-worklets0.7.x 与react-native-reanimated4.2.x(Expo SDK 55)。放宽对等依赖约束,接受上述新版本而不产生解析告警。
相关 PR:
文档更新
以下文档页面已随本版本更新:
- SearchField — 新组件文档:用法示例与 API 参考
- ListGroup — 新组件文档:用法示例与 API 参考
- Slider — 新组件文档:用法示例与 API 参考
- Select — 多选模式、触发器 className 修复与受控状态改进
- Button — 更新反馈 API 文档:
feedbackVariant与animation - Avatar — 修复
asChild图片属性展开说明 - PressableFeedback — 新增
PressableFeedback.Scale子组件文档
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Rc 3 (`apps/docs/content/docs/cn/native/releases/rc-3.mdx`)
title: RC 3 github: pull: 309
2026 年 2 月 26 日
RC 3 带来三个新组件:用于可选标签管理的 TagGroup、基于 Popover/Bottom Sheet 的下拉菜单 Menu,以及带自动测量前后缀槽位的装饰性输入 InputGroup。本版本还为所有基于 Bottom Sheet 的遮罩增加 Android 实体返回键支持;通过关键的 combineStyles 修复保留 Reanimated 动画样式绑定,实现 Expo 55 兼容;并包含若干依赖升级。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过预览应用在真机上体验 RC 3 的全部改进!你可以探索 TagGroup、Menu、InputGroup,以及 Bottom Sheet 的 Android 返回键支持与各项修复。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
新组件
本版本新增 3 个组件:
- TagGroup:用于展示与管理可选标签的复合组件,支持可选移除、单选/多选及表单字段集成。
- Menu:下拉菜单系统,支持 Popover 与 Bottom Sheet 呈现、单选/多选、菜单项变体与按压动画反馈。
- InputGroup:装饰性文本输入,前后缀槽位绝对定位并自动测量宽度,为输入区应用匹配内边距。
TagGroup
TagGroup 以复合组件模式渲染可选标签组,并支持可选移除。支持单选与多选、受控/非受控 API、两种视觉变体(default 与 surface)、三种尺寸、禁用态,以及与 Label、Description、FieldError 的完整表单集成。
特性:
- 复合子组件:
TagGroup.List、TagGroup.Item、TagGroup.ItemLabel、TagGroup.ItemRemoveButton - 单选/多选模式,受控/非受控 API
- 两种视觉变体:
default与surface - 三种尺寸:
sm、md、lg - 单项禁用与
disabledKeys - 通过
onRemove与TagGroup.ItemRemoveButton实现移除 TagGroup.List上renderEmptyState渲染空状态- 与 Label、Description、FieldError、
isInvalid、isRequired的表单集成 useTagGroup与useTagGroupItem供高级用法
用法:
import { TagGroup } from "heroui-native";
export function BasicTagGroup() {
return (
<TagGroup>
<TagGroup.List>
<TagGroup.Item id="react">
<TagGroup.ItemLabel>React</TagGroup.ItemLabel>
</TagGroup.Item>
<TagGroup.Item id="vue">
<TagGroup.ItemLabel>Vue</TagGroup.ItemLabel>
</TagGroup.Item>
<TagGroup.Item id="svelte">
<TagGroup.ItemLabel>Svelte</TagGroup.ItemLabel>
</TagGroup.Item>
</TagGroup.List>
</TagGroup>
);
}
export function RemovableTagGroup() {
const [items, setItems] = useState(["React", "Vue", "Svelte"]);
return (
<TagGroup onRemove={(keys) => setItems((prev) => prev.filter((i) => !keys.has(i)))}>
<TagGroup.List>
{items.map((item) => (
<TagGroup.Item key={item} id={item}>
<TagGroup.ItemLabel>{item}</TagGroup.ItemLabel>
<TagGroup.ItemRemoveButton />
</TagGroup.Item>
))}
</TagGroup.List>
</TagGroup>
);
}完整文档与示例见 TagGroup 组件页。
相关 PR: #309
Menu
Menu 提供基于复合组件的下拉菜单,支持 Popover 与 Bottom Sheet 两种呈现。包含基于 Reanimated 的按压动画、单选/多选、菜单项变体(default 与 danger)、指示器样式及可配置 placement。
特性:
- 复合子组件:
Menu.Trigger、Menu.Portal、Menu.Overlay、Menu.Content、Menu.Label、Menu.Group、Menu.Item、Menu.ItemTitle、Menu.ItemDescription、Menu.ItemIndicator - 两种呈现:
popover与bottom-sheet,placement 可配置(top、bottom、left、right) Menu.Group上通过selectedKeys/onSelectionChange实现单选/多选- 菜单项按压动画(缩放 + 背景色),Reanimated 实现,可通过
animation自定义 - 菜单项变体:
default与danger - 指示器变体:
checkmark、dot或自定义内容 Menu.Label用于分区标题- 分组级
shouldCloseOnSelect控制
用法:
import { Menu } from "heroui-native";
export function BasicMenu() {
return (
<Menu>
<Menu.Trigger>
<Button>Open Menu</Button>
</Menu.Trigger>
<Menu.Portal>
<Menu.Overlay />
<Menu.Content>
<Menu.Item>
<Menu.ItemTitle>Edit</Menu.ItemTitle>
</Menu.Item>
<Menu.Item>
<Menu.ItemTitle>Duplicate</Menu.ItemTitle>
</Menu.Item>
<Menu.Item variant="danger">
<Menu.ItemTitle>Delete</Menu.ItemTitle>
</Menu.Item>
</Menu.Content>
</Menu.Portal>
</Menu>
);
}
export function MenuWithSections() {
return (
<Menu>
<Menu.Trigger>
<Button>Actions</Button>
</Menu.Trigger>
<Menu.Portal>
<Menu.Overlay />
<Menu.Content>
<Menu.Group selectionMode="single" selectedKeys={selected} onSelectionChange={setSelected}>
<Menu.Label>View</Menu.Label>
<Menu.Item id="list">
<Menu.ItemTitle>List View</Menu.ItemTitle>
<Menu.ItemIndicator />
</Menu.Item>
<Menu.Item id="grid">
<Menu.ItemTitle>Grid View</Menu.ItemTitle>
<Menu.ItemIndicator />
</Menu.Item>
</Menu.Group>
</Menu.Content>
</Menu.Portal>
</Menu>
);
}完整文档与示例见 Menu 组件页。
相关 PR: #312
InputGroup
InputGroup 提供装饰性文本输入,Prefix 与 Suffix 子组件绝对定位,通过 onLayout 自动测量宽度并为 Input 应用匹配的水平内边距。isDecorative 布尔值可一次性处理装饰性附加内容的无障碍与指针事件样板;根级 isDisabled 通过上下文级联到所有子节点。
特性:
- 复合子组件:
InputGroup.Prefix、InputGroup.Suffix、InputGroup.Input - 自动内边距:通过
onLayout测量 Prefix/Suffix 宽度,自动作为 Input 的paddingLeft/paddingRight - Prefix/Suffix 上
isDecorative统一设置pointerEvents="none"、accessibilityElementsHidden与importantForAccessibility - 根级
isDisabled通过上下文级联(Prefix/Suffix 透明度与 pointer-events、Input 可编辑性) InputGroup.Input为直接透传——由使用方在 Input 上管理value/onChangeText
用法:
import { InputGroup } from "heroui-native";
export function SearchInput() {
return (
<InputGroup>
<InputGroup.Prefix isDecorative>
<SearchIcon />
</InputGroup.Prefix>
<InputGroup.Input placeholder="Search..." />
<InputGroup.Suffix isDecorative>
<ChevronIcon />
</InputGroup.Suffix>
</InputGroup>
);
}
export function DisabledInput() {
return (
<InputGroup isDisabled>
<InputGroup.Prefix isDecorative>
<LockIcon />
</InputGroup.Prefix>
<InputGroup.Input placeholder="Disabled input" />
</InputGroup>
);
}完整文档与示例见 InputGroup 组件页。
相关 PR: #313
组件改进
Bottom Sheet Android 返回键支持
Bottom Sheet 共享容器现处理 Android 实体返回键:按下时关闭当前打开的 Bottom Sheet。BackHandler 仅在 Bottom Sheet 打开时注册,避免已关闭实例抢占事件。该修复全局作用于所有基于 Bottom Sheet 的组件。
涉及组件:
实现使用 React Native 的 BackHandler API,在 iOS 上为空操作,无需分平台分支。
相关 PR: #308
Slot 的 `combineStyles` 修复
Slot 原语的 combineStyles 现返回样式数组,而不再使用 StyleSheet.flatten——后者会通过深拷贝样式对象破坏 Reanimated 的 SharedValue 与 useAnimatedStyle 绑定。
改进:
combineStyles通过返回数组保留 Reanimated 动画样式绑定- React Native 原生支持嵌套样式数组,对使用方行为无影响
- 修复通过 Slot 原语组合的组件上的动画断裂问题
相关 PR: #314
依赖
Expo 55 兼容
依赖版本已更新以兼容 Expo SDK 55:
uniwind:1.2.7 → 1.3.2@gorhom/bottom-sheet:^5 → ^5.2.8
上述 combineStyles 修复是支持 Expo 55 的主要代码变更:此前 StyleSheet.flatten 会在新 SDK 下破坏 Reanimated 样式绑定。
相关 PR: #314
问题修复
本版本包含以下修复:
Issue #272:解决
FullWindowOverlay干扰 React Native 元素检查器的问题。Issue #280:修复 Expo 55 下 Avatar 等依赖 Reanimated 的组件失效。
combineStyles曾通过StyleSheet.flatten破坏动画绑定;现改为返回样式数组以保留SharedValue与useAnimatedStyle。
相关 PR:
文档更新
以下文档页面已随本版本更新:
- TagGroup — 新组件文档:用法示例与 API 参考
- Menu — 新组件文档:用法示例与 API 参考
- InputGroup — 新组件文档:用法示例与 API 参考
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases Rc 4 (`apps/docs/content/docs/cn/native/releases/rc-4.mdx`)
title: RC 4 github: pull: 331
2026 年 3 月 6 日
RC 4 引入用于嵌套可展开菜单的 SubMenu 复合组件,配套弹簧动画展开/收起;重构 Slider Output,采用基于插槽的样式并支持 textProps 透传;为 Menu.Group 增加 disallowEmptySelection,实现类单选框行为。本版本还通过双层缓冲修复快速连按时 PressableFeedback 水波纹闪烁,并修复 Bottom Sheet 在 Android 上未尊重 enablePanDownToClose 的返回键处理。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过预览应用在真机上体验 RC 4 的全部改进!你可以探索全新的 SubMenu 组件、改进后的 Slider Output,以及各项修复。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
SubMenu 组件
Menu 现通过新的 SubMenu 复合组件支持嵌套可展开子菜单。SubMenu 嵌套在 Menu.Content 内,按压后以弹簧动画展开/收起额外项,并带动指示器旋转。
特性:
- 复合子组件:
SubMenu、SubMenu.Trigger、SubMenu.TriggerIndicator、SubMenu.Content - 弹簧动画展开/收起与指示器旋转
- 无头原语层:上下文、受控/非受控打开状态,以及无障碍属性(
role、aria-expanded、aria-disabled) - 父级菜单协同:打开 SubMenu 时 popover 缩至 0.98、移除阴影,非 SubMenu 项淡出至 40% 不透明度并
pointer-events-none - 打开 SubMenu 时菜单内容切换为
FadeOut退出动画,避免与缩放动画冲突 useSubMenu钩子供高级场景使用
用法:
import { Menu, SubMenu } from "heroui-native";
export function MenuWithSubMenu() {
return (
<Menu>
<Menu.Trigger>
<Button>Open Menu</Button>
</Menu.Trigger>
<Menu.Portal>
<Menu.Overlay />
<Menu.Content>
<Menu.Item>
<Menu.ItemTitle>Edit</Menu.ItemTitle>
</Menu.Item>
<SubMenu>
<SubMenu.Trigger>
<Menu.ItemTitle>More Options</Menu.ItemTitle>
<SubMenu.TriggerIndicator />
</SubMenu.Trigger>
<SubMenu.Content>
<Menu.Item>
<Menu.ItemTitle>Import</Menu.ItemTitle>
</Menu.Item>
<Menu.Item>
<Menu.ItemTitle>Export</Menu.ItemTitle>
</Menu.Item>
</SubMenu.Content>
</SubMenu>
</Menu.Content>
</Menu.Portal>
</Menu>
);
}完整文档与示例见 Menu 组件页。
相关 PR: #331
组件改进
Slider Output 组合重构
Slider 的 Output 已重构为基于插槽的架构,包含 container 与 text 插槽,并新增 textProps 用于向内层文本元素透传属性。
改进:
- 基于插槽的样式:将
output类拆为container与text,新增classNames(classNames={{ container, text }})以便精细覆盖样式 - 组合修复:仅在默认内容时渲染
HeroText;自定义子节点直接渲染,无额外文本包装 Slider.Output新增textProps,可向内部文本传递任意属性(如maxFontSizeMultiplier)- 从样式模块导出
OutputSlots类型供外部使用
相关 PR: #328
Menu.Group 的 `disallowEmptySelection`
Menu 的 Menu.Group 现支持 disallowEmptySelection,在 single 选择模式下禁止取消最后一项选中,实现类单选框行为。
用法:
<Menu.Group
selectionMode="single"
selectedKeys={selected}
onSelectionChange={setSelected}
disallowEmptySelection
>
<Menu.Item id="list">
<Menu.ItemTitle>List View</Menu.ItemTitle>
<Menu.ItemIndicator />
</Menu.Item>
<Menu.Item id="grid">
<Menu.ItemTitle>Grid View</Menu.ItemTitle>
<Menu.ItemIndicator />
</Menu.Item>
</Menu.Group>相关 PR: #331
Bottom Sheet 与 `enablePanDownToClose` 一致
Bottom Sheet 现会在 Android 硬件返回键行为上正确尊重 enablePanDownToClose。此前即使 enablePanDownToClose 为 false,返回键仍会关闭 Bottom Sheet。
改进:
enablePanDownToClose透传至BottomSheetContentContainer(默认true)- 仅在
isOpen与enablePanDownToClose均为true时注册BackHandler监听 enablePanDownToClose={false}时不再可通过 Android 返回键关闭
相关 PR: #327
⚠️ 破坏性变更
Chip 组件尺寸
Chip 的尺寸变体已由固定高度改为基于内边距,以在较大无障碍字号下适配动态文字缩放。
迁移:
若自定义样式依赖此前的 h-5/h-6/h-7 高度,请改为新的内边距方案:
// 之前 — 固定高度
// Chip 使用 h-5(sm)、h-6(md)、h-7(lg)
// 之后 — 基于内边距
// Chip 使用 py-0.5(sm)、py-[3px](md)、py-1(lg)
// 圆角更新:rounded-xl → rounded-2xl / rounded-3xl文档更新
以下文档页面已随本版本更新:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 0 (`apps/docs/content/docs/cn/native/releases/v1-0-0.mdx`)
title: v1.0.0 github: pull: 347
2026 年 3 月 19 日
🎉 HeroUI Native 正式发布 v1.0.0——这是首个稳定版本,标志着库已从 beta 与候选发布阶段毕业,成为可用于生产环境的 React Native 应用基础。伴随这一里程碑,本版本还包含全新的 LinkButton 组件、子菜单冲突处理、可选的 @gorhom/bottom-sheet 对等依赖,以及针对 useThemeColor 的更强类型安全。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过我们的预览应用,在真机上体验 v1.0.0 的全部改进!你可以探索全新的 LinkButton 组件、改进后的子菜单行为,以及各项修复。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
更新亮点
LinkButton 组件
全新的 LinkButton 复合组件会渲染 ghost 变体按钮,且无高亮反馈,适用于「服务条款」「隐私政策」等行内链接式交互。它完全复用现有 Button 基础设施,并在内部强制 ghost 变体且关闭高亮反馈。
特性:
- 复合子组件:
LinkButton.Label,用于样式化文本内容 - 内部强制 ghost 变体——不对外暴露
variant属性 - 通过
resolveAnimationObject默认关闭高亮反馈 h-auto p-0基础类移除默认按钮高度与内边距,便于行内使用- 合并使用方动画配置时仍保持
highlight: false
用法:
import { LinkButton } from "heroui-native";
export function TermsLink() {
return (
<LinkButton onPress={() => openURL("https://example.com/terms")}>
<LinkButton.Label>Terms of Service</LinkButton.Label>
</LinkButton>
);
}相关 PR: #341
组件改进
子菜单单开约束与点击背景关闭
Menu 子菜单系统已重构为按 ID 跟踪当前子菜单,而非简单布尔值,从而在同级子菜单之间强制「同时仅开一个」。子菜单打开时,会在菜单内容区域上方渲染可点击的背景层,用户点击外部即可关闭。
改进:
openSubMenuId取代布尔标记——同一时间只能有一个子菜单处于打开状态;打开新的会自动关闭上一个- 子菜单打开时,在菜单内容上渲染
Pressable遮罩,支持点击关闭 - 非当前打开的子菜单触发器通过新的
isOtherSubMenuOpen样式变体获得opacity-40与pointer-events-none - 打开的子菜单内容使用
z-50,关闭的为z-40,避免层叠问题 - 演示应用新增「两个子菜单」示例,展示同一菜单中的多个子菜单
相关 PR: #343
Button Label 的 ref 类型修复
ButtonLabel 的 ref 类型已从 View 更正为 TextRef,并从 button.tsx 中移除了未使用的 View 导入,使 ref 类型与实际渲染元素一致。
相关 PR: #341
API 增强
用于 `useThemeColor` 的 `ThemeColorValue` 品牌类型
useThemeColor 在单次取色调用时现返回 ThemeColorValue 品牌类型,误用数组解构时 IDE 会立即将类型标为 never。非空断言运算符(!)也已替换为安全的空值合并回退。
新行为:
import { useThemeColor } from "heroui-native";
// 正确 — 直接赋值
const mutedColor = useThemeColor("muted");
// 错误 — IDE 会立即标出 `never` 类型
const [color] = useThemeColor("muted"); // color: neverThemeColorValue 继承自 string,因此凡可接受 string 处均可赋值。现有调用点在运行时不受影响。_colorValueBrand 符号以 declare const 声明,无运行时体积。
相关 PR: #337
公开钩子 `useBottomSheetAwareHandlers`
useBottomSheetAwareHandlers 现已作为公开 API 导出,便于在 Bottom Sheet 内显式控制键盘避让与 Input、InputOTP 的衔接。此前在 Input 与 InputOTP 上可用的隐式 isBottomSheetAware 属性已被取代。
用法:
import { useBottomSheetAwareHandlers, Input } from "heroui-native";
export function BottomSheetInput() {
const { onFocus, onBlur } = useBottomSheetAwareHandlers();
return <Input onFocus={onFocus} onBlur={onBlur} placeholder="Type here..." />;
}相关 PR: #347
⚠️ 破坏性变更
Bottom Sheet 内的 `Input` 与 `InputOTP`
已从 Input 与 InputOTP 移除 isBottomSheetAware 属性。此前 Bottom Sheet 内的键盘避让在底层自动处理;现在必须显式使用 useBottomSheetAwareHandlers 并自行传入处理器。这样可减轻 Input 组件负担,去掉隐式 @gorhom/bottom-sheet 导入,使该包对不使用 Bottom Sheet 的项目成为可选对等依赖。
迁移:
// 之前
<Input isBottomSheetAware placeholder="Type here..." />
// 之后
import { useBottomSheetAwareHandlers } from "heroui-native";
const { onFocus, onBlur } = useBottomSheetAwareHandlers();
<Input onFocus={onFocus} onBlur={onBlur} placeholder="Type here..." />凡在 BottomSheet 内渲染的 Input 或 InputOTP 均需按此调整;在 Bottom Sheet 外使用的组件不受影响。
相关 PR: #347
问题修复
本版本包含以下修复:
Issue #330:修复
Input在模块顶层无条件导入@gorhom/bottom-sheet的问题,即使isBottomSheetAware为false。现通过可选的try/catch包装懒加载该包,不使用 Bottom Sheet 的项目无需再安装它。Issue #340:修复子菜单内容出现在同级子菜单触发器后方的问题。子菜单系统现按 ID 跟踪活动子菜单、强制单开,并应用正确的 z-index 分层(打开
z-50,关闭z-40)。
相关 PR:
文档更新
以下文档页面已随本版本更新:
- LinkButton — LinkButton 复合组件文档:结构分解、用法示例与 API 参考
- Menu — 更新子菜单文档:单开约束与点击背景关闭行为
- Input — 更新 Bottom Sheet 用法示例,采用
useBottomSheetAwareHandlers模式 - InputOTP — 同上,Bottom Sheet 示例采用
useBottomSheetAwareHandlers
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 1 (`apps/docs/content/docs/cn/native/releases/v1-0-1.mdx`)
title: v1.0.1 github: pull: 360
2026 年 4 月 1 日
HeroUI Native v1.0.1 是一次侧重可靠性与开发者体验的补丁版本。它修复了 Toast 提供程序中导致动画值过期的竞态条件,将七个组件的禁用态样式改为使用原生 disabled: 修饰符,并为主题系统新增 --backdrop 变量,供遮罩类组件使用。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过预览应用在真机上体验 v1.0.1 的全部改进!你可以查看 Toast 修复、改进后的禁用态样式以及新的背景层变量。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
API 增强
`--backdrop` 主题变量
主题系统新增顶层样式变量 --backdrop,为 Dialog、Bottom Sheet 等遮罩组件背后的变暗层提供专用色令牌。默认值为 oklch(0% 0 0 / 20%),呈现轻微但可见的背景变暗效果。
新能力:
import { Dialog } from "heroui-native";
// Dialog 与 Bottom Sheet 遮罩现自动使用 bg-backdrop
<Dialog>
<Dialog.Content>
{/* 内容绘制在主题化背景层之上 */}
</Dialog.Content>
</Dialog>--backdrop 已纳入所有内置主题的浅色与深色模式,对应的 Tailwind 工具类 bg-backdrop 也可用于自定义组件样式。
相关 PR: #366
样式修复
禁用态修饰符
七个组件的禁用态样式已改为使用 disabled: 前缀修饰符,而非无条件应用样式。这样可确保 opacity-disabled、pointer-events-none 等仅在组件真实处于禁用态时生效,并尊重来自 Uniwind 的原生 disabled 修饰符。
涉及组件:
所有 isDisabled 变体类现均使用 disabled: 前缀(例如 disabled:opacity-disabled disabled:pointer-events-none),正确限定在禁用伪状态,并在禁用态动态切换时消除样式冲突。
相关 PR: #361
问题修复
本版本包含以下修复:
Issue #359:修复 Toast 提供程序中
totalSharedValue 与实际 Toast 数量可能不同步的竞态。原先手动增减在hide与show同一帧执行、或自动消失与手动隐藏竞速时,易出现闭包陈旧导致不一致。total现通过useEffect由toasts.length派生,使透明度、缩放、translateY 等插值始终反映真实数量。Issue #356:修复在
isDisabled为 true 时禁用样式被无条件应用、阻碍开发者主题化或自定义禁用外观的问题。上述七个组件均已改为disabled:前缀,将样式正确限定在禁用伪状态。
相关 PR:
文档更新
以下文档页面已随本版本更新:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 10 (`apps/docs/content/docs/cn/native/releases/v1-0-10.mdx`)
title: v1.0.10 Input 与 TextArea 的 ref 解析为原生 TextInput 实例,BottomSheet 在 Android 手柄外露与容器尺寸变化时保持隐藏,Skeleton 的 variant="none" 跳过默认进入/退出动画,Menu、Popover 与 Select 在窗口尺寸变化时刷新锚点 github: pull: 499
2026 年 9 月 21 日
HeroUI Native v1.0.10 将 Input、TextArea、SearchField 与 InputGroup 的 ref 类型改为原生 TextInput 实例,以适配 React Native 的 Strict TypeScript API;修复了 Android 上 BottomSheet 的两个显示问题;让 Skeleton 的 variant="none" 跳过默认布局动画;并在应用窗口尺寸变化时刷新 Menu、Popover 与 Select 的锚点位置。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
问题修复
本版本包含以下问题的修复:
- Issue #485:已关闭的底部弹层在容器尺寸变化(设备旋转或 iPad 分屏)时可能闪现,原因是它仍以过期的关闭位移保持挂载。关闭状态的弹层现在会与新的容器尺寸对齐,并在再次打开前不参与绘制。
- Android 上的 BottomSheet:在全面屏(edge-to-edge)设备上,关闭状态的弹层手柄可能露出底部边缘,因为 Gorhom 停靠在
window.height,该值小于实际测量的容器高度。现在会在首次布局时修正关闭位置,并在isOpen仍为false时忽略 Gorhom 自身的展开动画。 - Issue #490(iOS):在 iOS 上,点击居中且限制了宽度的 Dialog 与 Select 面板两侧的空白区域时,事件会被内部的动画包装层拦截。外层包装现在使用
pointerEvents="box-none",使点击能够传递到遮罩的关闭处理逻辑。#490 的 Android 部分仍未解决。 - Issue #497:Input、TextArea、SearchField 与 InputGroup 此前以
typeof TextInput转发 ref,在 React Native 的 Strict TypeScript API(0.87+)下会报错。ref 现在通过React.ComponentRef解析,并新增导出InputRef与TextAreaRef类型。 - Issue #489:已打开的 Menu、Popover 或 Select 在 iPad 旋转或应用窗口尺寸变化后可能与触发器脱离。共享的定位 hook 现在使用
useWindowDimensions,并在宽高变化时重新测量触发器 ref。 - Switch 现在会保留使用者传入的
aria-valuetext,不再因运算符优先级问题被默认的'on'/'off'静默覆盖。 - Select 触发器的
selectClassNames.trigger()现在无需显式传入variant即可应用文档中记录的'default'变体样式,与组件自身解构的默认值保持一致。 - Input 样式修复:将
ios:outline-2改为ios:outline,消除 iOS 上多余的轮廓宽度。
相关 PR:
组件改进
- Skeleton 的
variant="none"现在会跳过默认的FadeIn/FadeOut布局动画,除非显式设置了animation.entering或animation.exiting。这让静态占位骨架在列表中挂载与复用的成本更低。(#495)
依赖
- Uniwind 固定为
1.12.0(此前为^1.10.0),以解决 Android 上全面屏布局的测量问题。(#498)
更新的文档
以下文档页面已更新,以反映本版本的变更:
- CloseButton - 将图标默认尺寸从
20更正为18 - Menu - 将 SubMenu 指示图标的默认尺寸从
14更正为16 - Skeleton - 说明
variant="none"会跳过默认的进入/退出动画 - GlassView(仅仓库内文档) - 将默认模糊
intensity从30更正为25
相关 PR:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 11 (`apps/docs/content/docs/cn/native/releases/v1-0-11.mdx`)
title: v1.0.11 组件 CSS 迁移至 components 层叠层,支持 Expo SDK 58 与 React Native 0.88,对等依赖兼容 Gesture Handler 3,Slider 消除浮点精度误差,ScrollShadow 在启用「减弱动态效果」时仍随滚动变化,并修复 BottomSheet 受控模式下重新打开的显示问题
2026 年 10 月 20 日
HeroUI Native v1.0.11 将组件 CSS 包裹在 Tailwind 的 components 层叠层中,使用户的工具类可以覆盖组件默认样式;新增 Expo SDK 58 / React Native 0.88 / Gesture Handler 3 支持;修复 Slider 使用小数步长时的浮点精度误差;让 ScrollShadow 在启用「减弱动态效果」时仍随滚动位置变化;并解决了 Android 上的多个浮层与输入组件问题。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
⚠️ 破坏性变更
要求使用 Uniwind 1.13.0
组件 CSS 现在包裹在 @layer components 中,需要 Uniwind 1.13.0 才能正确应用层叠层。使用旧版 Uniwind 的应用可能会遇到组件样式优先级不正确的问题。
变更前:
"uniwind": "1.12.x"变更后:
"uniwind": "1.13.0"迁移方式: 将项目中的 Uniwind 升级至 1.13.0。这是此项变更唯一需要执行的操作,组件样式本身保持不变。
相关 PR: #529
自定义颜色需要 `:root` 包裹
@layer theme 中的自定义颜色覆盖现在必须嵌套在 :root 内,Tailwind CSS v4 才能正确识别。已有未使用 :root 包裹的覆盖规则可能会静默失效。
变更前:
@layer theme {
@variant light {
--accent: oklch(0.65 0.25 270);
}
}变更后:
@layer theme {
:root {
@variant light {
--accent: oklch(0.65 0.25 270);
}
}
}迁移方式: 在 @layer theme 内,使用 :root 包裹 @variant light 和 @variant dark 代码块。参见更新后的颜色文档。
相关 PR: #503
新增功能
支持 Expo SDK 58 与 React Native 0.88
组件库现在支持 Expo SDK 58、React Native 0.88、React 19.3 与 Reanimated 4.7。组件 ref 使用兼容 React Native Strict TypeScript API 的 ComponentRef 接口。react-native-gesture-handler 的对等依赖范围已放宽,同时接受 v2(^2.28.0)与 v3(^3.0.0),因此使用 Gesture Handler 2 的现有应用无需升级。(#528)
组件 CSS 迁移至 `components` 层
所有组件样式现在都位于 Tailwind 的 @layer components 中,HeroText 的默认字体也迁移至 @layer base 中的类。这意味着用户的工具类(例如 font-medium、颜色覆盖)现在可以正确覆盖组件默认样式,与 Tailwind 的标准层叠顺序一致。(#529)
问题修复
本版本包含以下问题的修复:
- Issue #525:Slider 使用小数步长(例如
step={0.1})时会产生0.30000000000000004之类的浮点精度误差。snapToStep工具函数现在会根据step和minValue的精度进行舍入,使onChange与Slider.Output接收到0.3这样的准确值。(#526) - Issue #521:启用「减弱动态效果」(iOS)或设置
animation="disable-all"时,ScrollShadow 的两侧阴影会始终显示。阴影现在始终通过interpolate随滚动位置变化,禁用动画的状态仅影响退出过渡。(#522) - Issue #509:受控 BottomSheet 重新打开后,可能因
isDismissed仍为true而以opacity: 0渲染。关闭后的容器样式现在仅在底部弹层也处于关闭状态(!isOpen)时应用。(#511) - Issue #488:Input 的 primary 变体在 Android 上未显示投影。Android 现在使用
elevation: 1替代shadow-sm,恢复预期的阴影效果。(#515) - Issue #520:Popover、Menu 或 Select 内容中的
ScrollView在 Android 上无法滚动,因为动画包装层没有尺寸。包装层现在使用absoluteFill与pointerEvents="box-none",使 Android 能将原生触摸事件分发给可滚动内容。后续提交还为contentWrapper样式添加了transformOrigin: 'top',使自定义关键帧动画以正确的原点变换。(#530) - Issue #497:在 React Native 0.87+ 上,已发布的 1.0.10 类型声明中的 Input、TextArea、SearchField 与 InputGroup ref 仍无法通过类型检查。共享的
TextInputComponent类型现在会在这四个组件中保留原生 ref 别名。(#504) - InputGroup 在禁用的
TextField内未继承禁用状态。未显式传入属性时,根组件现在会从外层表单字段上下文读取isDisabled。(#508) - Issue #502:自定义颜色的文档示例在
@layer theme内缺少必需的:root包裹,可能导致覆盖规则不生效。(#503)
相关 PR:
依赖
- Uniwind 升级至
1.13.0(此前为1.12.0)。此版本新增层叠层支持,是@layer components变更的必要依赖。同时移除了 Uniwind 1.12.2 的 Yarn 补丁。(#529) - react-native-gesture-handler 对等依赖现在接受
^2.28.0 || ^3.0.0(此前为^2.28.0)。(#528)
更新的文档
以下文档页面已更新,以反映本版本的变更:
- 颜色 — 自定义颜色示例现在包含必需的
:root包裹 - 快速开始 —
react-native-gesture-handler的对等依赖更新为^2.28.0 || ^3.0.0 - Slider — 修复:小数步长的值不再出现浮点精度误差
- ScrollShadow — 修复:启用「减弱动态效果」时阴影仍随滚动变化
- BottomSheet — 修复:受控模式下重新打开时内容不可见的问题
- Input — 修复:恢复 Android 阴影,并保留 ref 类型
- InputGroup — 修复:继承父级 TextField 的禁用状态
- Popover — 修复:Android 上内容区域的原生滚动
- Menu — 修复:Android 上内容区域的原生滚动
- Select — 修复:Android 上内容区域的原生滚动
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 2 (`apps/docs/content/docs/cn/native/releases/v1-0-2.mdx`)
title: v1.0.2 github: pull: 380
2026 年 4 月 15 日
HeroUI Native v1.0.2 为 PressableFeedback 与 Surface 引入 asChild 插槽模式,为所有基于 Portal 的遮罩组件增加 VoiceOver 模态包容支持,并修复 Android 上 Button 某变体的样式问题。本版本还微调了 Input 与 Select 的视觉效果,并在 RadioGroup 文档中内嵌 API 参考表。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native抢先体验
通过预览应用在真机上体验 v1.0.2 的全部改进!你可以探索新的 asChild 插槽模式、Portal 无障碍改进、Android 上更可靠的 Button 行为,以及优化后的 Input 与 Select 样式。
环境要求
请确保手机已安装最新版本的 Expo Go。
如何访问
方式一:扫描二维码
使用手机相机或 Expo Go 应用扫描:
Android 用户请注意: 若使用系统相机或其他扫码应用会跳转到浏览器并出现 404,请先打开 Expo Go,使用其内置扫码功能扫描。
方式二:点击链接
若设备已安装 Expo Go,将自动在其中打开应用。
API 增强
PressableFeedback 与 Surface 的 `asChild` 插槽模式
PressableFeedback 与 Surface 现支持 asChild 属性,采用 Slot 模式实现多态渲染。当 asChild 为 true 时,组件会把自身行为与样式合并到单个子元素上,而不再额外包一层节点。
PressableFeedback 使用 Animated.createAnimatedComponent(Slot.Pressable),将按压处理与动画样式合并到子元素。Surface 使用 Slot.View,将表面样式(海拔、背景、className)合并到子元素。
新能力:
import { PressableFeedback, Surface } from "heroui-native";
// PressableFeedback 将按压处理合并到子元素
<PressableFeedback asChild onPress={() => console.log("pressed")}>
<MyCustomComponent />
</PressableFeedback>
// Surface 将表面样式合并到子元素
<Surface asChild elevation={2}>
<MyCustomCard />
</Surface>asChild 默认为 false,保持既有行为,无需迁移。启用 asChild 时子节点须为单个 React 元素。两处实现均遵循代码库中已有的 Slot 原语模式。
相关 PR: #380
Portal 组件的 `unstable_accessibilityContainerViewIsModal`
所有基于 Portal 的遮罩组件新增 unstable_accessibilityContainerViewIsModal 属性,用于控制 iOS VoiceOver 是否将遮罩窗口视为模态容器。启用后,VoiceOver 焦点限制在遮罩内,无法导航到背后内容。
支持的组件:
- BottomSheet(
BottomSheet.Portal) - Dialog(
Dialog.Portal) - Menu(
Menu.Portal) - Popover(
Popover.Portal) - Select(
Select.Portal) - Toast(
ToastProvider)
新能力:
import { Dialog } from "heroui-native";
<Dialog>
<Dialog.Portal unstable_accessibilityContainerViewIsModal>
<Dialog.Content>
{/* 在 iOS 上 VoiceOver 焦点限制在此遮罩内 */}
</Dialog.Content>
</Dialog.Portal>
</Dialog>该属性默认为 false,保持既有行为。标记为 unstable 是因为它直接映射到 react-native-screens 中 FullWindowOverlay 的原生 accessibilityViewIsModal,未来可能随该库版本变化。
相关 PR: #383
样式修复
Input 与 Select 视觉微调
优化了 Input 与 Select 的视觉样式,使外观更干净、比例更协调。
调整:
- Input:边框宽度由
border-2(2px)改为border-[1.5px],边框更轻、不抢眼 - Select:触发器垂直内边距由
py-3.5改为py-3,布局更紧凑
以上均为纯视觉调整,无 API 或行为变更。建议在 iOS 与 Android 上做视觉回归确认。
相关 PR: #381
问题修复
本版本包含以下修复:
Issue #363:修复 Android 上 Button 的 outline 变体在通过条件属性切换到其他变体时边框仍残留的问题。Android 上的 React Native 在变体切换时有时会保留
borderWidth。除outline外的所有按钮变体现均包含显式border-0类,确保变体切换时将borderWidth重置为0。Issue #357:响应在 Card 上支持
asChild以实现可按压卡片模式的诉求。PressableFeedback 与 Surface 上的新asChild插槽模式,使开发者可将按压与表面样式合并到单个子元素,无需额外包装节点。
相关 PR:
文档
RadioGroup 内联 API 参考
RadioGroup 文档现于页面内嵌 Radio、Radio.Indicator、Radio.IndicatorThumb 的完整 API 表,读者无需再跳转到单独的 Radio 文档即可了解在 RadioGroup.Item 中组合时的可用属性。
改进:
Radio、Radio.Indicator、Radio.IndicatorThumb的完整属性表内嵌展示- 补充
RadioRenderProps、RadioRootAnimation、RadioIndicatorThumbAnimation类型说明 - 将外链式 Markdown 链接统一为内联代码格式以保持一致性
相关 PR: #384
文档更新
以下文档页面已随本版本更新:
- RadioGroup — 内联 API 表:
Radio、Radio.Indicator、Radio.IndicatorThumb - PressableFeedback — 补充
asChild属性说明 - Surface — 补充
asChild属性说明 - BottomSheet — 补充
unstable_accessibilityContainerViewIsModal说明 - Dialog — 同上
- Menu — 同上
- Popover — 同上
- Select — 同上
- Toast — 同上
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 3 (`apps/docs/content/docs/cn/native/releases/v1-0-3.mdx`)
title: v1.0.3 全新 Text 排版组件、ScrollShadow 反向列表支持、Tabs RTL 指示器修复、Avatar alt 属性可选化、Select 指示器统一、表单字段样式微调 github: pull: 400
2026 年 5 月 11 日
HeroUI Native v1.0.3 引入全新的 Text 排版基元,提供面向标题、段落与内联代码的复合 API;同时为 ScrollShadow 在反向列表下的渲染、Tabs 指示器在 RTL 布局下的对齐、以及自定义 Select.TriggerIndicator children 时的动画问题带来重要修复。本版本还对 Button、Chip、Input 的视觉样式进行了微调,将 Avatar 的 alt 属性改为可选,并修正 TextField 与 SearchField 的内部内边距行为。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
新增
新组件
本版本新增 1 个 排版组件:
Text
Text 组件是一个排版基元,通过语义化预设渲染样式化文本。它提供 Text.Heading、Text.Paragraph、Text.Code 等子组件构成的复合 API,并在 tailwind-variants 基础上叠加互不耦合的 align、color、weight、truncate 属性,使排版可以组合复用,无需在每个调用点重复定义样式。
特性:
- 语义化
type变体:h1–h6、body、body-sm、body-xs、code Text.Heading自动设置accessibilityRole="header",并将type收窄为标题级别Text.Paragraph将type收窄为正文变体,适合长文本可读性Text.Code渲染为 chip 样式的内联等宽文本,采用平台合适的fontFamily(iOS 为 Menlo,其他平台为monospace)- RTL 感知的
align属性,支持start、center、end、justify(justify 仅 iOS 生效) - 语义化
color预设(default、muted),其他主题色可通过className外挂 weight覆盖:借助tailwind-merge始终优先于type暗含的字重truncate布尔属性:等价于numberOfLines={1};显式numberOfLines始终优先
用法:
import { Text } from "heroui-native";
import { View } from "react-native";
export function Example() {
return (
<View className="flex-1 justify-center px-5 gap-4">
<Text.Heading type="h1">Welcome</Text.Heading>
<Text.Heading type="h3">Getting Started</Text.Heading>
<Text.Paragraph>
This is a body paragraph rendered with the Text component.
</Text.Paragraph>
<Text.Paragraph color="muted" type="body-sm">
Smaller supporting text for captions or footnotes.
</Text.Paragraph>
<Text.Code>npm install heroui-native</Text.Code>
</View>
);
}完整文档与示例见 Text 组件页面。
相关 PR: #400
组件改进
ScrollShadow 反向子列表支持
ScrollShadow 现已正确处理反向的可滚动子组件,如 <FlatList inverted> 或 <FlashList inverted>。
改进点:
ScrollShadowRoot现会读取可滚动子组件上的inverted属性,沿用既有的childHorizontal自动检测模式- 内部交换驱动各视觉边缘的动画样式,使阴影渲染到正确的一侧
- 公共 API 无变化——仅当子组件设置
inverted={true}时启用该修复,此前在此情况下渐变会出现在错误的边缘
此前,包裹反向列表时渐变阴影会渲染在顶部,而可滚动内容位于其下;即便仍有更多内容也不会出现底部阴影。修复后,反向 feed、聊天列表等反向滚动表面上的指示器方向已正确。
相关 PR: #398
Tabs RTL 指示器对齐
Tabs 的指示器在 React Native 处于 RTL 模式时定位现已正确。
改进点:
- 通过 tabs 测量上下文跟踪标签条的宽度
- 固定布局使用
Tabs.List的布局宽度 - 滚动布局使用
Tabs.ScrollView的内容宽度 - 仅当
I18nManager.isRTL启用时,对指示器的translateX进行镜像
指示器使用绝对定位 left 锚点配合测量得到的 translateX。在 RTL 模式下,React Native 会自动翻转绝对锚点,但所测量的 transform 仍需手动镜像——本次修复内部完成了这一处理。固定与滚动两类标签列表均已修复,且公共 API 未变。
相关 PR: #396
Select 触发器指示器渲染统一
Select 的 Select.TriggerIndicator 现无论使用默认图标还是自定义 children,都会一致地应用展开/收起的旋转动画。
改进点:
- 自定义
children现可获得与默认图标相同的动画容器样式 - 通过
children ?? <ChevronDownIcon />将ChevronDownIcon作为回退渲染 - 将此前分散的渲染分支合并为统一的渲染路径
此前,向 Select.TriggerIndicator 传入自定义 children 会绕过旋转动画,导致开合时指示器保持静止。统一分支确保旋转动画始终生效,且公共 API 未变。
相关 PR: #409
API 增强
Avatar 的 `alt` 属性变为可选
Avatar 的 alt 属性现已可选,默认为 'Avatar',在保留无障碍支持的同时,减少装饰性或语境明确场景下的样板代码。
新能力:
import { Avatar } from "heroui-native";
<Avatar>
<Avatar.Image source={{ uri: "https://example.com/avatar.jpg" }} />
<Avatar.Fallback>JD</Avatar.Fallback>
</Avatar>;显式传入 alt 的既有代码继续正常工作——该属性仅在缺省时获得一个合理的默认值。RootProps 类型现已反映为 alt?: string,并通过 JSDoc 标注 @default 'Avatar',组件文档同步更新。
相关 PR: #404
样式修复
Button、Chip、Input 样式微调
对 Button、Chip、Input 的尺寸与色彩样式进行了微调,统一改用 Tailwind 工具类与语义化的 soft 颜色令牌。
修复:
- Button:尺寸改用 Tailwind 高度工具类(
h-10、h-12、h-14),不再使用任意像素值;sm高度由 36px 调整为 40px,提升触控目标的人体工学 - Chip:
md/lg的垂直内边距微调(py-[3px]→py-1,py-1→py-1.5),间距更协调 - Chip:soft 变体改用语义化
bg-{color}-soft令牌,取代基于不透明度的bg-{color}/15背景 - Input:由
py-3.5改为min-h-12,无论内容如何字段都保持稳定高度 - Input:primary 变体的边框现正确使用
border-field-border令牌,而非border-field
Button sm 尺寸(+4px)与 Chip md/lg 内边距上的像素级差异建议进行视觉回归确认。无 API 变更——仅更新了 button.styles.ts、chip.styles.ts、input.styles.ts 中的样式令牌。
相关 PR: #406
TextField 与 SearchField 内部内边距修复
TextField 与 SearchField 不再对嵌套的 Label、Description、FieldError 施加额外的水平内边距。
修复:
TextField现在向其FormFieldContext提供hasFieldPadding: falseSearchField现在向其FormFieldContext提供hasFieldPadding: false- 渲染在上述字段内的
Label、Description、FieldError不再继承额外的px-1.5侧边距 - 所有表单字段容器(
ControlField、RadioGroup、TagGroup已采用hasFieldPadding: false)的视觉对齐现已统一
此次变更仅涉及两处为 FormFieldContext 提供值的 useMemo。如果你此前依赖这一非预期的内部内边距,可通过为受影响的子组件添加 className="px-1.5" 恢复原有间距。
相关 PR: #407
问题修复
本版本包含以下修复:
- Issue #334:修复 RTL 布局下
Tabs.Indicator的定位错乱。指示器以绝对定位left锚点配合测量的translateX实现位移;在 RTL 模式下 React Native 会自动翻转锚点,但测量得到的 transform 仍需手动镜像。tabs 测量上下文现会跟踪标签条宽度,仅当I18nManager.isRTL启用时镜像translateX,固定与滚动两类标签列表均已修复。 - Issue #393:修复
ScrollShadow忽略子组件inverted属性的问题。ScrollShadowRoot现会读取可滚动子组件上的inverted(沿用既有的childHorizontal自动检测),并交换驱动各视觉边缘的动画样式,使反向 feed 与聊天式列表上的渐变出现在正确的一侧。
相关 PR:
文档更新
以下文档页面已随本版本更新:
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 4 (`apps/docs/content/docs/cn/native/releases/v1-0-4.mdx`)
title: v1.0.4 Typography 组件替代 Text、调整后的柔和前景色主题令牌与可选鲜亮配色、iOS 原生模态偏移说明、示例应用升级至 Expo 56 / React Native 0.85 github: pull: 420
2026 年 5 月 26 日
HeroUI Native v1.0.4 将排版基元 Text 重命名为 Typography,让出 React Native 自身的 Text 名称,同时更贴近语义化排版用法;既有的 Text 导出保留为弃用别名,可平滑升级。本版本还在 Alert、Avatar、Button、Chip、Toast 中调整了 soft 前景色令牌,使其在 soft 背景上具备更好的对比度;新增可选的 heroui-native/styles/vibrant 配色;为 Menu、Popover、Select 补充 iOS 原生模态偏移的处理说明;并将示例应用升级到 Expo 56 / React Native 0.85。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
新增
Typography 组件(由 `Text` 重命名而来)
库内的排版基元已从 Text 重命名为 Typography,避免与 React Native 内建的 Text 重名,并更准确地体现其作为语义化排版系统的定位。组件的 API、变体与行为保持不变——只是公开名称发生变化。
import { Typography } from "heroui-native";
import { View } from "react-native";
export function Example() {
return (
<View className="flex-1 justify-center px-5 gap-4">
<Typography.Heading type="h1">Welcome</Typography.Heading>
<Typography.Heading type="h3">Getting Started</Typography.Heading>
<Typography.Paragraph>
This is a body paragraph rendered with the Typography component.
</Typography.Paragraph>
<Typography.Paragraph color="muted" type="body-sm">
Smaller supporting text for captions or footnotes.
</Typography.Paragraph>
<Typography.Code>npm install heroui-native</Typography.Code>
</View>
);
}变更要点:
- 主导出改为
Typography,子组件为Typography.Heading、Typography.Paragraph、Typography.Code - 新增
typographyClassNames样式 API 与Typography*类型别名,取代原先的Text*命名 - 既有的
Text、textClassNames与Text*类型作为弃用的重导出保留以兼容旧代码 - 组件目录中的示例页由
text重命名为typography - JSDoc 与组件文档更新为引用 Typography 以及新的文档 URL
相关 PR: #417
鲜亮主题配色(可选)
新增可选的 heroui-native/styles/vibrant 样式表,适合希望在 soft 变体上保持更饱和品牌色的应用。它在保留调整后的柔和前景令牌带来的可读性改进的同时,仍为 soft 背景上的图标与文字保留较高的色彩饱和度。
用法:
// 默认调整后的柔和前景配色
import "heroui-native/styles";
// 或者,启用鲜亮配色
import "heroui-native/styles";
import "heroui-native/styles/vibrant";在引入基础样式之后再引入 heroui-native/styles/vibrant,即可用更饱和的取值覆盖柔和前景令牌。无需修改任何组件代码即可启用。
相关 PR: #420
组件改进
多组件柔和前景色调整
Alert、Avatar、Button、Chip、Toast 现使用新的 *-soft-foreground 主题令牌渲染 soft 背景上的标签与图标,呈现更好的对比度,并在亮色与暗色主题下保持更统一的视觉效果。
改进点:
theme.css中通过color-mix计算柔和前景令牌(accent-soft-foreground、success-soft-foreground、warning-soft-foreground、danger-soft-foreground、default-soft-foreground),提升 soft 背景上的可读性- Alert、Avatar、Button、Chip、Toast 的样式(及其内部 hooks)改为使用新的柔和前景令牌,不再直接使用
text-accent、text-success等原始语义色 - 新增可选的
heroui-native/styles/vibrant导出,为希望保留饱和品牌色的应用保留更鲜亮的 soft 变体外观 - 示例应用中 Alert、Avatar、Button、Chip、Toast 的演示同步更新以匹配新的取色方式
组件属性与公开 API 均无变化——仅 soft 变体的取色发生变化。沿用默认主题的应用将开箱获得 soft 变体上更柔和、可读性更佳的图标与标签颜色。
相关 PR: #420
TextArea 垂直内边距修复
TextArea 现已应用合适的内部垂直内边距,多行内容不再紧贴输入区上边缘。
改进点:
TextArea现使用h-32 py-2,提供一致的内部间距- 无 API 变更——仅为组件内的样式调整
相关 PR: #421
API 增强
`useThemeColor` 令牌更新
useThemeColor hook 新增表面色与柔和色相关令牌,并对遮罩背景令牌进行了重命名以更清晰表达语义。
新能力:
import { useThemeColor } from "heroui-native";
const colors = useThemeColor([
"default-soft",
"default-soft-foreground",
"surface-foreground",
"backdrop",
]);变更:
- 新增
default-soft与default-soft-foreground令牌 - 新增表面前景色令牌(如
surface-foreground),可显式取用表面文字颜色 - 将
overlay-backdrop重命名为backdrop,与底层 CSS 变量命名保持一致
如果你使用了已移除的 useThemeColor 键(on-surface-*)或旧的 overlay-backdrop 键,请改用更新后的令牌名。组件属性与视觉默认值保持不变。
相关 PR: #420
依赖
`@gorhom/bottom-sheet` 对等依赖范围更新
@gorhom/bottom-sheet 的对等依赖范围由 ^5.2.8 升级到 ^5.2.9。如果你的应用使用 HeroUI Native 的 BottomSheet(或 Menu / Popover / Select 配合 presentation="bottom-sheet"),请确保安装兼容版本:
npm i @gorhom/bottom-sheet@^5.2.9这是本版本对消费者唯一的对等依赖变更。库的 react(>=19.0.0)与 react-native(>=0.81.0)对等依赖范围保持不变。
相关 PR: #421
示例应用升级至 Expo 56 / React Native 0.85
仓库内的示例应用升级到了最新的 Expo 与 React Native 工具链。这不会直接影响库的消费者,但为运行示例的贡献者带来收益:
- Expo
56 - React Native
0.85.3 - React
19.2.3 - React Native Reanimated
4.3.1 react-native-worklets0.8.3- Uniwind
^1.6.3
本次升级还包含以下整理:
- 重写
metro.config.js,将对等依赖解析锁定到示例的node_modules,修复当uniwind或react从 workspace 根解析出两份副本时 Hermes 抛出的「Maximum call stack size exceeded」崩溃 - 在 input-otp 与展示页中以
StyleSheet.absoluteFill替换已弃用的StyleSheet.absoluteFillObject - 将
useFocusEffect/useHeaderHeight的导入迁移至expo-router - 移除未使用的
example/src/components/safe-area-view.tsx、eas.json以及陈旧的newArchEnabled/edgeToEdgeEnabled标记 - 示例应用的 slug/bundle 重命名为
heroui-native-oss;调整 Android 上WithStateToggle的内边距
相关 PR: #421
文档
Menu、Popover、Select 的 iOS 原生模态偏移说明
Menu、Popover、Select 文档新增**原生模态(iOS)**章节,解释当触发器位于以原生模态(presentation: "modal" | "formSheet" | "pageSheet")呈现的页面内时,遮罩内容为何会向上偏移渲染,以及如何补偿。
改进点:
- 各组件文档说明了 Fabric /
FullWindowOverlay的坐标不一致:触发器坐标相对于模态原点,而遮罩锚定在窗口 - 文档化了配合
react-native-safe-area-context中useSafeAreaInsets使用的offset={insets.top}推荐方案 - 提供示例应用中相关文件(
popover-native-modal.tsx、select-native-modal.tsx)的链接,便于查阅完整用法
用法示例:
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { Popover } from "heroui-native";
const insets = useSafeAreaInsets();
<Popover.Content presentation="popover" offset={insets.top + 20}>
{/* ... */}
</Popover.Content>;这是纯文档变更,未改动任何 API 或运行时行为。
相关 PR: #419
问题修复
本版本包含以下修复:
- Issue #405:补充了在 React Navigation 原生模态中
Menu渲染错位的处理方案。Menu 文档新增**原生模态(iOS)**章节,解释 Fabric /FullWindowOverlay的坐标不一致,并演示如何用useSafeAreaInsets配合offset={insets.top}补偿。 - Issue #418:修复将示例应用升级到 Expo 56 后出现的 Hermes 崩溃(「Maximum call stack size exceeded」)及
BottomSheet内容不可见的问题。示例的metro.config.js现已将对等依赖解析(react、react-native、uniwind等)锁定到示例的本地node_modules,防止从 workspace 根加载到重复副本。
相关 PR:
弃用
`Text` 排版导出
Text 组件与相关导出现已弃用,推荐使用 Typography。既有导入仍可继续工作,不会产生运行时错误——仅会在 TypeScript / IDE 中提示弃用。请在未来某个大版本移除弃用别名之前完成迁移。
弃用 → 推荐:
// 弃用(仍可用)
import { Text, textClassNames, type TextProps } from "heroui-native";
<Text.Heading type="h1">Welcome</Text.Heading>;
// 推荐
import {
Typography,
typographyClassNames,
type TypographyProps,
} from "heroui-native";
<Typography.Heading type="h1">Welcome</Typography.Heading>;相关 PR: #417
文档更新
以下文档页面已随本版本更新:
- Typography — 组件由 Text 重命名而来;完整 API、Anatomy 与用法已更新
- Menu — 新增**原生模态(iOS)**章节,含
offset={insets.top}方案 - Popover — 新增**原生模态(iOS)**章节,含
offset={insets.top}方案 - Select — 新增**原生模态(iOS)**章节,含
offset={insets.top}方案 - 快速开始 — 可选对等依赖
@gorhom/bottom-sheet更新到^5.2.9
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 5 (`apps/docs/content/docs/cn/native/releases/v1-0-5.mdx`)
title: v1.0.5 拆分 border-field 令牌以修复宽度/颜色合并冲突、Typography 支持 Dynamic Type、Provider 级文本输入配置、单次挂载的弹层动画、Select 图标颜色修复、升级至 Expo 57 / RN 0.86 github: pull: 439
2026 年 7 月 2 日
HeroUI Native v1.0.5 通过将字段边框拆分为独立的宽度与颜色令牌,并全局配置 tailwind-variants,解决了长期存在的 border-field 合并冲突,同时将 Input、InputOTP、Radio、Checkbox 迁移到基于 outline 的聚焦、激活与无效状态。本版本还为 Typography 带来 iOS Dynamic Type 支持,新增 Provider 级的文本输入配置,重构 Popover、Menu、Select 的进入动画以让内容仅挂载一次,将 Select 勾选图标与 accent-soft-foreground 令牌对齐,并将工具链升级至 Expo 57 / React Native 0.86。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
性能
单次挂载的 Popover、Menu、Select 动画
Popover、Menu、Select 的内容现在只挂载一次,并在完成测量与定位后通过共享值播放进入动画。此前,内容子树会被挂载两次——先用一个隐藏探针测量尺寸,再挂载可见节点——以便进入 Keyframe 能在正确位置于挂载时触发。
改进点:
- 默认的进入动画由一个共享值(
rEnteringStyle)驱动,在内容完成定位(isReady)后播放,使子树仅挂载一次 usePopupPopoverContentAnimation现返回isDrivenEntering与rEnteringStyle,其位移、缩放与不透明度均由一个进度值插值得出- 内容在就绪之前对指针事件保持隐藏;禁用动画时直接解析为显示状态
- 自定义的进入 Keyframe 仍保留原先的「探针 + 挂载」回退路径
组件的公开 API 未变——单次挂载路径完全是内部实现,自定义进入动画的行为与之前完全一致。建议在全部四个放置方向、子菜单过渡以及禁用动画的情形下,验证进入与退出动画。
相关 PR: #438
组件改进
Typography Dynamic Type 支持(iOS)
Typography 组件现在会按语义类型应用默认的 dynamicTypeRamp,使文本在 iOS 上以符合 Apple 设计意图的方式缩放。较大的类型(如标题)比正文缩放得更慢,与 iOS 系统的 Dynamic Type 行为一致。此前,所有 Typography 组件中的文本都以相同的系数缩放。
改进点:
- 每个 Typography 类型都映射到合适的 iOS Dynamic Type ramp(例如标题映射到
titleramp,段落映射到body) - 在 iOS 上提升无障碍与文本缩放的保真度,对 Android 无影响
- 在需要不同 ramp 的场景下,可按实例覆盖
dynamicTypeRamp默认值
此变更仅针对 iOS,不改动 Typography 的 API。已直接传入 dynamicTypeRamp 的应用仍会显式控制缩放行为。
相关 PR: #435
Select 勾选图标颜色
Select 组件的 Select.ItemIndicator 现在将其勾选图标颜色默认为 accent-soft-foreground 主题令牌,而非 accent,使选中项指示器与预期的语义前景色对齐,从而获得更好的对比度与视觉一致性。
改进点:
- 默认勾选图标颜色改用
accent-soft-foreground,提升选中列表项的对比度 - JSDoc 与组件文档已同步更新以反映新的默认值
仅在省略 iconProps.color 时默认图标颜色会发生变化——API 未变,自定义颜色仍然有效。建议在亮色与暗色主题下进行手动验证,以确认指示器对比度。
相关 PR: #436
API 增强
Provider 文本输入配置
HeroUINativeProvider(以及 HeroUINativeProviderRaw)现可通过新的 textInputProps 配置在全局配置一部分 TextInput 属性,首批支持 allowFontScaling 与 maxFontSizeMultiplier。这与既有的全局 textProps 模式保持一致,使整个应用的输入字体缩放行为保持统一。
新能力:
import { HeroUINativeProvider } from "heroui-native";
export function App() {
return (
<HeroUINativeProvider
config={{
textInputProps: {
allowFontScaling: true,
maxFontSizeMultiplier: 1.5,
},
}}
>
{/* Your app */}
</HeroUINativeProvider>
);
}包含内容:
- 在
HeroUINativeConfig与HeroUINativeConfigRaw上新增textInputProps配置(allowFontScaling、maxFontSizeMultiplier) - 新增
TextInputComponentProvider/useTextInputComponent以及一个HeroTextInput辅助组件,将全局属性作为可覆盖的默认值应用 - 已应用于
Input(因此涵盖TextArea、SearchField、InputGroup)以及InputOTP基元
全局属性作为默认值应用,因此任何直接传给组件的属性仍会覆盖它们。
相关 PR: #437
依赖
升级至 Expo 57 / React Native 0.86
项目已升级到 Expo 57 / React Native 0.86 工具链。本次升级还通过包裹内容节点来修复遮罩退出动画,使布局动画不再与动画样式共享 transform,恢复 Android 输入聚焦环,并强化了 Pressable 样式回调的类型。
修复:
- 将 Popover、Menu、Select 的
entering/exiting布局动画移到包裹用的Animated.View上,以修复退出动画并消除 Reanimated 的布局动画覆盖警告 - 在 Android 上使用边框显示输入聚焦环,iOS 仍保留 outline 方案
- 通过移除
scaletransform 简化默认的退出 keyframe - 为 button 与子菜单的样式回调添加显式的
PressableStateCallbackType类型
依赖升级:
- Expo
57 - React Native
0.86 - React Native Reanimated
4.5 react-native-worklets0.10- Tailwind CSS
4.3 - Uniwind
1.10
公开 API 未变,但消费者应将其对等依赖版本与 Expo 57 / React Native 0.86 对齐。建议在 iOS 与 Android 上手动测试遮罩的打开/关闭动画以及输入聚焦状态。
相关 PR: #439
⚠️ 破坏性变更
将 `border-field` 拆分为独立的宽度与颜色令牌
此前,border-field 会以同一名称同时生成宽度与颜色两个工具类,导致 tailwind-merge 丢弃宽度。字段组件硬编码了边框宽度(border、border-[1.5px]),并使用 border-color 表示聚焦与无效状态。v1.0.5 将字段边框拆分为两个互不冲突的工具类,并全局配置 tailwind-variants,使宽度与颜色在合并时不再相互覆盖。
变更内容:
border-field-width(宽度)与border-field-border(颜色)现在是独立、互不冲突的工具类tv/cn使用一个共享的twMergeConfig(border-w分组)进行配置并全局注册;所有*.styles.ts均从 lib 导入tv- Input、InputOTP、Radio、Checkbox 使用
border-field-width与outline-*表示聚焦、激活与无效状态;无效 outline 现在在静止状态下即显示 --field-radius系数由1.5改为1.75
组件的公开 API 未变,但视觉与行为上的变化需要验证。请在你的应用中确认以下事项:
迁移:
仅通过 --field-border 颜色设置的边框将不再显示——--field-border-width 现在默认为 0px,因此需要同时设置宽度:
// 之前——仅设置颜色即可渲染出可见边框
// --field-border: <color>;
// 之后——还需设置宽度,因为 --field-border-width 默认为 0px
// --field-border: <color>;
// --field-border-width: 1.5px;直接使用字段边框宽度工具类时,请重命名:
// 之前
<View className="border-field" />
// 之后
<View className="border-field-width" />同时请验证:
- 聚焦、激活与无效状态现在使用
outline-*而非 border-color - 对
--border-width-field主题键的覆盖必须改用--border-width-field-width(或--field-border-width基元) - 字段圆角略有变化(
--field-radius系数由1.5→1.75)
如果你依赖 --field-border 颜色来产生静止状态的边框,请设置一个非零的 --field-border-width 默认值以恢复该外观。
相关 PR: #434
文档更新
以下文档页面已随本版本更新以反映相关变更:
- Typography — 记录了 iOS 上默认的
dynamicTypeRamp行为 - Select — 更新了
Select.ItemIndicator默认勾选图标颜色 - Provider — 新增
textInputProps章节、示例与 Provider 层级说明
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 6 (`apps/docs/content/docs/cn/native/releases/v1-0-6.mdx`)
title: v1.0.6 将组件样式迁移到专用的 BEM 命名 CSS 文件,并通过按名称为 Portal 子树设置 key 修复 PortalHost 幽灵弹层问题 github: pull: 452
2026 年 7 月 21 日
HeroUI Native v1.0.6 通过将每个组件从内联 Tailwind 类名字符串迁移到 src/styles/components 下专用的 BEM 命名 CSS 文件来集中管理样式,同时让 tv() 插槽仅作为对这些类的轻量引用,从而更易于覆盖与维护。本版本还修复了一个 PortalHost 协调(reconciliation)缺陷:在不同屏幕间,Sheet、Dialog 与 Popover 可能会相互继承彼此的状态——产生「幽灵」状态的已打开 Sheet——现在通过按唯一名称为每个 Portal 子树设置 key 来解决该问题。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
样式
组件样式迁移到专用的 CSS 类
每个组件的样式已从各个 *.styles.ts 文件中冗长的内联 Tailwind 类名字符串,迁移到 src/styles/components 下专用的 BEM 命名 CSS 文件,并通过 src/styles/index.css 接入。tv() 插槽现在仅作为对这些 CSS 类的轻量引用,从而集中管理样式,使组件更易于覆盖与维护。
改进点:
- 将全部约 40 个组件的样式抽取为 BEM 结构的
.css文件,并通过src/styles/index.css接入 - 让
tv()插槽仅作为对新 CSS 类的轻量引用,而非内联 Tailwind 字符串 - 新增
element-disabled工具类 - 清理相关的工具类与依赖
组件的公开 API 未变,因此无需修改代码。消费者需确保已加载 src/styles/index.css,组件才能正确渲染。
相关 PR: #452
问题修复
PortalHost 幽灵 Sheet
PortalHost 此前将所有已注册的 Portal 渲染为一个未设置 key 的数组,因此 React 会按索引进行协调。当某个 Portal 在列表中途注册或注销时——例如某个屏幕卸载时——相邻的 Portal 索引会发生偏移,导致 React 把一个 Portal 的实时组件状态嫁接到另一个 Portal 的内容上。对于底部 Sheet 而言,这会让其继承内部 Sheet 实例及其动画位置,于是一个已关闭的 Sheet 可能显示为完全打开(「幽灵」Sheet),而一个已打开的 Sheet 则可能继承到已关闭的实例而始终无法显示。
现在每个 Portal 子树都按其唯一的 Portal 名称设置 key,因此 React 会按身份而非数组位置来追踪 Portal。这修复了 BottomSheet、Dialog、Popover 与 Select 各类 Portal 上的幽灵 Sheet 行为,也很可能是底部 Sheet 间歇性无法显示的根因。
本版本包含针对以下问题的修复:
- Issue #441:修复
PortalHost将 Portal 渲染为未设置 key 的数组的问题——当某个屏幕卸载时,会导致 Sheet 与 Dialog 相互继承状态,从而出现显示无关内容的「幽灵」已打开 Sheet。现在 Portal 按名称设置 key,使每个子树都按身份被追踪。
相关 PR: #442
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 7 (`apps/docs/content/docs/cn/native/releases/v1-0-7.mdx`)
title: v1.0.7 通过全新的 background 属性实现可替换的背景层,新增 GlassView 层组件,为 Dialog 与 Bottom Sheet 提供 blur 遮罩变体,Select 触发器改为字段样式,Toast 迁移至 overlay 令牌 github: pull: 457
2026 年 7 月 28 日
HeroUI Native v1.0.7 让组件表面变得可扩展:组件现在接受 background 属性,并暴露配套的背景复合部件,从而可将表面后方的层替换为任意节点。本版本还新增 GlassView 层组件、用于 Dialog 与 Bottom Sheet 的 blur 遮罩变体,并将 expo-blur 作为可选的对等依赖。这些都是扩展点——默认主题不注册任何背景内容,因此渲染结果不变。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
新特性
可替换的背景层
组件此前会直接依据主题令牌渲染固定的不透明表面。在 v1.0.7 中,拥有表面的部件接受 background 属性,并暴露以其所背衬元素命名的背景复合部件。传入节点即可替换该层,或传入 null 将其移除。
import { Button, GlassView } from "heroui-native";
<Button
variant="secondary"
background={
<Button.Background>
<GlassView intensity={80} />
</Button.Background>
}
>
Save changes
</Button>
// 完全移除该层
<Button variant="secondary" background={null}>
Save changes
</Button>属性与部件配对规律清晰——background 位于 Button、Avatar、Switch、Chip、Checkbox、Input 与 SubMenu 的根组件上,位于 Radio.Indicator、Slider.Track、Tabs.List、TagGroup.Item、InputOTP.Slot 与 Popover.Content 的子部件上,其对应部件分别为 Radio.IndicatorBackground、Slider.TrackBackground、Tabs.ListBackground、TagGroup.ItemBackground、InputOTP.SlotBackground 与 Popover.ContentBackground。每个背景容器都是绝对填充视图,继承宿主元素的定位与裁剪,并接受 fallbackColor 主题令牌用于不支持原生模糊的平台。
是否挂载默认层由 --theme CSS 变量决定,可使用 useIsGlassTheme 与 useHasDefaultThemeBackground 检测这一情况。HeroUI Native 附带的主题不注册任何背景内容,因此除非你自行注入,否则不会渲染任何内容;用于激活这些层的 glass 主题由 heroui-native-pro/themes/glass 提供。
相关 PR: #457
⚠️ 破坏性变更
Select 触发器改为字段外观
.select__trigger--variant-default 在所有主题上从表面外观改为字段外观——此变更不受 --theme 限制。如果你依赖 Select 触发器与周围的 Surface 元素保持一致,它现在会转而与你的表单字段保持一致。
变更内容:
--radius-2xl→--radius-field--color-surface→--color-field--shadow-surface→--shadow-field- 新增
--color-field-border边框
迁移:
无需修改 API。若要恢复此前的表面外观,请覆盖 Select 触发器的样式:
// 之前——触发器默认使用 surface 令牌渲染
<Select.Trigger />
// 之后——显式恢复表面外观
<Select.Trigger className="rounded-2xl bg-surface border-0 shadow-surface" />相关 PR: #457
Toast 遮罩令牌切换
.toast__root 从 --color-surface 改为 --color-overlay,其默认标签颜色从 --color-foreground 改为 --color-overlay-foreground。
在附带的主题中,这些令牌在亮色(--white)与暗色(oklch(0.2103 0.0059 285.89))模式下都解析为相同的值,因此开箱即用没有可见变化。只有当你将 --surface 与 --overlay——或 --foreground 与 --overlay-foreground——覆盖为不同的值时才会有影响,此时 Toast 会转而采用你的 overlay 值而非 surface 值。
迁移:
如果你曾为 Toast 自定义 --surface,请将该自定义移至 --overlay,或直接覆盖 Toast 类:
// 之前——Toast 跟随 --surface / --foreground
// 之后——Toast 跟随 --overlay / --overlay-foreground
<Toast className="bg-surface" />相关 PR: #457
更新的文档
以下文档页面已更新,以反映本版本的变更:
- Dialog - 记录
blur遮罩变体与blurViewProps - Bottom Sheet - 记录
blur遮罩变体与blurViewProps - 为 Button、Avatar、Checkbox、Chip、Input、InputOTP、Menu、Radio Group、Slider、Switch、Tabs 与 TagGroup 新增背景层文档
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 8 (`apps/docs/content/docs/cn/native/releases/v1-0-8.mdx`)
title: v1.0.8 通过 provider 的 isRTL 配置与 LayoutDirectionScope 为各组件提供从右到左(RTL)布局支持,随包发布的样式表自行声明 @source,并调整 Card.Header 与 TagGroup.List 的布局 github: pull: 459
2026 年 7 月 31 日
HeroUI Native v1.0.8 为整个库带来从右到左(RTL)布局支持。组件样式从物理的 left/right 迁移到 Yoga 的逻辑属性,而 Yoga 无法覆盖的 JS 驱动逻辑——手势位移、动画偏移、弹层对齐——现在通过全新的 isRTL provider 配置解析方向,并提供 LayoutDirectionScope 作为子树的应急出口。本版本还让 heroui-native/styles 自行声明 @source,因此类名扫描不再依赖于应用中硬编码的 node_modules 路径。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
新特性
RTL 布局支持
当你的应用在从右到左的区域设置下运行时,组件现在会正确镜像。组件 CSS 全面采用逻辑属性(inset-inline-*、padding-inline-*、start/end),因此 Yoga 可在两个方向上处理定位;而 Yoga 无法表达的行为——手势位移、动画偏移、遮罩对齐——则从 provider 读取有效方向。
告诉组件它们渲染在哪个方向:
HeroUINativeProvider 接受 config.isRTL,默认为 I18nManager.isRTL:
import { HeroUINativeProvider } from 'heroui-native';
import type { HeroUINativeConfig } from 'heroui-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
const config: HeroUINativeConfig = {
// 默认为 I18nManager.isRTL
isRTL: true,
};
export default function App() {
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<HeroUINativeProvider config={config}>
{/* 你的应用内容 */}
</HeroUINativeProvider>
</GestureHandlerRootView>
);
}由于默认值已跟随 I18nManager.isRTL,依赖原生 RTL 标志的应用无需任何修改。当方向来自其他来源时才需显式设置——例如无需重载即可切换方向的运行时区域切换器。
将子树限定为不同方向:
新导出的 LayoutDirectionScope 会覆盖其下方组件的方向,这正是你在从右到左应用中希望某个演示或预览区域保持从左到右时所需要的。它只覆盖 JavaScript 一侧,因此需搭配 Uniwind 的 LayoutDirection(用于 rtl: 变体)以及 direction 样式(用于 Yoga 布局):
import { LayoutDirectionScope, PortalHost } from 'heroui-native';
import { LayoutDirection } from 'uniwind';
import { View } from 'react-native';
<LayoutDirection rtl={false}>
<View className="flex-1" style={{ direction: 'ltr' }}>
<LayoutDirectionScope isRTL={false}>
<PreviewArea />
<PortalHost name="preview" />
</LayoutDirectionScope>
</View>
</LayoutDirection>;该作用域驱动发生在 JavaScript 中的方向读取:Slider 的手势反转、Skeleton 与 SubMenu 的动画偏移,以及 Popover 与 Menu 的 start/end 对齐。你自己的组件也可以通过新导出的 useIsRTL 钩子读取同一个值。
方向感知行为:
- Slider:点按与拖拽的位移会被反转,填充与滑块锚定到逻辑边缘
- Skeleton:微光沿阅读方向扫过
- Switch:滑块行程锚定在
start - Tabs:指示器的重新定基以实际锚点交换为准,而非假定为左侧锚点
- Popover 与 Menu:
start/end对齐按方向解析 - InputGroup:测量得到的附加元素宽度以
paddingStart/paddingEnd应用 - SearchField、ListGroup 与
SubMenu:默认的箭头与放大镜图标会镜像
文本对齐:
Card、Dialog、Menu、Select、Toast、Label、Description、FieldError 等组件中基于 Text 的部件在两个方向上都会对齐到起始边。TextInput 部件则获得显式的 rtl:text-right,因为 React Native 对 TextInput 的对齐是按物理方向而非逻辑方向解析的。
示例应用现在通过 Lingui 附带 en、ar、he 三套语言目录并配有运行时区域切换器,还加入了 eslint-plugin-lingui 以防止出现未翻译的字符串。本版本已在 iOS 与 Android 上针对全部三种区域设置进行手动验证,包括在从右到左的应用外壳内部限定为从左到右的预览。
相关 PR: #459
样式
随包发布的样式表自行声明 `@source`
heroui-native/styles 现在会将 Tailwind 指向它自身的文件:
@source "..";Tailwind v4 会相对于包含 @source 的 CSS 文件来解析它,因此在已发布的包中,lib/module/styles/index.css 会将扫描路径解析为 lib/module——无论包管理器将其安装在何处。
此前,每个应用都必须把一个指向 node_modules 的文件系统路径硬编码进来:
/* 之前——应用必须知道包所在的位置 */
@import 'heroui-native/styles';
@source './node_modules/heroui-native/lib';
/* 之后——包自行声明其扫描路径 */
@import 'heroui-native/styles';这两条指令的行为从来就不一致。@import 会经由包的 exports 解析,能在任何位置找到包;而 @source 是一个文件系统 glob,只有当包位于该字面路径时才有效。二者在单包应用中一致,但在工作区中会产生分歧——因为决定包落在哪个 node_modules 的是安装器,而非项目布局。Bun 的隔离链接器会把它放进应用中,其提升(hoisted)链接器会放到工作区根部,而 pnpm 与 yarn 也会因是否提升而各自分裂。
这种失败还是静默的:缺失的 @source 目录在 Tailwind 中是无操作,不会有任何警告或错误。应用级类名照常工作,而仅在 HeroUI 随包组件内部使用的类名却消失了,于是 Avatar 失去了尺寸、Switch 渲染为不可见、Popover 背景变为透明。
现有的应用级 @source 行仍可继续工作——它们只是变得多余,可以移除。
相关 PR: #455
⚠️ 破坏性变更
Card.Header 将子元素对齐到起始边
.card__header 现在设置 align-items: flex-start,而不再继承默认的 stretch。交叉轴上的 flex-start 会跟随布局方向,这正是让头部内容在 RTL 下位于起始边的原因——但它也改变了 LTR 渲染:此前拉伸到整个头部宽度的头部子元素,现在会收缩包裹其内容。
迁移:
该变更位于 CSS 中,因此 items-stretch 可恢复此前的行为:
// 之前——子元素拉伸到整个头部宽度
<Card.Header>
<SomeFullWidthChild />
</Card.Header>
// 之后——显式恢复拉伸
<Card.Header className="items-stretch">
<SomeFullWidthChild />
</Card.Header>相关 PR: #459
TagGroup.List 应用内联布局样式
TagGroup.List 现在会接收一段内联样式(width: '100%'、alignItems: 'flex-start'),并在你传入的 style 之前合并,以规避 Yoga 的换行测量问题。内联样式优先于类名解析出的样式,因此对该部件在 width 或 alignItems 上的 className 覆盖将不再生效。
迁移:
将这两个属性从 className 移到 style,由于 style 在内部值之后合并,因此仍会胜出:
// 之前——className 覆盖生效
<TagGroup.List className="w-auto items-center" />
// 之后——使用 style 设置 width 与 alignItems
<TagGroup.List style={{ width: 'auto', alignItems: 'center' }} />对 TagGroup 的其他 className 覆盖不受影响。
相关 PR: #459
问题修复
本版本包含以下问题的修复:
- Issue #454:修复了在 monorepo 布局下类名扫描失效的问题。
heroui-native/styles未为其自身文件声明@source,因此应用必须把一个指向node_modules的路径硬编码进来,而该路径只在部分包管理器布局下才能解析——一旦出错,Tailwind 便什么都不扫描且静默失败,导致 HeroUI 组件在没有样式的情况下渲染。随包发布的样式表现在会声明相对于自身的扫描路径。
相关 PR:
内部变更
本版本还移除了循环模块依赖:Surface 上下文被拆分为一个叶子模块,共享的 Toast 配置被提取到 toast.base-types。仅内部导入路径发生变化——不影响任何公共 API。
相关 PR: #459
更新的文档
以下文档页面已更新,以反映本版本的变更:
- Quick Start -
global.css的配置不再包含@source行,基于路径的说明保留给 v1.0.7 及更早版本 - Provider - 记录
isRTL配置项、LayoutDirectionScope覆盖以及useIsRTL钩子
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn Native Releases V1 0 9 (`apps/docs/content/docs/cn/native/releases/v1-0-9.mdx`)
title: v1.0.9 字重通过 Uniwind 的 font-* 工具类解析,SearchField 仅为已组合的部件预留内边距,Toast 的 duration 0 会自动隐藏,修复 RNGH 3 下 Android 上 Select 与 Dialog 的滑动关闭 github: pull: 481
2026 年 8 月 31 日
HeroUI Native v1.0.9 重构了组件样式中字重的解析方式,修复了省略可选部件时 SearchField 的内边距问题,纠正了时长为零的 Toast 未自动关闭的行为,并恢复了 react-native-gesture-handler 3 下 Android 上 Select 与 Dialog 的滑动关闭。
安装
升级到最新版本:
<Tabs items={["npm", "pnpm", "yarn", "bun"]}>
npm i heroui-native真机体验
⚠️ 破坏性变更
Toast 的 `duration: 0` 现在会自动隐藏
duration 的类型为 number | 'persistent',但由于自动关闭的判断要求 duration > 0,0 被静默地当作持久显示处理。时长为零的 Toast 现在与其他数值时长走同一条 setTimeout 路径,会在下一个 tick 关闭。
之前:
toast.show({ label: 'Quick flash', duration: 0 });
// Toast 会一直停留在屏幕上——与 'persistent' 相同之后:
toast.show({ label: 'Quick flash', duration: 0 });
// Toast 会在下一个 tick 自动隐藏
// 若要让 Toast 一直停留在屏幕上,请使用 'persistent':
toast.show({ label: 'Sticky', duration: 'persistent' });迁移: 如果你依赖旧行为,请将 duration: 0 替换为 duration: 'persistent'。
相关 PR: #471
使用自定义字体的应用必须定义 `--font-bold`
组件样式现在通过 Uniwind 的 font-normal、font-medium、font-semibold 与 font-bold 工具类应用字重。当定义了 --font-* 变量时,每个工具类会选择对应的字体族,而不再应用数值化的 font-weight。这修复了 iOS 会在自定义字体族中选中最粗字面的问题,但也意味着只要定义了其中任意一个变量,就必须定义全部四个。
之前:
@theme {
--font-normal: 'YourFont-400Regular';
--font-medium: 'YourFont-500Medium';
--font-semibold: 'YourFont-600SemiBold';
}之后:
@theme {
--font-normal: 'YourFont-400Regular';
--font-medium: 'YourFont-500Medium';
--font-semibold: 'YourFont-600SemiBold';
--font-bold: 'YourFont-700Bold';
}迁移: 补上缺失的 --font-bold 变量,指向该字体族的 bold 字面。使用系统字体的应用无需任何修改——未定义任何 --font-* 变量时会自动恢复数值化字重。
相关 PR: #473
问题修复
本版本包含以下问题的修复:
- Issue #465:即使省略了 SearchIcon 与 ClearButton,
SearchField.Input仍会为它们预留左右内边距。现在只有在组合了对应复合部件时才会应用内边距。 - Issue #444:在 react-native-gesture-handler 3 下的 Android 上,打开带滑动关闭的 Select 或 Dialog 会抛出异常,因为 Portal 内容在其原生祖先链中没有手势根节点。新增的内部
PortalGestureRoot现在会包裹 Portal 对话框内容,使滑动关闭在 RNGH 3 的 Android 上正常工作。 - LinkButton 不再应用默认圆角(
rounded-none),此前该圆角会在边缘裁切文本。 - Issue #476:嵌套了
Radio的RadioGroup.Item会向辅助技术暴露两个role="radio"节点。位于分组项内部时,嵌套的触发器现在会对辅助技术隐藏,因此每个选项只呈现单个 radio 节点。 - Issue #467:使用
content-fit或紧凑尺寸时,Select 触发器与选项的文本会被压缩。默认的 flex 样式改为flex-shrink: 1,使文本既能贡献其固有宽度,又能在空间受限时收缩。 - Issue #461:自定义字体解析重构后,使用系统字体的应用丢失了数值化字重。未定义任何
--font-*变量时,字重现在会回退到数值化的font-weight。
相关 PR:
更新的文档
以下文档页面已更新,以反映本版本的变更:
- Theming - 记录
--font-bold变量的必要性,并说明在使用与不使用自定义字体时字重如何解析 - Typography - 说明自定义
--font-*字体族会改变字重的解析方式,并链接到主题定制指南 - SearchField - 明确 SearchIcon 与 ClearButton 为可选部件,并补充「不带搜索图标」的组合方式
- Toast - 明确
duration: 0与'persistent'的区别
链接
贡献者
感谢所有为本版本做出贡献的朋友!
Apps Docs Content Docs Cn React Components Meta.Json (`apps/docs/content/docs/cn/react/components/meta.json`)
{
"title": "组件",
"description": "HeroUI React 组件",
"root": true,
"icon": "circles-4-diamond",
"pages": [
"---概述---",
"index",
"---组件---",
"(navigation)/accordion",
"(feedback)/alert",
"(overlays)/alert-dialog",
"(pickers)/autocomplete",
"(media)/avatar",
"(media)/avatar-group",
"(data-display)/badge",
"(navigation)/breadcrumbs",
"(buttons)/button",
"(buttons)/button-group",
"(date-and-time)/calendar",
"(layout)/card",
"(forms)/checkbox",
"(forms)/checkbox-group",
"(data-display)/chip",
"(buttons)/close-button",
"(colors)/color-area",
"(colors)/color-field",
"(colors)/color-picker",
"(colors)/color-slider",
"(colors)/color-swatch",
"(colors)/color-swatch-picker",
"(pickers)/combo-box",
"(date-and-time)/date-field",
"(date-and-time)/date-picker",
"(date-and-time)/date-range-picker",
"(forms)/description",
"(navigation)/disclosure",
"(navigation)/disclosure-group",
"(overlays)/drawer",
"(collections)/dropdown",
"(forms)/error-message",
"(forms)/field-error",
"(forms)/fieldset",
"(forms)/form",
"(forms)/input",
"(forms)/input-group",
"(forms)/input-otp",
"(typography)/kbd",
"(forms)/label",
"(navigation)/link",
"(collections)/list-box",
"(feedback)/meter",
"(overlays)/modal",
"(forms)/number-field",
"(navigation)/pagination",
"(overlays)/popover",
"(feedback)/progress-bar",
"(feedback)/progress-circle",
"(forms)/radio-group",
"(date-and-time)/range-calendar",
"(utilities)/scroll-shadow",
"(forms)/search-field",
"(pickers)/select",
"(layout)/separator",
"(feedback)/skeleton",
"(controls)/slider",
"(feedback)/spinner",
"(layout)/surface",
"(controls)/switch",
"(data-display)/table",
"(navigation)/tabs",
"(collections)/tag-group",
"(forms)/text-area",
"(forms)/text-field",
"(date-and-time)/time-field",
"(overlays)/toast",
"(buttons)/toggle-button",
"(buttons)/toggle-button-group",
"(layout)/toolbar",
"(overlays)/tooltip",
"(typography)/typography"
]
}
Apps Docs Content Docs Cn React Getting Started Meta.Json (`apps/docs/content/docs/cn/react/getting-started/meta.json`)
{
"title": "快速开始",
"description": "快速开始使用 HeroUI v3",
"root": true,
"icon": "book-open",
"pages": [
"---概述---",
"index",
"(overview)/quick-start",
"(overview)/design-principles",
"(overview)/frameworks",
"(overview)/cli",
"[sparkles]组件案例",
"[route]路线图",
"[figma]Figma",
"---手册---",
"(handbook)/colors",
"(handbook)/theming",
"(handbook)/dark-mode",
"(handbook)/styling",
"(handbook)/animation",
"(handbook)/composition",
"---代理用户界面---",
"(ui-for-agents)/llms-txt",
"(ui-for-agents)/mcp-server",
"(ui-for-agents)/agent-skills",
"(ui-for-agents)/agents-md"
]
}
Apps Docs Content Docs Cn React Migration Hooks (`apps/docs/content/docs/cn/react/migration/hooks.mdx`)
title: Hooks
概述
HeroUI v3 移除了 v2 中存在的大多数组件 Hooks,转而使用复合组件,并新增了一个用于管理浮层状态的 Hook。本指南涵盖:
- 组件 Hooks 的移除(
useSwitch、useInput、useCheckbox等) useDisclosure→useOverlayState的迁移- 迁移策略与示例
组件 Hooks 的移除
HeroUI v2 提供了一系列组件 Hooks(例如 useSwitch、useInput、useCheckbox 等),它们返回一组 prop getter(getBaseProps、getWrapperProps、getThumbProps 等),让用户在无法直接修改内部子组件的情况下也能自定义组件结构。HeroUI v3 通过复合组件解决了这个问题,从而无需再依赖这些 Hooks。
为什么 v2 中存在这些 Hooks
在 v2 中,组件具有固定的内部结构。为了自定义这些结构,用户需要使用提供 prop getter 的 Hooks。例如,useSwitch 返回 getBaseProps()、getWrapperProps()、getThumbProps() 等,用户可以将其展开到自定义元素上,从而构建自己的 Switch 结构。
v3 的解决方案:复合组件
v3 采用了复合组件模式,让你可以直接访问组件的各个部分。你不再需要使用带有 prop getter 的 Hooks,而是可以直接通过 Switch.Control、Switch.Thumb、Checkbox.Control、Checkbox.Indicator 等子组件进行组合。
迁移策略
- 识别 Hook 用法:在你的代码库中搜索来自
@heroui/react的导入,找出包含 Hook 名称(useSwitch、useInput、useCheckbox、useRadio等)的引用。 - 替换为复合组件:使用复合组件模式,替代带有 prop getter 的 Hooks。
- 保留原有结构:迁移时,尽量保持与原 Hook 实现一致的组件结构。例如:
- 如果你之前用
useSwitch创建了一个 不带 thumb 的 Switch,那么在 v3 中也不要添加Switch.Thumb - 如果你之前用
useCheckbox创建了一个 不带 indicator 的 Checkbox,那么在 v3 中也不要添加Checkbox.Indicator - 只引入原本基于 Hook 的实现中实际用到的子组件
- 如果你之前用
- 参考各组件指南:查看各个组件的迁移指南,获取具体示例。
主要差异
- v2:Hooks 提供 prop getter,用于自定义固定的组件结构
- v3:复合组件允许直接组合组件的各个部分
保留结构示例
v2:不带 thumb 的 Switch
import { useSwitch } from "@heroui/react";
function CustomSwitch() {
const { getBaseProps } = useSwitch();
return (
<div {...getBaseProps()}>
{/* No thumb element */}
</div>
);
}v3:等效结构
import { Switch } from "@heroui/react";
function CustomSwitch() {
return (
<Switch.Control>
{/* No Switch.Thumb - preserving the original structure */}
</Switch.Control>
);
}有关具体组件的详细迁移示例,请参阅各个组件的迁移指南。
useDisclosure → useOverlayState
v2 中的 useDisclosure 钩子在 v3 中已替换为 useOverlayState。该钩子用于管理 Modal、Popover 等浮层组件的打开/关闭状态。
v2:useDisclosure
API:
const {isOpen, onOpen, onClose, onOpenChange, isControlled, getButtonProps, getDisclosureProps} = useDisclosure({
isOpen?: boolean;
defaultOpen?: boolean;
onClose?(): void;
onOpen?(): void;
onChange?(isOpen: boolean | undefined): void;
id?: string;
});示例:
import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button, useDisclosure } from "@heroui/react";
export default function App() {
const {isOpen, onOpen, onOpenChange} = useDisclosure();
return (
<>
<Button onPress={onOpen}>Open Modal</Button>
<Modal isOpen={isOpen} onOpenChange={onOpenChange}>
<ModalContent>
<ModalHeader>Title</ModalHeader>
<ModalBody>Content</ModalBody>
<ModalFooter>
<Button onPress={onOpenChange}>Close</Button>
</ModalFooter>
</ModalContent>
</Modal>
</>
);
}v3:useOverlayState
API:
const state = useOverlayState({
isOpen?: boolean;
defaultOpen?: boolean;
onOpenChange?: (isOpen: boolean) => void;
});
// Returns:
// {
// isOpen: boolean;
// open(): void;
// close(): void;
// toggle(): void;
// setOpen(isOpen: boolean): void;
// }示例:
import { Modal, Button, useOverlayState } from "@heroui/react";
export default function App() {
const state = useOverlayState();
return (
<Modal>
<Button onPress={state.open}>Open Modal</Button>
<Modal.Container isOpen={state.isOpen} onOpenChange={state.setOpen}>
<Modal.Dialog>
{({close}) => (
<>
<Modal.Header>
<Modal.Heading>Title</Modal.Heading>
</Modal.Header>
<Modal.Body>Content</Modal.Body>
<Modal.Footer>
<Button onPress={close}>Close</Button>
</Modal.Footer>
</>
)}
</Modal.Dialog>
</Modal.Container>
</Modal>
);
}迁移指南
基本迁移
v2:
const {isOpen, onOpen, onClose, onOpenChange} = useDisclosure();v3:
const state = useOverlayState();
// Use state.open(), state.close(), state.toggle(), state.setOpen(boolean)受控状态
v2:
const {isOpen, onOpenChange} = useDisclosure({
isOpen: controlledIsOpen,
onChange: (isOpen) => setControlledIsOpen(isOpen)
});v3:
const state = useOverlayState({
isOpen: controlledIsOpen,
onOpenChange: setControlledIsOpen
});非受控状态
v2:
const {isOpen, onOpen, onClose} = useDisclosure({
defaultOpen: false
});v3:
const state = useOverlayState({
defaultOpen: false
});
// Use state.open(), state.close(), state.toggle()API 差异
| v2(useDisclosure) | v3(useOverlayState) | 说明 |
|---|---|---|
isOpen |
isOpen |
相同 |
onOpen() |
open() |
方法重命名 |
onClose() |
close() |
方法重命名 |
onOpenChange() |
toggle() |
新增的切换方法 |
onOpenChange(prop) |
setOpen(boolean) |
API 不同 |
isControlled |
- | 已移除(由内部处理) |
getButtonProps() |
- | 已移除(改用复合组件) |
getDisclosureProps() |
- | 已移除(改用复合组件) |
useOverlayState 的优势
- 更简洁的 API:使用专用方法(
open()、close()、toggle()),而非回调 - 更简单的状态管理:在受控与非受控两种模式下都能无缝工作
- 更完善的 TypeScript 支持:改进了类型推断和自动补全
- 与 React Aria 保持一致:与 React Aria Components 的模式相符
替代方案:useState
对于简单的场景,你也可以直接使用 React 的 useState:
import { useState } from "react";
import { Modal, Button } from "@heroui/react";
export default function App() {
const [isOpen, setIsOpen] = useState(false);
return (
<Modal>
<Button onPress={() => setIsOpen(true)}>Open</Button>
<Modal.Container isOpen={isOpen} onOpenChange={setIsOpen}>
<Modal.Dialog>
{/* content */}
</Modal.Dialog>
</Modal.Container>
</Modal>
);
}不过,useOverlayState 为常见操作提供了更简洁的 API 和专用方法。
已移除的 Hooks
v2 中的以下 Hooks 在 v3 中已被移除:
- useDraggable:已移除
- useClipboard:已移除
- usePagination:已移除
- useToast:已移除
总结
- 组件 Hooks(
useSwitch、useInput等)→ 改用 复合组件 - useDisclosure → 改用 useOverlayState 来管理浮层状态
- useOverlayState 提供了更简洁的 API,包含
open()、close()、toggle()与setOpen()方法 - 已移除的 Hooks:
useDraggable、useClipboard、usePagination、useToast不再可用 - 对于简单的场景可以直接使用
useState,但useOverlayState在使用体验上更佳
有关具体组件的 Hooks 迁移示例,请参阅各个组件的迁移指南。
Apps Docs Content Docs Cn React Migration Meta.Json (`apps/docs/content/docs/cn/react/migration/meta.json`)
{
"title": "迁移",
"description": "将 HeroUI v2 应用迁移到 v3 的完整指南",
"root": true,
"icon": "code-pull-request-arrow-right",
"pages": [
"---概述---",
"index",
"---面向 Agent 的迁移---",
"(migration-for-agents)/mcp-server",
"(migration-for-agents)/agent-skills",
"(migration-for-agents)/agents-md",
"---迁移流程---",
"(workflows)/full-migration",
"(workflows)/incremental-migration",
"---参考---",
"hooks",
"styling",
"---组件---",
"(components)/accordion",
"(components)/alert",
"(components)/autocomplete",
"(components)/avatar",
"(components)/badge",
"(components)/breadcrumbs",
"(components)/calendar",
"(components)/button",
"(components)/button-group",
"(components)/card",
"(components)/checkbox",
"(components)/checkbox-group",
"(components)/chip",
"(components)/code",
"(components)/date-picker",
"(components)/date-range-picker",
"(components)/divider",
"(components)/drawer",
"(components)/dropdown",
"(components)/form",
"(components)/image",
"(components)/input",
"(components)/input-otp",
"(components)/kbd",
"(components)/link",
"(components)/listbox",
"(components)/modal",
"(components)/navbar",
"(components)/numberinput",
"(components)/pagination",
"(components)/popover",
"(components)/progress",
"(components)/circular-progress",
"(components)/radio",
"(components)/range-calendar",
"(components)/radio-group",
"(components)/scroll-shadow",
"(components)/select",
"(components)/skeleton",
"(components)/slider",
"(components)/snippet",
"(components)/spacer",
"(components)/spinner",
"(components)/switch",
"(components)/table",
"(components)/tabs",
"(components)/toast",
"(components)/tooltip",
"(components)/user"
]
}
Apps Docs Content Docs Cn React Migration Styling (`apps/docs/content/docs/cn/react/migration/styling.mdx`)
title: 样式与主题
注: v3 已将 classNames 这一对象类型的 prop 替换为标准的 React className prop。所有组件现在都使用标准的 React className prop,而不再使用 v2 中的 classNames 对象属性。
概述
HeroUI v3 对样式系统进行了重大变更:
- CSS 优先架构:以纯 CSS 文件取代 Tailwind 插件
- 标准 Tailwind 工具类:以标准 Tailwind 类取代自定义工具类
- CSS 变量:全新的 CSS 变量命名与结构
- 组件样式:调整了默认尺寸、间距与视觉表现
- 无需插件:移除了对 Tailwind 插件配置的依赖
- 颜色系统重构:语义颜色被重新组织(
primary→accent,移除secondary,移除数字色阶) - 移除 Content 颜色:
content1-4由surface与overlay体系替代
快速参考
工具类对照
| v2 工具类 | v3 对应类 | 说明 |
|---|---|---|
text-tiny |
text-xs |
字体大小:0.75rem → 0.75rem(相同) |
text-small |
text-sm |
字体大小:0.875rem → 0.875rem(相同) |
text-medium |
text-base |
字体大小:1rem → 1rem(相同) |
text-large |
text-lg |
字体大小:1.125rem → 1.125rem(相同) |
rounded-small |
rounded-sm |
圆角:8px → 4px(不同) |
rounded-medium |
rounded-md |
圆角:12px → 6px(不同) |
rounded-large |
rounded-lg |
圆角:14px → 8px(不同) |
border-small |
border |
边框宽度:1px → 1px(使用标准 Tailwind) |
border-medium |
border-2 |
边框宽度:2px → 2px(使用标准 Tailwind) |
border-large |
border-[3px] |
边框宽度:3px → 3px(使用任意值) |
bg-content1 |
bg-surface 或 bg-overlay |
Content 颜色已移除,请改用 surface / overlay |
bg-content2 |
bg-surface-secondary |
Content 颜色已移除,请改用 surface 层级 |
bg-primary |
bg-accent |
primary 已重命名为 accent |
bg-secondary |
bg-default |
secondary 颜色已移除,请改用 default |
bg-primary-50 |
bg-accent-soft |
数字色阶已移除 |
bg-primary-100 |
bg-accent-soft |
数字色阶已移除 |
text-primary-600 |
text-accent |
数字色阶已移除 |
.transition-background |
标准 CSS 过渡 | 已移除的工具类 |
.transition-colors-opacity |
标准 CSS 过渡 | 已移除的工具类 |
工具类迁移
文本工具类
HeroUI v2 提供了一组自定义的文本尺寸工具类,并映射到 CSS 变量。v3 改用标准的 Tailwind 文本尺寸类。
v2 文本工具类:
// v2 - Custom utilities with CSS variables
<div className="text-tiny">Tiny text</div>
<div className="text-small">Small text</div>
<div className="text-medium">Medium text</div>
<div className="text-large">Large text</div>v3 文本工具类:
// v3 - Standard Tailwind classes
<div className="text-xs">Tiny text</div>
<div className="text-sm">Small text</div>
<div className="text-base">Medium text</div>
<div className="text-lg">Large text</div>对照详情:
| v2 类 | 字体大小 | 行高 | v3 类 | 字体大小 | 行高 |
|---|---|---|---|---|---|
text-tiny |
0.75rem(12px) | 1rem(16px) | text-xs |
0.75rem(12px) | 1rem(16px) |
text-small |
0.875rem(14px) | 1.25rem(20px) | text-sm |
0.875rem(14px) | 1.25rem(20px) |
text-medium |
1rem(16px) | 1.5rem(24px) | text-base |
1rem(16px) | 1.5rem(24px) |
text-large |
1.125rem(18px) | 1.75rem(28px) | text-lg |
1.125rem(18px) | 1.75rem(28px) |
圆角工具类
v2 使用了自定义的圆角工具类(rounded-small、rounded-medium、rounded-large),并映射到 CSS 变量。v3 改用标准的 Tailwind 圆角类,但实际取值有所不同。
v2 圆角:
// v2 - Custom utilities
<div className="rounded-small">Small radius</div>
<div className="rounded-medium">Medium radius</div>
<div className="rounded-large">Large radius</div>v3 圆角:
// v3 - Standard Tailwind classes
<div className="rounded-sm">Small radius</div>
<div className="rounded-md">Medium radius</div>
<div className="rounded-lg">Large radius</div>取值对比:
| v2 类 | v2 取值 | v3 类 | v3 取值 | 差异 |
|---|---|---|---|---|
rounded-small |
8px(0.5rem) | rounded-sm |
4px(0.25rem) | 更小 |
rounded-medium |
12px(0.75rem) | rounded-md |
6px(0.375rem) | 更小 |
rounded-large |
14px(0.875rem) | rounded-lg |
8px(0.5rem) | 更小 |
注意: v3 默认的圆角取值更小。如果你需要精确还原 v2 的取值,请使用任意值:
// Match v2 rounded-small (8px)
<div className="rounded-[8px]">Custom radius</div>
// Match v2 rounded-medium (12px)
<div className="rounded-[12px]">Custom radius</div>
// Match v2 rounded-large (14px)
<div className="rounded-[14px]">Custom radius</div>边框宽度工具类
v2 提供了自定义的边框宽度工具类(border-small、border-medium、border-large)。v3 改用标准的 Tailwind 边框宽度类。
v2 边框宽度:
// v2 - Custom utilities
<div className="border-small border-default">1px border</div>
<div className="border-medium border-accent">2px border</div>
<div className="border-large border-danger">3px border</div>v3 边框宽度:
// v3 - Standard Tailwind classes
<div className="border border-default">1px border</div>
<div className="border-2 border-accent">2px border</div>
<div className="border-[3px] border-danger">3px border</div>**对照