react-native-ui-kitten README

项目的 README,来自 github.com/akveo/react-native-ui-kitten。合并为一个 markdown 文件:README.md。

Eva Design System

UI Kitten

React Native UI library built on the Eva Design System.
30+ themeable components, light and dark themes, runtime theme switching, iOS, Android and web.

npm version npm downloads CI MIT license GitHub stars

Documentation · Getting Started · Components · Migrate from v5 · Changelog


UI Kitten 6 is out. It is rebuilt for React 19, React Native 0.81 and the New Architecture. Upgrading from 5.x? Read the 5.x to 6 migration guide.

Features

Installation

UI Kitten needs two packages plus react-native-svg:

# Expo
npx expo install @ui-kitten/components @ui-kitten/eva react-native-svg

# Bare React Native
npm install @ui-kitten/components @ui-kitten/eva react-native-svg
cd ios && pod install

Optional packages:

npm install @ui-kitten/eva-icons          # Eva Icons pack
npm install @ui-kitten/moment             # Calendar / Datepicker with moment
npm install @ui-kitten/date-fns           # Calendar / Datepicker with date-fns
npm install -D @ui-kitten/metro-config    # Build-time style processing

Starting from scratch? npx create-expo-app@latest MyApp and then run the Expo command above inside it. The Getting Started guide covers both paths in detail.

Quick start

Wrap your app root in ApplicationProvider and pass it the Eva mapping and a theme:

import React from 'react';
import * as eva from '@ui-kitten/eva';
import { ApplicationProvider, Button, Layout, Text } from '@ui-kitten/components';

const HomeScreen = () => (
  <Layout style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
    <Text category='h1'>Hello UI Kitten</Text>
    <Button appearance='outline' status='primary'>
      GET STARTED
    </Button>
  </Layout>
);

export default () => (
  <ApplicationProvider {...eva} theme={eva.light}>
    <HomeScreen />
  </ApplicationProvider>
);

Switch to eva.dark, or spread your own theme over it, and every component re-renders with the new palette. See Branding and Runtime Theming.

Compatibility

Dependency Minimum Tested with
react 18.2 19.1
react-native 0.72 0.81 (New Architecture)
react-native-svg 13 15.12
Expo SDK 49 SDK 54
React Native Web 0.19 0.21

Packages

Package Version Description
@ui-kitten/components npm The components, theming hooks and ApplicationProvider.
@ui-kitten/eva npm Eva mapping plus the light and dark themes. Required.
@ui-kitten/material npm Alternative Material-flavoured mapping and themes.
@ui-kitten/eva-icons npm 480+ Eva Icons as an IconRegistry pack.
@ui-kitten/moment npm moment date service for Calendar and Datepicker.
@ui-kitten/date-fns npm date-fns date service for Calendar and Datepicker.
@ui-kitten/metro-config npm Metro plugin that precompiles Eva mappings at build time.
@ui-kitten/processor npm Mapping processor. Replaces @eva-design/dss and @eva-design/processor.
@ui-kitten/mapping-base npm Shared mapping schema used by eva and material.
@ui-kitten/codemod npm Rewrites a v5 app for v6 and reports what it could not touch.

Migrating from v5

Package names, component names and props are unchanged. The breaking changes are the move from class to function components (ref types), the removal of the styled decorator in favour of useStyled, and enforced peer dependencies. The migration guide lists every change with a fix.

npx @ui-kitten/codemod rewrites the mechanical parts and leaves a report of what it could not touch; add --write to apply. Source in src/codemod.

Documentation and examples

Contributing

Issues and pull requests are welcome. The repository is a Yarn 3 + Turborepo monorepo; the packages live in src/* and the docs site in website/.

yarn install
yarn build       # build every package
yarn test        # jest
yarn lint
yarn typecheck
yarn docs:dev    # docs site at localhost:3000

Every user-facing change needs a changeset (yarn changeset). Releases are automated from master and next; see RELEASING.md.

Questions and ideas belong in GitHub Discussions; bugs in Issues.

License

MIT.

UI Kitten was created by the Akveo team. The v6 rewrite and current maintenance are by Vlad Bataev and the UI Kitten contributors. The Eva processor and mapping packages are derived from @eva-design/*; see NOTICE. The icons in @ui-kitten/eva-icons are Eva Icons by Akveo, MIT licensed; see that package's LICENSE.

react-native-ui-kitten (akveo/react-native-ui-kitten)

正在搜索数据库…

这是什么?UI Kitten 是一个基于 Eva Design System 的 React Native UI 组件库:提供风格统一、通用的组件,用于构建多品牌跨平台移动应用,并且主题可以在运行时切换。
它是一个完整的框架,还是我添加到现有 React Native 应用里的库?是一个库,不是框架:你把它安装到 React Native 项目中,用它的现成组件来搭建界面。它声明的依赖只有 react 和 react-native。
我怎么用它新建一个应用?运行 README 里的 Quick Start 命令,就会从 UI Kitten 模板生成一个全新的应用(也提供 TypeScript 版本),拿到一个已经配置好这个库的 React Native 应用。
在添加它之前,我的项目需要准备什么?只需要一套现成的 React Native 环境——这个包本身只依赖 react 和 react-native,而且仓库里只有纯 TypeScript 工具链(jest、eslint、gulp)。
它只支持手机,还是同一份代码也能跑在网页上?README 承诺的是跨平台移动应用,仓库同时也通过 react-native-web 提供网页支持;当前版本面向 React 19 和 React Native 0.81。
我能在正式产品里免费使用它吗?可以——它采用 MIT 许可证,100% 免费开源。背后的团队 Akveo 另外出售专业支持服务,但库本身没有任何付费版本。
开箱即用我能得到什么?25 个以上通用组件(按仓库自己的统计是 30 多个)、一套带浅色和深色主题的主题系统,以及 480 多个 Eva SVG 图标,还有满是示例的文档。
我的应用能不重新加载就切换主题吗?能——主题可以在运行时切换,不需要重新加载应用。你可以用内置的浅色和深色主题,也可以创建自己的主题;Eva 和 Material 两套主题都支持,样式按需编译。
有没有现成的示例应用可以学习?有 Kitten Tricks——一个官方的 React Native 起步项目,包含 40 多个深色和浅色主题的界面。你可以直接使用这些布局,也可以下载源码在自己的应用里复用。
它为什么要基于 Eva Design System?Eva 能让设计和开发保持一致、易于扩展:组件都遵循 Eva 规范,所以用基础组件搭建出来的界面外观统一、精致——Akveo 的 Eva Icons 用的也是同一套体系。
作者
akveo
大小
355.8 MB
星标
10.7K
时长
9年
提交 · 90 天