@hone-ui/react

中文文档
0.2.0发布于 2026/11/01MITTypeScriptES Module零依赖

React components with a familiar API, built on React Aria and plain CSS.

原始使用文档
文档目录3 节
  1. Install
  2. Set up
  3. Components

@hone-ui/react

React components with the familiar props and theme API. React Aria Components handle behaviour and accessibility, and styles ship as plain CSS that reads theme values from CSS variables.

Pre-release. Full docs, with examples and props for each component: https://hone-ui-docs.vercel.app

Install

npm install @hone-ui/react react-aria-components
npm install -D @hone-ui/sx

React 19 and react-aria-components 1.21 or later are required.

Set up

Add the @hone-ui/sx plugin so sx compiles to CSS. In Vite, list it before react():

// vite.config.ts
import react from '@vitejs/plugin-react';
import sx from '@hone-ui/sx/vite';
import { defineConfig } from 'vite';

export default defineConfig({ plugins: [sx(), react()] });

In Next.js, wrap your existing config and turn on optimizePackageImports:

// next.config.ts
import { withSx } from '@hone-ui/sx/next';

export default withSx({
  experimental: { optimizePackageImports: ['@hone-ui/react'] },
});

Import one look at your app's root, after your own global CSS. Unlayered CSS beats the library, so delete the template's index.css, App.css and globals.css resets, or put them in an earlier @layer.

import './globals.css'; // your own CSS, if you keep any
import '@hone-ui/react/styles/material.css'; // or minimal.css

Wrap the app in ThemeProvider, and add CssBaseline for the page background and font. In Next.js, put the provider in a file marked 'use client'.

import { CssBaseline, createTheme, ThemeProvider } from '@hone-ui/react';

const theme = createTheme();

export function App() {
  return (
    <ThemeProvider theme={theme}>
      <CssBaseline />
      {/* your app */}
    </ThemeProvider>
  );
}

Components

Accordion, Alert, AppBar, Autocomplete, Avatar, Backdrop, Badge, Box, Button, Card, Checkbox, Chip, CircularProgress, CssBaseline, Dialog, Divider, Drawer, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel, IconButton, InputAdornment, InputLabel, LinearProgress, List, Menu, MenuItem, MenuList, Pagination, Paper, Radio, RadioGroup, Select, Skeleton, Slider, Snackbar, Stack, Switch, Table, Tabs, TextField, Toolbar, Tooltip and Typography, plus their parts such as DialogTitle and TableRow.

The package ships an AI guide for every component under @hone-ui/react/ai/, so coding assistants that read node_modules find them. Start at ai/index.md, which lists each guide in one line.

版本与发布记录

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

版本发布日期距今
0.2.0latest2026/11/012 天前
0.0.0-canary-20261101045435canary2026/11/012 天前
0.1.02026/10/2410 天前
0.0.0-canary-202610221552062026/10/2211 天前
0.0.0-stage2026/10/2211 天前

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

@hone-ui/react 是什么?

React组件与熟悉的API,建立在React Aria和纯CSS。

如何安装 @hone-ui/react?

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

@hone-ui/react 支持 TypeScript 吗?

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

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

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

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

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

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

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