Home
Softono
ant-design-mobile-rn

ant-design-mobile-rn

Open source MIT TypeScript
3.3K
Stars
614
Forks
47
Issues
44
Watchers
1 week
Last Commit

About ant-design-mobile-rn

English | [简体中文](./README.zh-CN.md) <p align="center"> <a href="http://rn.mobile.ant.design"> <img width="320" src="https://zos.alipayobjects.com/rmsportal/wIjMDnsrDoPPcIV.png"> </a> </p> # Ant Design Mobile RN [![](https://img.shields.io/travis/ant-design/ant-design-mobile-rn.svg?style=flat-square)](https://travis-ci.org/ant-design/ant-design-mobile-rn) [![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design-mobile-rn.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design-mobile-rn) [![npm package](https://img.shields.io/npm/v/@ant-design/react-native.svg?style=flat-square)](https://www.npmjs.org/package/@ant-design/react-native) [![NPM downloads](http://img.shields.io/npm/dm/@ant-design/react-native.svg?style=flat-square)](https://npmjs.org/package/@ant-design/react-native) [![Dependency Status](https://david-dm.org/ant-design/ant-design-mobile-rn.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design-mobile-rn) [![Percentage of issues still open](ht ...

Platforms

Web Self-hosted iOS Android

Languages

TypeScript

English | 简体中文

Ant Design Mobile RN

Codecov npm package NPM downloads Dependency Status Percentage of issues still open Join the chat at https://gitter.im/ant-design/ant-design

A configurable Mobile UI specification and React-based implementation.

If you only care about the style you may give [Tanjun] a try.

Features

  • Follow Ant Design Mobile UI specification.
  • Configurable UI style for different products.
  • Support web and native usages based on React Native.
  • Develop in TypeScript.

Expo

HTML5 Preview: ant-design-mobile-rn/index.html

SDK 54([email protected])
expo/ant-design-mobile-rn

Open the camera app on your device and scan the code above,
need install expo app: https://expo.io/tools

Expo SDK(47, 49, 50, 51, 52) history version
SDK 47 iOS SDK 47 Android SDK 49,50 SDK 51 SDK 52
expo/ant-design-mobile-rn expo/ant-design-mobile-rn expo/ant-design-mobile-rn expo/ant-design-mobile-rn expo/ant-design-mobile-rn

Install & Usage

$ npm install @ant-design/react-native @ant-design/icons-react-native

Installing peer dependencies

Next, install the required peer dependencies. You need to run different commands depending on whether your project is an Expo managed project or a bare React Native project.

  • If you have an Expo managed project, install the dependencies with expo:

    npx expo install react-native-gesture-handler react-native-reanimated
  • If you have a bare React Native project, install the dependencies with npm:

    npm install react-native-gesture-handler react-native-reanimated react-native-worklets

    you also need to manually add the react-native-worklets/plugin plugin to your babel.config.js

     module.exports = {
         presets: [
           ... // don't add it here :)
         ],
         plugins: [
           ...
           'react-native-worklets/plugin',
         ],
       };

    see more details in react-native-reanimated installation doc

  • For iOS with bare React Native project, make sure you have CocoaPods installed. Then install the pods to complete the installation:

    cd ios
    pod install
    cd ..

Link icon fonts

Add assets to your react-native.config.js ( If not exist, please create in project’s root directory )

module.exports = {
  assets: ['node_modules/@ant-design/icons-react-native/fonts'],
};

Run the react-native-asset's command and linking + unlinking is automatic

npx react-native-asset

Links

Development

  • Running On Expo

node >= 18

# go to expo example folder
cd example

# install dependencies
yarn

# start expo
yarn expo
  • Running On Device
# clone
git clone [email protected]:ant-design/ant-design-mobile-rn.git

# go to ant rn folder
cd ant-design-mobile-rn

# install dependencies
yarn

# start ios
cd rn-kitchen-sink/ios && pod install
yarn ios

# start android
yarn android

Contributing

We welcome all contributions, please read our CONTRIBUTING.md first. You can submit any ideas as pull requests or as a GitHub issue. If you'd like to improve code, check out the Development Instruction and have a good time! :)


Thanks to all the contributors of @ant-design/react-native:

contributors