@beyondcorp/beyond-ui-native

中文文档
0.1.15发布于 2026/10/28MITTypeScriptESM + CJS近 30 天下载 2762

Accessible, NativeWind-first React Native component library for Beyond Softwares

原始使用文档
文档目录17 节
  1. Highlights
  2. Installation
  3. 1. Configure Tailwind Preset
  4. 2. Wrap App with BeyondUIProvider
  5. Component Catalogue
  6. 1. Primitives & Layout
  7. 2. Typography
  8. 3. Actions & Forms
  9. 4. Overlays & Feedback
  10. 5. Data Display
  11. Production Screen Templates
  12. Sign In Screen
  13. Dashboard Screen
  14. Settings & Profile Screen
  15. Monorepo Architecture
  16. Scripts
  17. License

@beyondcorp/beyond-ui-native

A NativeWind-first, accessible, TypeScript-first React Native component library by Beyond Softwares.

Built as the mobile counterpart to @beyondcorp/beyond-ui, Beyond UI Native brings unified design tokens, accessible primitives, compound components, reusable screen templates, and production-ready mobile patterns to React Native and Expo.


Highlights

  • ⚡ NativeWind v4-first: Style universal mobile components using intuitive Tailwind CSS classes.
  • ♿ Accessible by default: Built on top of @rn-primitives (headless Radix primitives for React Native) and dedicated a11y helpers for screen readers, focus states, and ARIA roles.
  • 🎨 Design Token Parity: Synchronized 50–950 shade scales (primary, secondary, danger/destructive, success, warning, neutral), semantic dark/light mode tokens, and border radii matching the Beyond UI web ecosystem.
  • 🧩 Compound Components: Highly composable APIs for Dialogs, Bottom Sheets, Accordions, Tabs, Selects, Cards, and Alerts.
  • 📱 Screen Templates: Ready-to-use production mobile screen templates for Authentication (Sign In, Sign Up, Forgot Password), Dashboard Overview, and Profile/Settings.
  • 🔔 Built-in Toast & Portals: Zero-configuration overlay portals and animated toast banners with useToast().
  • 📦 Dual Module Formats: Pre-bundled ESM (.mjs), CommonJS (.js), and full TypeScript definitions (.d.ts, .d.mts).

Installation

# In your Expo or React Native app:
npm install @beyondcorp/beyond-ui-native
npx expo install nativewind tailwindcss react-native-reanimated

1. Configure Tailwind Preset

Add the Beyond UI Native preset to your tailwind.config.js:

// tailwind.config.js
module.exports = {
  content: [
    "./app/**/*.{js,jsx,ts,tsx}",
    "./src/**/*.{js,jsx,ts,tsx}",
    "./node_modules/@beyondcorp/beyond-ui-native/dist/**/*.{js,mjs}",
  ],
  presets: [
    require("nativewind/preset"),
    require("@beyondcorp/beyond-ui-native/preset"),
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

2. Wrap App with BeyondUIProvider

import React from "react";
import { BeyondUIProvider } from "@beyondcorp/beyond-ui-native";
import { MainNavigator } from "./navigation";

export default function App() {
  return (
    <BeyondUIProvider defaultColorScheme="system">
      <MainNavigator />
    </BeyondUIProvider>
  );
}

Component Catalogue

1. Primitives & Layout

  • Box: Polymorphic container with forwarded ref, NativeWind class support, and accessibility props.
  • Pressable: Interactive touch target with built-in press feedback (opacity, scale, none).
  • Separator: Accessible horizontal and vertical layout divider.

2. Typography

  • Heading: Semantic header (h1 through h6, or numeric levels 1–6).
  • Text: Body text supporting variants (body, muted, caption, lead, error).

3. Actions & Forms

  • Button: Variants (primary, secondary, destructive, danger, outline, ghost, link), sizes (sm, md, lg, xl), and loading spinners.
  • Input: Text input with leftIcon/rightIcon, leftElement/rightElement, error messaging, and helper text.
  • Textarea: Multiline text input with border focus states and validation styling.
  • Select: Mobile-optimized picker with trigger, searchable options sheet, checkmark selection, and compound parts (SelectTrigger, SelectContent, SelectItem, SelectValue).
  • Switch: Smooth toggle switch with dark mode theme support.
  • Checkbox: Accessible checkbox with check indicator.
  • RadioGroup & Radio: Single-select radio group.

4. Overlays & Feedback

  • Dialog: Compound modal dialog (DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter, DialogClose).
  • BottomSheet: Slide-up sheet modal with drag-down-to-dismiss gesture, backdrop scrim, handle bar, header, and body.
  • Accordion: Expandable accordion sections (AccordionItem, AccordionTrigger, AccordionContent) supporting single or multiple items.
  • Toast: Context-driven animated notifications via useToast() (toast.success(), toast.error(), toast.warning(), toast.info()).
  • Alert: Status alert banner (AlertTitle, AlertDescription).
  • Spinner: Animated activity indicator.
  • Skeleton: Pulsing placeholder for asynchronous data loading.

5. Data Display

  • Card: Compound card container (CardHeader, CardTitle, CardDescription, CardContent, CardFooter).
  • Badge: Status badge supporting primary, secondary, success, warning, danger, and outline.
  • Avatar: User avatar with automatic fallback initials (AvatarImage, AvatarFallback).
  • StatsCard: Metrics card with trend percentage indicator, icon, and description.
  • DataTable: Mobile-responsive data table and card list with search filter, sortable columns, and pagination.
  • Tabs: Segmented tab control (TabsList, TabsTrigger, TabsContent).

Production Screen Templates

Beyond UI Native includes ready-to-use, fully functional mobile screen templates under @beyondcorp/beyond-ui-native:

import {
  SignInTemplate,
  SignUpTemplate,
  ForgotPasswordTemplate,
  DashboardTemplate,
  SettingsTemplate,
} from "@beyondcorp/beyond-ui-native";

Sign In Screen

<SignInTemplate
  title="Welcome Back"
  subtitle="Sign in to your Beyond account"
  onSubmit={({ email, password, rememberMe }) => handleLogin(email, password)}
  onForgotPassword={() => navigation.navigate("ForgotPassword")}
  onSignUpPress={() => navigation.navigate("SignUp")}
  onGooglePress={handleGoogleLogin}
  onApplePress={handleAppleLogin}
/>

Dashboard Screen

<DashboardTemplate
  userName="Mark"
  userRole="Principal Engineer"
  metrics={[
    { id: "1", title: "Revenue", value: "$48,500", trend: { direction: "up", value: "+14.2%", label: "this month" } },
    { id: "2", title: "Active Users", value: "12,400", trend: { direction: "up", value: "+6.8%", label: "growth" } },
  ]}
  quickActions={[
    { id: "1", label: "New Project", icon: "🚀", onPress: () => {} },
    { id: "2", label: "Export", icon: "📊", onPress: () => {} },
  ]}
  recentActivities={[
    { id: "1", title: "New Order #1084", subtitle: "2 items", timestamp: "5m ago", amount: "$149.00", status: { label: "Completed", variant: "success" } },
  ]}
/>

Settings & Profile Screen

<SettingsTemplate
  user={{ name: "Mark Otto", email: "[email protected]", plan: "Enterprise" }}
  pushNotifications={pushEnabled}
  onTogglePushNotifications={setPushEnabled}
  isDarkMode={colorScheme === "dark"}
  onToggleDarkMode={toggleColorScheme}
  onLogout={handleLogout}
  onDeleteAccount={handleDeleteAccount}
/>

Monorepo Architecture

beyond-ui-native/
├── packages/
│   └── beyond-ui-native/      # The npm package (@beyondcorp/beyond-ui-native)
│       ├── src/
│       │   ├── components/    # 20+ production UI components
│       │   ├── primitives/    # Box, Pressable layout primitives
│       │   ├── templates/     # Auth, Dashboard, Settings templates
│       │   ├── providers/     # BeyondUIProvider & Portal host
│       │   ├── theme/         # Design tokens & Tailwind preset
│       │   └── utilities/     # cn (clsx + tailwind-merge) & a11y helpers
│       ├── tests/             # Automated test suite
│       └── tsup.config.ts     # ESM, CJS & DTS rollup
├── apps/
│   └── example/               # Expo SDK 52 interactive showcase app
└── .github/
    └── workflows/             # CI & Release automation pipelines

Scripts

# Build the component library
npm run build

# Run TypeScript typechecks
npm run typecheck

# Run unit test suite
npm test

# Start the Expo example application
npm run example:start

License

MIT © Beyond Softwares

版本与发布记录

@beyondcorp/beyond-ui-native 共发布 16 个版本,首次发布于 2026/10/26;过去 12 个月发布了 16 个版本。

版本发布日期距今
0.1.15latest2026/10/2810 天前
0.1.142026/10/2810 天前
0.1.132026/10/2811 天前
0.1.122026/10/2811 天前
0.1.112026/10/2811 天前
0.1.102026/10/2811 天前

关于 @beyondcorp/beyond-ui-native 的常见问题

@beyondcorp/beyond-ui-native 是什么?

Accessible, NativeWind-first React Native component library for Beyond Softwares

如何安装 @beyondcorp/beyond-ui-native?

在项目目录运行 npm install @beyondcorp/beyond-ui-native,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18.2.0)、nativewind(^4.0.1)、react-native(>=0.74.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@beyondcorp/beyond-ui-native 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@beyondcorp/beyond-ui-native 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@beyondcorp/beyond-ui-native 可以商用吗?

@beyondcorp/beyond-ui-native 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@beyondcorp/beyond-ui-native 的下载量有多少?

根据 npm 官方下载统计,@beyondcorp/beyond-ui-native 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,762 次,日均约 92 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@beyondcorp/beyond-ui-native 还在维护吗?

最新版本 0.1.15 发布于 2026/10/28(10 天前);至今共发布 16 个版本,其中过去 12 个月发布了 16 个;首次发布于 2026/10/26。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。