react-native-ui-lib

UI Components Library for React Native

Github星跟蹤圖


Build Status
npm
NPM Downloads

Read more in our Wiki.
Check out our Docs.
Our Discord Channel

Installing

See setup instructions here.

New Major Version 5.0

See breaking changes

For React Native >= 0.60.0

please use react-native-ui-lib@^4.0.0

For React Native < 0.60.0

please use react-native-ui-lib@^3.0.0

Create your own Design System in 3 easy steps

Step 1

Load your foundations and presets (colors, typography, spacings, etc...)

// FoundationConfig.js

import {Colors, Typography, Spacings} from 'react-native-ui-lib';

Colors.loadColors({
  primaryColor: '#2364AA',
  secondaryColor: '#81C3D7',
  textColor: '##221D23',
  errorColor: '#E63B2E',
  successColor: '#ADC76F',
  warnColor: '##FF963C'
});

Typography.loadTypographies({
  heading: {fontSize: 36, fontWeight: '600'},
  subheading: {fontSize: 28, fontWeight: '500'},
  body: {fontSize: 18, fontWeight: '400'},
});

Spacings.loadSpacings({
  page: 20,
  card: 12,
  gridGutter: 16
});

Step 2

Set default configurations to your components

// ComponentsConfig.js

import {ThemeManager} from 'react-native-ui-lib';

// with plain object
ThemeManager.setComponentTheme('Card', {
  borderRadius: 8
});

// with a dynamic function
ThemeManager.setComponentTheme('Button', (props, context) => {
  // 'square' is not an original Button prop, but a custom prop that can
  // be used to create different variations of buttons in your app
  if (props.square) {
    return {
      borderRadius: 0
    };
  }
});

Step 3

Use it all together.
Your configurations will be applied on uilib components so you can use them easily with modifiers.

// MyScreen.js

import React, {Component} from 'react';
import {View, Text, Card, Button} from 'react-native-ui-lib';

class MyScreen extends Component {
  render() {
    return (
      <View flex padding-page>
        <Text heading marginB-s4>My Screen</Text>
        <Card height={100} center padding-card marginB-s4>
          <Text body>This is an example card </Text>
        </Card>
        
        <Button label="Button" body bg-primaryColor square></Button>
      </View>
    );
  }
}

主要指標

概覽
名稱與所有者wix/react-native-ui-lib
主編程語言TypeScript
編程語言Java (語言數: 12)
平台
許可證MIT License
所有者活动
創建於2017-02-08 09:55:18
推送於2025-06-21 13:44:34
最后一次提交2025-06-19 11:31:39
發布數1057
最新版本名稱7.43.0 (發布於 2025-05-28 08:35:01)
第一版名稱v0.0.2 (發布於 2017-02-26 18:01:56)
用户参与
星數6.9k
關注者數319
派生數734
提交數4.6k
已啟用問題?
問題數698
打開的問題數40
拉請求數2385
打開的拉請求數11
關閉的拉請求數504
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?