Easy to Use UI Components for React Native

Easy to Use UI Components for React Native

Easy to use UI components for React Native. Creating an app has never been easier!

React Native Basic UI

  • ✅ highly performant
  • ✅ lightweight
  • ✅ customizable
  • ✅ easy to use
  • ✅ typed
  • ✅ documented
  • ✅ accessible
  • ✅ compatible with Expo

Screenshots

Getting started

yarn add react-native-basic-ui

or

npm install react-native-basic-ui

Also, complete installation of react-native-vector-icons and react-native-linear-gradient, otherwise you won't be able to use the Icon component and linear gradients.

Usage

Theme provider

You have to add a theme context to your app's root component. A default theme will be used.

import { ThemeProvider } from 'react-native-basic-ui';

const App = () => {
    return (
        <ThemeProvider>
            ...
        </ThemeProvider>
    );
}

Theme config

But you can set your own primitives and overwrite the default theme. For example:

import { defaultTheme, ThemeProvider } from 'react-native-basic-ui';

const customTheme = {
    ...defaultTheme,
    colors: {
        ..defaultTheme.colors,
        primary: 'green',
    },
};

const App = () => {
    return (
        <ThemeProvider value={customTheme}>
            ...
        </ThemeProvider>
    );
}

Components

Once you have included ThemeProvider in your app, you can use the components:

import { Button, CenterContainer } from 'react-native-basic-ui';

const ExampleComponent = () => {
    return (
        <CenterContainer>
            <Button text="Hello world" />
        </CenterContainer>
    );
};

Custom components with the theme

To use the theme in your own components, you can use useStyles hook. You can define styles while using theme primitives:

import { useStyles } from 'react-native-basic-ui';

const injectTheme = ({ colors, radiuses, spacing }) =>
    StyleSheet.create({
        container: {
            backgroundColor: colors.primary,
            borderRadius: radiuses.medium,
            borderTopColor: colors.white,
            marginBottom: spacing.small,
        },
    });

const ExampleComponent = () => {
    const styles = useStyles(injectTheme);

    return (
        <View style={styles.container}>
            ...
        </View>
    );
};

Accessing the theme

And you can also access the theme object anywhere in the app:

import { useTheme } from 'react-native-basic-ui';

const ExampleComponent = (props) => {
    const { isError } = props;
    const { colors } = useTheme();

    const color = isError ? colors.danger : colors.primary;

    return (
        <Text style={{ color }}>
            Hello world
        </Text>
    );
};

Documentation

Coming soon

Example

Check this Expo.

FAQ

Is it compatible with Expo?

Yes, it is, thanks to @expo/vector-icons and expo-linear-gradient.

Can I change the default props?

No. If you want to overwrite the default props you have to create your own component which extends this UI's component. For example if you want your Scalable to always have a scale of 0.5, you would need to create a new component which extends UI's Scalable and passes this prop to it.

Can I change the theme dynamically?

Yes, you can, however the whole app would be re-rendered.

Author

Download Details:

Author: janziemba

Source Code: https://github.com/janziemba/react-native-basic-ui

react-native react mobile-apps

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

React Native Mobile App Development

Skenix is providing React Native Development Services with qualified React Native App Developers. Get the best React Native App Development Services.

How React Native Is Shaping Mobile App Development

Are you a mobile app developer looking for more efficient tools for your projects? Mobile app development is getting tougher and tougher as the market continues to grow. As a developer, you need to develop Apps which meet the demands of your users. To achieve this, adopt the right tools, like the React Native development framework.

Top React Native Mobile App Development Companies in USA

Looking for top React Native mobile app development company in USA for Startups & Enterprise? Find out the top list of React Native mobile app development company in USA.

Which is the best React Native app development company in New York?

Hire top react native app development company in New York to build and develop custom react native mobile apps for Android & iOS with the latest features.