heroui-native
Skill này làm gì
Skill này hướng dẫn xây dựng giao diện ứng dụng di động bằng thư viện thành phần HeroUI Native cho React Native. Skill bao gồm cài đặt thư viện, thiết lập chủ đề sáng và tối, và cách dùng các thành phần.
Khi nào nên dùng
- ✓Khi bạn đang xây dựng một màn hình ứng dụng di động bằng HeroUI Native.
- ✓Khi bạn muốn thiết lập chủ đề sáng và tối cho một ứng dụng React Native.
- ✓Khi bạn cần tài liệu cho một thành phần HeroUI Native.
Liên kết skill
https://github.com/heroui-inc/heroui/blob/v3/skills/heroui-native/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Xây dựng màn hình đăng nhập cho ứng dụng React Native của tôi với nút và ô nhập văn bản của HeroUI Native.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent đọc tài liệu thành phần native trước khi viết mã, vì các mẫu web không áp dụng cho di động. Nó cài đặt thư viện, thiết lập chủ đề, rồi xây dựng màn hình với đúng các thành phần.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
HeroUI Native Development Guide
HeroUI Native is a component library built on Uniwind (Tailwind CSS for React Native) and React Native, providing accessible, customizable UI components for mobile applications.
Installation
curl -fsSL https://heroui.com/install | bash -s heroui-native
CRITICAL: Native Only - Do Not Use Web Patterns
This guide is for HeroUI Native ONLY. Do NOT apply HeroUI React (web) patterns — the package, styling engine, and color format all differ:
| Feature | React (Web) | Native (Mobile) |
|---|---|---|
| Styling | Tailwind CSS v4 | Uniwind (Tailwind for React Native) |
| Colors | oklch format | HSL format |
| Package | @heroui/react |
heroui-native |
| Platform | Web browsers | iOS & Android |
// CORRECT — Native pattern
import { Button } from "heroui-native";
<Button variant="primary" onPress={() => console.log("Pressed!")}>
Click me
</Button>;
Always fetch Native docs before implementing.
Core Principles
- Semantic variants (
primary,secondary,tertiary) over visual descriptions - Composition over configuration (compound components)
- Theme variables with HSL color format
- React Native StyleSheet patterns with Uniwind utilities
Accessing Documentation & Component Information
For component details, examples, props, and implementation patterns, always fetch documentation:
Using Scripts
# List all available components
node scripts/list_components.mjs
# Get component documentation (MDX)
node scripts/get_component_docs.mjs Button
node scripts/get_component_docs.mjs Button Card TextField
# Get theme variables
node scripts/get_theme.mjs
# Get non-component docs (guides, releases)
node scripts/get_docs.mjs /docs/native/getting-started/theming
Direct MDX URLs
Component docs: fetch .mdx with a concrete kebab-case slug. Run node scripts/list_components.mjs when the slug is unknown, and never fetch a URL that still contains a placeholder.
Examples:
- Button:
https://heroui.com/docs/native/components/button.mdx - Dialog:
https://heroui.com/docs/native/components/dialog.mdx - TextField:
https://heroui.com/docs/native/components/text-field.mdx
Getting started guides: use a concrete topic URL such as https://heroui.com/docs/native/getting-started/quick-start.mdx.
Important: Always fetch component docs before implementing. The MDX docs include complete examples, props, anatomy, and API references.
Installation Essentials
Quick Install
npm i heroui-native react-native-reanimated react-native-gesture-handler react-native-safe-area-context @gorhom/bottom-sheet react-native-svg react-native-worklets tailwind-merge tailwind-variants
Framework Setup (Expo - Recommended)
- Install dependencies:
npx create-expo-app MyApp
cd MyApp
npm i heroui-native uniwind tailwindcss
npm i react-native-reanimated react-native-gesture-handler react-native-safe-area-context @gorhom/bottom-sheet react-native-svg react-native-worklets tailwind-merge tailwind-variants
- Create
global.css:
@import "tailwindcss";
@import "uniwind";
@import "heroui-native/styles";
@source "./node_modules/heroui-native/lib";
- Wrap app with providers:
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { HeroUINativeProvider } from "heroui-native";
import "./global.css";
export default function Layout() {
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<HeroUINativeProvider>
<App />
</HeroUINativeProvider>
</GestureHandlerRootView>
);
}
Critical Setup Requirements
- Uniwind is Required - HeroUI Native uses Uniwind (Tailwind CSS for React Native)
- HeroUINativeProvider Required - Wrap your app with
HeroUINativeProvider - GestureHandlerRootView Required - Wrap with
GestureHandlerRootViewfrom react-native-gesture-handler - Use Compound Components - Components use compound structure (e.g.,
Card.Header,Card.Body) - Use onPress, not onClick - React Native uses
onPressevent handlers - Platform-Specific Code - Use
Platform.OSfor iOS/Android differences
Component Patterns
HeroUI Native uses **compound component pattern
Câu hỏi thường gặp
Tôi có tái sử dụng mã HeroUI web được không?
Không. Thư viện native dùng cách tạo kiểu và định dạng màu khác, nên các mẫu web không áp dụng.
Nó có hỗ trợ chế độ tối không?
Có. Skill bao gồm cách cấu hình chủ đề tối và sáng.
Nó nhắm đến những nền tảng nào?
Nó nhắm đến ứng dụng iOS và Android được xây dựng bằng React Native.
Chi tiết
Mô tả gốc của tác giả
HeroUI Native component library for React Native (Tailwind v4 via Uniwind). Use when building mobile UIs with HeroUI Native — creating Buttons, Cards, TextFields, Dialogs; installing heroui-native; configuring dark/light themes; or fetching component docs. Keywords: HeroUI Native, heroui-native, React Native UI, Uniwind, mobile components.
repo: heroui-inc/heroui
Độ phổ biến
- Sao GitHub
- 31k
- Vị trí xếp hạng
- #9326
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
heroui-migration
31kGiúp agent của bạn nâng cấp ứng dụng web HeroUI v2 lên HeroUI v3, gồm các mẫu thành phần đã thay đổi và các hook đã bị gỡ bỏ.
heroui-react
31kGiúp agent của bạn xây dựng giao diện web React với các thành phần HeroUI v3, như nút, modal, biểu mẫu và card.
Skill tương tự
android-clean-architecture
280kGiúp agent của bạn tổ chức dự án Android hiệu quả, cấu trúc code để việc bảo trì và phát triển tính năng mới dễ dàng hơn.
compose-multiplatform-patterns
280kGiúp agent của bạn dùng các mẫu Compose Multiplatform và Jetpack Compose trong dự án KMP, gồm trạng thái, điều hướng, giao diện và hiệu năng.
dart-flutter-patterns
280kGiúp agent của bạn viết code cho ứng dụng Dart và Flutter. Agent dùng các mẫu hiện đại để tạo ứng dụng vững chắc và dễ quản lý.