@delacour/react-native-ui

中文文档
0.9.0发布于 2026/11/11MITES Module构建来源已验证近 30 天下载 1.3万

React Native UI components — Uniwind, Reanimated, Gesture Handler

原始使用文档
文档目录6 节
  1. Install
  2. Setup
  3. Usage
  4. Components
  5. Theming
  6. Documentation

@delacour/react-native-ui

A React Native component library. Styling is Uniwind — Tailwind v4 for React Native; interaction is Reanimated and Gesture Handler; haptics are Pulsar.

The package ships raw .tsx with no build step. Uniwind's transform has to run inside the consuming app's Metro pipeline, so a precompiled build would arrive with its classNames already dead.

Install

bun add @delacour/react-native-ui

Native modules are peer dependencies, because two copies of a native module register twice and break at runtime. The complete list — native modules through expo install, the rest through your package manager — is derived from the components' own imports and kept on the Installation page. Six peers are optional and resolve only if you import the subpath that needs them:

PeerNeeded for
expo-router@delacour/react-native-ui/expo/navigation-theme
@legendapp/listScreen.LegendList, Screen.ChatList and BottomSheet.LegendList
react-native-screensnative stack navigation
@delacour/react-native-chartsChart
@delacour/react-native-bottom-sheetBottomSheet — the engine it skins
react-native-teleportBottomSheet — the engine's portal; a native module, so rebuild the dev client after installing

Granular exports are what make that safe: an app that never imports a subpath never makes Metro resolve its peers.

Setup

1. Styles. In your app's global.css:

@import '@delacour/react-native-ui/styles';
@source '../../../../packages/react-native-ui/src';

Use the real workspace path, not a node_modules one — Bun symlinks workspace packages and Tailwind's scanner cannot follow symlinks, so classes would be silently dropped from production builds.

2. Provider. Wrap the app's root:

import { DelacourProvider } from "@delacour/react-native-ui/provider";

<DelacourProvider>{children}</DelacourProvider>;

That is the gesture root every Pressable needs above it, the safe-area provider and keyboard provider Screen reads, and the keyboard state sync that keeps them honest. An app with a BottomSheet mounts BottomSheetProvider inside it, from @delacour/react-native-ui/bottom-sheet — the sheet's engine is an optional peer, so the provider cannot.

Usage

There is no package-wide barrel. Import from the subpath:

import { Button } from "@delacour/react-native-ui/button";
import { Icon } from "@delacour/react-native-ui/icon";
import { IconArrowRight } from "@delacour/react-native-ui/icons/central";

// The icon inherits the button's size and its variant's colour.
<Button haptic="selection" onPress={next}>
  <Button.Label>Continue</Button.Label>
  <Icon icon={IconArrowRight} />
</Button>;

Components

ComponentImport
Accordion@delacour/react-native-ui/accordionSelection modes, measured panels, indicators
Badge@delacour/react-native-ui/badgeVariants, colours, sizes, dismiss
BottomSheet@delacour/react-native-ui/bottom-sheetSnap points, keyboard, sticky footer, scrollables, steps, detached, teleported portal
Button@delacour/react-native-ui/buttonVariants, sizes, icons, loading
Checkbox@delacour/react-native-ui/checkboxColours, sizes, indeterminate, groups
Field@delacour/react-native-ui/fieldForm layout, grouping, state cascade
Icon@delacour/react-native-ui/iconCentral Icons, with inherited size and colour
Input@delacour/react-native-ui/inputVariants, sizes, prefix and suffix
ListGroup@delacour/react-native-ui/list-groupGrouped rows, dividers, slots
Pressable@delacour/react-native-ui/pressableGestures, haptics, asChild
Radio@delacour/react-native-ui/radioGroups, selection, sizes, orientation
Screen@delacour/react-native-ui/screenNavbar, footer, scrollables, keyboard
Separator@delacour/react-native-ui/separatorOrientations, insets, weight
Slider@delacour/react-native-ui/sliderRange, orientation, colours, steps
Spinner@delacour/react-native-ui/spinnerSizes, colours, custom glyphs
Switch@delacour/react-native-ui/switchDrag or tap, colours, sizes, end content
Tabs@delacour/react-native-ui/tabsVariants, sizes, swipe, scrolling
Text@delacour/react-native-ui/textType scale, presets, inline nesting
DelacourProvider@delacour/react-native-ui/providerThe app's root layer stack

Also exported: hooks/*, lib/*, expo/navigation-theme, icons/central, and the styles/* CSS entries.

Theming

Tokens are CSS variables under @variant light / @variant dark. Components reference semantic names — bg-background, text-muted-foreground — never a raw palette colour or a dark: prefix. For a prop needing a colour value rather than a class, use useThemeColor.

Documentation

AGENTS.md is the reference — the rules, the patterns, and the reasoning behind each decision. Each component has its own alongside its source in src/components.

版本与发布记录

@delacour/react-native-ui 共发布 160 个版本,首次发布于 2026/09/22;过去 12 个月发布了 160 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.0latest2026/11/111 天前
0.9.0-alpha.20261110170610alpha2026/11/111 天前
0.9.0-alpha.202611092058422026/11/102 天前
0.9.0-alpha.202611092057322026/11/102 天前
0.9.0-alpha.202611092050532026/11/102 天前
0.9.0-alpha.202611092017592026/11/102 天前

关于 @delacour/react-native-ui 的常见问题

@delacour/react-native-ui 是什么?

React Native UI components — Uniwind, Reanimated, Gesture Handler

如何安装 @delacour/react-native-ui?

在项目目录运行 npm install @delacour/react-native-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=19)、uniwind(^1.11.0)、tailwindcss(^4)、react-native(>=0.88)、react-native-svg(>=15)、react-native-pulsar(^1.7.0)、expo-linear-gradient(>=15)、react-native-worklets(>=0.5)、react-native-reanimated(>=4)、react-native-gesture-handler(>=3.3)、react-native-safe-area-context(>=5)、react-native-keyboard-controller(>=1.18)、@central-icons-react-native/round-outlined-radius-1-stroke-1.5(^1.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@delacour/react-native-ui 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/delacour__react-native-ui 是否存在。

@delacour/react-native-ui 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@delacour/react-native-ui 可以商用吗?

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

@delacour/react-native-ui 的下载量有多少?

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

@delacour/react-native-ui 还在维护吗?

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