@appica/ui-react

中文文档
1.4.0发布于 2026/11/02MITTypeScriptES Module近 30 天下载 2万

Appica UI components library for React applications

原始使用文档
文档目录11 节
  1. Prerequisites
  2. Installation
  3. Configure Tailwind
  4. Without Tailwind
  5. Add the provider
  6. Use a component
  7. For AI agents
  8. Changelog
  9. Figma design file
  10. Stay updated
  11. License

Appica UI for React

npm License: MIT TypeScript Figma

A modern React component library - 70+ accessible, themeable components built on Base UI primitives, animated with Motion, and styled with Tailwind CSS v4 design tokens.

Documentation · Installation guide · Components

Prerequisites

DependencyVersion
React>= 19
React DOM>= 19
Tailwind CSS>= 4.0

React 19 is a hard requirement - components use the modern ref-as-prop API with no forwardRef shims. Tailwind v4 must be set up and compiling in your project first; Appica UI relies on your project's Tailwind to compile the component styles.

Installation

npm install @appica/ui-react
# or
yarn add @appica/ui-react
# or
pnpm add @appica/ui-react
# or
bun add @appica/ui-react

Configure Tailwind

Import the design tokens after Tailwind in your global stylesheet, and add a @source directive so Tailwind scans the compiled library for class names:

@import 'tailwindcss';
@import '@appica/ui-react/styles.css';

@source '../node_modules/@appica/ui-react/dist';

Don't skip @source - and give it a real path.

Tailwind ignores node_modules by default. Without the @source directive it won't generate the utility classes used inside the compiled components, and they'll render unstyled.

@source takes a path or glob relative to the stylesheet that contains it, not a bare package name - @source '@appica/ui-react' does not resolve and silently scans nothing. Count the ../ needed to reach node_modules from your CSS file: a stylesheet one level deep (app/globals.css, src/index.css) needs a single ../; a deeper one (src/styles/app.css) needs ../../. This matches Tailwind's own @source documentation, whose example is @source '../node_modules/@my-company/ui-lib';.

Without Tailwind

Appica UI is built on Tailwind, and the source-scanning setup above is the recommended path. If your project doesn't use Tailwind, skip that step and import the prebuilt stylesheet instead - a single self-contained file with every component's styles and the full token system compiled in:

@import '@appica/ui-react/css';

No bundler? Link it straight from a CDN (pin a version for cache stability):

<link rel="stylesheet" href="https://unpkg.com/@appica/ui-react@latest/appica.css" />

Tailwind stays an optional peer dependency, so nothing installs it on your behalf when you take this path. Design tokens remain CSS variables, so theming still works the same way - redefine the variable after the import:

:root {
  --primary: oklch(60% 0.25 150);
}

Don't load both.

The prebuilt file bundles Tailwind's Preflight reset, and only the token variables (colors, fonts, radii, shadows) stay overridable - structural utilities are frozen at publish time. If you already run Tailwind, use Configure Tailwind instead, or you'll ship the reset and utilities twice.

Add the provider

Wrap your app in ThemeProvider to enable theming and dark mode with no flash of the wrong theme:

import { ThemeProvider } from '@appica/ui-react/providers/theme-provider'

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en" suppressHydrationWarning>
      <body>
        <ThemeProvider>{children}</ThemeProvider>
      </body>
    </html>
  )
}

Use a component

Import components from their subpath for the smallest bundle:

import { Button } from '@appica/ui-react/button'

export default function App() {
  return <Button>Get started</Button>
}

See the installation guide for framework-specific notes (Next.js, Vite, TanStack Start, Remix, Astro), and Theming to customize colors, radii, and tokens.

For AI agents

If you are a coding agent reading this from node_modules, the rules for writing Appica UI code correctly are in agent-rules.md, next to this file. Read it before writing any component or CSS. The two mistakes it prevents are the expensive ones: a missing @source directive renders every component unstyled, and hue-based utilities (bg-gray-100) bypass the token system entirely.

Every documentation page is served as clean markdown at <url>.md - fetch https://appica.dev/ui/components/react/button.md, not the HTML page. The full index, with an instruction block, is at https://appica.dev/ui/react/llms.txt.

If you are a human setting up a project: paste those rules into your own AGENTS.md so your agent loads them every session. See Set up your coding agent for a copy-paste block.

Changelog

What changed in each release is in CHANGELOG.md, next to this file, and on appica.dev/ui/changelog alongside the documentation and Figma updates that shipped with it.

Figma design file

Every component is also available as a free Figma design file - variants, sizes, and states mirrored one-to-one with the code, built on the same design tokens. Design and develop from a single source of truth.

Stay updated

Follow @Appica_dev on X for release announcements and updates.

License

MIT © Appica

Free to use in personal and commercial projects.

版本与发布记录

@appica/ui-react 共发布 6 个版本,首次发布于 2026/07/10;过去 12 个月发布了 6 个版本。

版本发布日期距今
1.4.0latest2026/11/026 天前
1.3.12026/11/016 天前
1.3.02026/10/1226 天前
1.2.02026/09/251 个月前
1.1.02026/08/122 个月前
1.0.02026/07/103 个月前

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

@appica/ui-react 是什么?

Appica UI components library for React applications

如何安装 @appica/ui-react?

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

@appica/ui-react 支持 TypeScript 吗?

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

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

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

@appica/ui-react 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@appica/ui-react 可以商用吗?

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

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

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

@appica/ui-react 还在维护吗?

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