@bigbinary/neetoui-rn

中文文档
3.10.0发布于 2026/11/03MITTypeScriptCommonJS近 30 天下载 2265

neeto UI component library for React Native — v3 (Unistyles, TypeScript, New Architecture)

原始使用文档
文档目录13 节
  1. Documentation
  2. Installation
  3. Jest
  4. Getting Started
  5. Theming
  6. Fonts
  7. Tablet layout
  8. react-native-safe-area-context
  9. SafeAreaProvider
  10. Development
  11. Auto Publish to NPM
  12. Testing with yalc package manager
  13. Learn more about contributing to this repository

neetoUI-RN is the library that drives the experience in all neeto product's React Native application built at BigBinary.

Documentation

Storybook is the documentation: https://neetoui-rn.onrender.com/

Every component has a story next to its source, and the Docs section covers getting started and the theme tokens.

Installation

yarn add @bigbinary/neetoui-rn @gorhom/bottom-sheet @shopify/flash-list react-native-edge-to-edge react-native-gesture-handler react-native-nitro-modules react-native-reanimated react-native-safe-area-context react-native-svg react-native-toast-message react-native-unistyles

Navigate to iOS folder and run:

pod install

All the native components will be linked automatically.

Jest

The package ships untranspiled TypeScript, so consuming apps have to let Jest transform it instead of skipping it as a dependency:

// jest.config.js
transformIgnorePatterns: [
  "node_modules/(?!(@react-native|@bigbinary|@gorhom|@shopify|react-native|react-native-[^/]+)/)",
],

Without this, tests fail on the first import with a syntax error.

Getting Started

Theming

Themes are registered through Unistyles. Call configureNeetoUI from your app's entry point (index.js), before anything else imports a screen:

import { configureNeetoUI } from "@bigbinary/neetoui-rn/unistyles";

configureNeetoUI();

The library ships both a light and a dark theme, and pins the light one by default — it does not follow the device colour scheme. An app that has not designed its own screens for dark mode only half-follows: token-styled surfaces go dark while anything painted from a literal colour stays light, which shows up as dark text on dark backgrounds and a dark status bar under a dark-content bar style.

Once your screens are ready for it, opt in:

configureNeetoUI({ adaptiveThemes: true });

The opt-in is honoured even though importing the library root registers the defaults first, so it works from index.js regardless of module evaluation order.

Fonts

theme.fonts uses Inter (SIL Open Font License, see assets/licenses/Inter-OFL.txt). Link the bundled files from the app's react-native.config.js:

module.exports = {
  assets: ["./node_modules/@bigbinary/neetoui-rn/assets/fonts"],
};

Then run npx react-native-asset, and check that UIAppFonts in Info.plist and android/app/src/main/assets/fonts list only the Inter-*.ttf files.

Upgrading from 3.x, which bundled SF Pro: re-run npx react-native-asset so the SFProText-*.ttf files are unlinked, drop any font option passed to configureNeetoUI, and move styles that hardcode "SFProText-*" names to theme.fonts.

Tablet layout

The pieces a two- or three-pane tablet shell is built from. The shell itself, its navigation and any persisted widths stay in the app.

  • useTabletLayout() returns { width, height, isTablet, isLandscape }. isTablet is true when the window's short side is at least TABLET_MIN_SHORT_SIDE (600dp), so a landscape phone stays on the phone layout. isTabletWindow({ width, height }) is the same check for use outside a component.
  • NavRail is the icon rail: links ({ key, label, Icon, activeOn? }), activeRoute, onNavigate, plus header and footer slots. NavRailItem frames a footer slot; give it onPress for a button, or leave it off to wrap content that handles its own press.
  • ResizeHandle drags the column to its left. The parent owns the width as a reanimated shared value and sizes its Animated.View from it; the handle calls onCommit with the settled width and onReset on a double tap. Pass accessibilityValue ({ min, max, now }) so screen readers can read the width; they adjust it in 20pt steps. clampListWidth keeps a width inside LIST_WIDTH_RANGE and is a worklet.
  • CenteredSheet shows a phone screen as a CENTERED_SHEET_WIDTH card over the pane, with a scrim that calls onClose. Name it with accessibilityLabel.

Constants: RAIL_WIDTH, LIST_WIDTH_DEFAULT, LIST_WIDTH_RANGE, RESIZE_HANDLE_WIDTH, CENTERED_SHEET_WIDTH, TABLET_MIN_SHORT_SIDE.

react-native-safe-area-context

We are using SafeAreaView from react-native-safe-area-context in our ParentView component to handle safe area. Follow the instructions under SafeAreaProvider for the ParentView component to work.

SafeAreaProvider

You should add SafeAreaProvider in your app root component. You may need to add it in other places like the root of modals and routes when using react-native-screens.

Note that providers should not be inside a View that is animated with Animated or inside a ScrollView since it can cause very frequent updates.

Example

import { SafeAreaProvider } from "react-native-safe-area-context";

function App() {
  return <SafeAreaProvider>...</SafeAreaProvider>;
}

Development

Install all the dependencies by executing following command.

yarn

New components go in src/components/<Name>/, are exported from src/index.ts, and carry a colocated <Name>.stories.tsx plus __tests__/.

TaskCommand
Storybook (web)yarn storybook
Build Storybookyarn build-storybook
Testsyarn test
Typesyarn typecheck
Lintyarn lint
On-device harnesssee example/

yarn build-storybook writes static files to storybook-static/.

Auto Publish to NPM

neetoUI-RN version gets patched, auto-incremented and auto-published to npm on new commit to main branch. You can checkout the publish workflow in Github actions to get a live update.

Testing with yalc package manager

To publish locally

yarn build && rm -rf ~/.yalc/packages && yalc publish --private

or

yarn yalc:publish

To install local yalc version of library in any app.

rm -rf .yalc && yalc add @bigbinary/neetoui-rn  && rm -rf node_modules  && yarn

Learn more about contributing to this repository

https://github.com/bigbinary/neeto-ui-rn/blob/main/CONTRIBUTING.md

版本与发布记录

@bigbinary/neetoui-rn 共发布 326 个版本,首次发布于 2021/11/10;过去 12 个月发布了 35 个版本。

版本发布日期距今
3.10.0latest2026/11/035 天前
3.9.12026/11/035 天前
3.8.22026/10/309 天前
3.9.02026/10/2514 天前
3.8.12026/10/2514 天前
3.8.02026/10/2514 天前

关于 @bigbinary/neetoui-rn 的常见问题

@bigbinary/neetoui-rn 是什么?

neeto UI component library for React Native — v3 (Unistyles, TypeScript, New Architecture)

如何安装 @bigbinary/neetoui-rn?

在项目目录运行 npm install @bigbinary/neetoui-rn,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=19.0.0)、react-native(>=0.88)、react-native-svg(>=15.0.0)、@shopify/flash-list(>=2.0.0)、@gorhom/bottom-sheet(^5.2.14)、react-native-webview(>=13)、react-native-worklets(>=0.13)、react-native-unistyles(>=3.2.0)、react-native-reanimated(>=4.7)、react-native-nitro-modules(*)、react-native-toast-message(^2.0.0)、react-native-gesture-handler(>=3.4)、react-native-safe-area-context(>=4.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bigbinary/neetoui-rn 支持 TypeScript 吗?

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

@bigbinary/neetoui-rn 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@bigbinary/neetoui-rn 可以商用吗?

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

@bigbinary/neetoui-rn 的下载量有多少?

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

@bigbinary/neetoui-rn 还在维护吗?

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