Convert Figma logo to code with AI

react-native-elements logoreact-native-elements-app

Demo app for React Native Elements (w/ React Native Web)

1,287
417
1,287
8

Top Related Projects

Material Design for React Native (Android & iOS)

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.

UI Components Library for React Native

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode

4,895

Customizable set of components for React Native applications

Quick Overview

React Native Elements App is a showcase application for the React Native Elements UI library. It demonstrates various components and features of the library, serving as both a practical example and a testing ground for new components and updates.

Pros

  • Provides a comprehensive demonstration of React Native Elements components
  • Serves as a real-world example of how to implement and use the library
  • Regularly updated to reflect the latest changes in the main library
  • Useful for developers to test and explore components before implementing them in their own projects

Cons

  • May not always be up-to-date with the very latest version of React Native Elements
  • Limited to showcasing only React Native Elements components, not a full-fledged app example
  • Could benefit from more complex, real-world usage scenarios
  • Documentation within the app could be more extensive for some components

Code Examples

  1. Using the Button component:
import { Button } from '@rneui/themed';

const MyComponent = () => (
  <Button
    title="Hello World"
    buttonStyle={{ backgroundColor: 'rgba(78, 116, 289, 1)' }}
    containerStyle={{ width: 200, marginHorizontal: 50, marginVertical: 10 }}
  />
);
  1. Implementing an Avatar:
import { Avatar } from '@rneui/themed';

const MyComponent = () => (
  <Avatar
    rounded
    source={{ uri: 'https://randomuser.me/api/portraits/men/41.jpg' }}
    size="large"
  />
);
  1. Creating a Card component:
import { Card, Text } from '@rneui/themed';

const MyComponent = () => (
  <Card>
    <Card.Title>CARD WITH DIVIDER</Card.Title>
    <Card.Divider />
    <Text>This is some card content</Text>
  </Card>
);

Getting Started

To run the React Native Elements App:

  1. Clone the repository:

    git clone https://github.com/react-native-elements/react-native-elements-app.git
    
  2. Install dependencies:

    cd react-native-elements-app
    yarn install
    
  3. Run the app:

    yarn ios     # for iOS
    yarn android # for Android
    

This will launch the showcase app on your simulator or connected device, allowing you to explore and interact with various React Native Elements components.

Competitor Comparisons

Material Design for React Native (Android & iOS)

Pros of React Native Paper

  • More comprehensive and consistent Material Design implementation
  • Better TypeScript support and type definitions
  • Regular updates and active maintenance

Cons of React Native Paper

  • Steeper learning curve due to more complex API
  • Larger bundle size, which may impact app performance
  • Less customization flexibility compared to React Native Elements

Code Comparison

React Native Paper:

import { Button } from 'react-native-paper';

<Button mode="contained" onPress={() => console.log('Pressed')}>
  Press me
</Button>

React Native Elements:

import { Button } from 'react-native-elements';

<Button
  title="Press me"
  onPress={() => console.log('Pressed')}
  buttonStyle={{ backgroundColor: 'blue' }}
/>

React Native Paper follows Material Design more closely, with predefined modes like "contained". React Native Elements offers more direct customization through props like buttonStyle.

Both libraries provide similar functionality, but React Native Paper tends to have a more opinionated and consistent design approach, while React Native Elements offers more flexibility in styling and customization. The choice between them often depends on project requirements, design preferences, and the need for Material Design compliance.

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.

Pros of NativeBase

  • More comprehensive component library with over 40 customizable components
  • Better theming support with a powerful theme engine
  • Accessibility features built-in, making it easier to create inclusive apps

Cons of NativeBase

  • Steeper learning curve due to its more complex API
  • Larger bundle size, which may impact app performance
  • Less frequent updates compared to React Native Elements

Code Comparison

NativeBase:

import { Box, Text, Button } from 'native-base';

const MyComponent = () => (
  <Box>
    <Text>Hello World</Text>
    <Button>Click me</Button>
  </Box>
);

React Native Elements:

import { View, Text } from 'react-native';
import { Button } from 'react-native-elements';

const MyComponent = () => (
  <View>
    <Text>Hello World</Text>
    <Button title="Click me" />
  </View>
);

The code comparison shows that NativeBase uses its own components for basic elements like Box and Text, while React Native Elements relies on React Native's built-in components for some elements. NativeBase's approach provides more consistency across the component library but may require more learning for developers familiar with standard React Native components.

UI Components Library for React Native

Pros of react-native-ui-lib

  • More comprehensive set of UI components and utilities
  • Better TypeScript support and type definitions
  • More frequent updates and active development

Cons of react-native-ui-lib

  • Steeper learning curve due to more complex API
  • Larger bundle size, which may impact app performance
  • Less extensive documentation compared to react-native-elements-app

Code Comparison

react-native-ui-lib:

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

const MyComponent = () => (
  <View>
    <Text text60>Hello World</Text>
    <Button label="Click me" onPress={() => {}} />
  </View>
);

react-native-elements-app:

import { View } from 'react-native';
import { Text, Button } from 'react-native-elements';

const MyComponent = () => (
  <View>
    <Text h4>Hello World</Text>
    <Button title="Click me" onPress={() => {}} />
  </View>
);

The code comparison shows that react-native-ui-lib uses a more unified import approach and has slightly different prop names for components. react-native-elements-app relies on separate imports for React Native core components and uses more standard prop names.

Both libraries offer similar functionality, but react-native-ui-lib provides a more extensive set of components and utilities, while react-native-elements-app focuses on simplicity and ease of use.

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode

Pros of React Native UI Kitten

  • More comprehensive theming system with light and dark modes
  • Larger set of pre-built components and UI elements
  • Better TypeScript support and type definitions

Cons of React Native UI Kitten

  • Steeper learning curve due to more complex API
  • Less frequent updates and potentially slower bug fixes
  • Larger bundle size, which may impact app performance

Code Comparison

React Native UI Kitten:

import { Button, Text } from '@ui-kitten/components';

const MyButton = () => (
  <Button appearance='filled'>
    <Text>Click me!</Text>
  </Button>
);

React Native Elements:

import { Button } from 'react-native-elements';

const MyButton = () => (
  <Button title="Click me!" />
);

React Native UI Kitten offers more customization options out of the box, but React Native Elements provides a simpler API for basic components. UI Kitten's theming system is more powerful, allowing for easy switching between light and dark modes, while React Native Elements requires more manual configuration for theming.

Both libraries are popular choices for React Native development, with UI Kitten being more suitable for complex, theme-heavy applications, and React Native Elements being ideal for simpler projects or those requiring a gentler learning curve.

4,895

Customizable set of components for React Native applications

Pros of Shoutem UI

  • More comprehensive UI toolkit with a wider range of pre-built components
  • Offers a theme engine for easier customization and consistent styling
  • Includes animation support out of the box

Cons of Shoutem UI

  • Less frequently updated compared to React Native Elements
  • Steeper learning curve due to its more complex architecture
  • Smaller community and fewer third-party extensions

Code Comparison

Shoutem UI:

import { View, Title, Button } from '@shoutem/ui';

const MyComponent = () => (
  <View>
    <Title>Hello, Shoutem!</Title>
    <Button styleName="secondary">Click me</Button>
  </View>
);

React Native Elements:

import { View } from 'react-native';
import { Text, Button } from 'react-native-elements';

const MyComponent = () => (
  <View>
    <Text h1>Hello, React Native Elements!</Text>
    <Button title="Click me" type="outline" />
  </View>
);

Both libraries aim to provide pre-built UI components for React Native applications, but they differ in their approach and feature set. Shoutem UI offers a more comprehensive toolkit with built-in theming and animations, while React Native Elements focuses on simplicity and ease of use. The code comparison shows that Shoutem UI uses a custom styleName prop for styling, whereas React Native Elements relies more on standard React Native props and its own prop system.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

React Native Elements App

React Native Elements App

Mobile App

This is the Demo app for React Native Elements built with Expo. The purpose of this app is to demonstrate the usage of the various UI components that React Native Elements provides out of the box.

This app also works on the web platform using React Native Web. You can check out the live website here. If you are looking to build a React Native mobile app which can reuse the code to deploy it on the web, this is the right place to begin. We decided to use Expo, which reduces the effort required to build an app once and deploy it anywhere.

Getting Started

Run it locally

  1. Install Expo CLI
[sudo] npm install -g expo-cli

If permissions errors then please use --unsafe-perm=true flag too npm/npm#16766

  1. Clone the project
git clone https://github.com/react-native-elements/react-native-elements-app.git
  1. Install dependencies
cd react-native-elements-app

# Using yarn
yarn install

# Using npm
npm install
  1. Run the cross-platform app (uses Expo)
# Using yarn
yarn start

# Using npm
npm start

Deploy Web App

First you must set correct publicPath in app.web-build.json. Next you must build the web app using:

yarn build:web

Once you have built it, you can see generated web-build folder.

This folder can be hosted as static website. For example, you can publish on Github Pages via gh-pages cli.

yarn deploy

Note: Don't forget to add or change "homepage" key in your package.json!

Ejecting

The mobile app is built using Expo. If you would like to eject, you can run the following command:

# Using Yarn
yarn eject

# Using npm
npm run eject

We highly recommend you read the official Expo ejection docs before proceeding, as the action of ejecting is not reversible.

Major contributors:

React Native Elements

This app is built using React Native Elements. React Native Elements is a UI toolkit for React Native that provides you with production ready UI components so that you can focus on building the part that makes your app unique as opposed to reinvent the UI wheel. Aiding rapid development and pragmatic design, React Native Elements is the one-stop shop for all your requirements, making your web and mobile apps look more dynamic and professional.

You can install react-native-elements in your app using:

# Using yarn
yarn add react-native-elements

# Using npm
npm install react-native-elements --save

Feedback

In case you run into any problems while running this app or have additional questions, please create a new issue on this repo, and we will follow up with you.