@asheeui/native

中文文档
2.9.2发布于 2026/11/08Apache-2.0TypeScriptESM + CJS近 30 天下载 1705

React Native components styled with NativeWind, sharing the AsheeUI design language and component contracts.

原始使用文档
文档目录7 节
  1. Features
  2. Requirements
  3. Installation
  4. Quick start
  5. Documentation
  6. Links
  7. License

@asheeui/native

AsheeUI on React Native: the same component vocabulary, the same prop contracts and the same design language as the web renderer, built from the platform's own components so a screen behaves the way the platform behaves. Styling is NativeWind, and the layer both renderers share is @asheeui/core.

Features

  • The whole component set — every one of the 58 components the compatibility matrix promises for native is implemented: the layout kit, the field family, the feedback and state family, the navigation, the overlays, the page shell and the marketing bands.
  • One vocabulary across platforms — a component is imported by the same name and takes the same props as its web counterpart, so a screen and a page can share their composition.
  • A layout kit and responsiveness — Container, Stack/HStack/VStack, Grid, Section, Split and Page with its header, content and footer, plus useBreakpoint with the pure resolveBreakpoint and resolveGridColumns.
  • Config-driven — every component registers its defaults and resolves them through the same cascade the renderer reads, so a value can be set globally, per component or per instance.
  • The platform's accessibility — roles and state are stated in the platform's own vocabulary, and each component's tests assert them.
  • TypeScript-first — fully typed props with JSDoc on every exported symbol.

Requirements

  • React 18.2 or newer, or 19
  • React Native 0.78 or newer, through Expo or a bare project
  • NativeWind 4.2 or newer, with Tailwind CSS 3.x — NativeWind v4 does not compile with Tailwind v4, which is what the web renderer uses
  • Node.js 22.12 or newer for development

Installation

npm install @asheeui/native

The package expects the application to provide the platform's toolchain, so its setup adapts the application's own configuration rather than replacing it. Three files and one provider:

// babel.config.js — the interop runtime, which is what turns a className into a style
presets: [
  ["babel-preset-expo", { jsxImportSource: "nativewind" }],
  "nativewind/babel",
];

// metro.config.js — the stylesheet NativeWind compiles (import it from App.tsx too)
module.exports = withNativeWind(getDefaultConfig(__dirname), {
  input: "./global.css",
});

// tailwind.config.js — NativeWind's preset, the eight colour roles as the properties the
// provider paints, and the package's own classes; the globs are absolute, so any install
// layout works
const asheeui = require("@asheeui/native/tailwind-preset");

module.exports = {
  presets: [asheeui],
  content: ["./src/**/*.{ts,tsx}", ...asheeui.content],
};

Then wrap the application root in AsheeUIProvider — the same name the web renderer uses, with the same configuration: the axes, the component sections, the palette (color) and defaultTheme, which follows the device's colour scheme (AsheeNativeProvider is the same component under its platform name). Three things are worth knowing before the first screen:

  • Do not install react-native-css-interop yourself. NativeWind 4.2.7 ships the copy it needs; a pin of your own resolves instead of it, and every component renders unstyled with nothing thrown.
  • The palette comes from the configuration, not from tailwind.config.js. The preset states each role as rgb(var(--ashee-<role>) / <alpha-value>) and the provider supplies the values, so a theme.extend.colors entry for a role fixes it at build time and stops it following defaultTheme. The provider accepts the web renderer's own ExternalConfig plus the platform-only defaultSize, so one configuration object — typed ExternalConfig, or AsheeConfig from asheeui — describes both renderers.
  • A development build says so when the pipeline is not connected. The provider checks the runtime, the compiled stylesheet and the preset once on mount and warns with the cause it found; verifyNativeWind() returns the same diagnosis as data.

React Native documents each step, what each failure looks like, and the order to check them in.

The published entry points are the package root, @asheeui/native/section-kit and @asheeui/native/tailwind-preset; there are no per-component subpaths, so a component is imported by name from the root and a bundle is reduced by the bundler rather than by the import path.

Quick start

import { AsheeNativeProvider, Button, Card, Text } from "@asheeui/native";

export function Screen() {
  return (
    <AsheeNativeProvider>
      <Card title="Invoices" description="Three are waiting for approval.">
        <Text>Nothing leaves the device until you send it.</Text>
        <Button onPress={() => undefined}>Approve all</Button>
      </Card>
    </AsheeNativeProvider>
  );
}

Documentation

The documentation is the website, which renders every page as a per-page .md variant and as one llms-full.txt:

License

AsheeUI is licensed under the Apache License 2.0; the LICENSE file ships with this package, and the copyright and attribution notices are in NOTICE beside it. Licensing explains what redistribution requires.

版本与发布记录

@asheeui/native 共发布 11 个版本,首次发布于 2026/10/08;过去 12 个月发布了 11 个版本。

版本发布日期距今
2.9.2latest2026/11/082 天前
2.9.12026/11/054 天前
2.9.02026/11/019 天前
2.8.02026/10/319 天前
2.7.02026/10/2812 天前
2.6.02026/10/2713 天前

关于 @asheeui/native 的常见问题

@asheeui/native 是什么?

React Native components styled with NativeWind, sharing the AsheeUI design language and component contracts.

如何安装 @asheeui/native?

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

@asheeui/native 支持 TypeScript 吗?

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

@asheeui/native 支持 ESM 还是 CommonJS?

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

@asheeui/native 可以商用吗?

@asheeui/native 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@asheeui/native 的下载量有多少?

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

@asheeui/native 还在维护吗?

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