Convert Figma logo to code with AI

GeekyAnts logoNativeBase-KitchenSink

An example app with all the UI components of NativeBase

2,183
757
2,183
55

Top Related Projects

Material Design for React Native (Android & iOS)

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

Cross-Platform React Native UI Toolkit

17,543

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!

Quick Overview

NativeBase-KitchenSink is a comprehensive demo application showcasing the components and features of NativeBase, a popular UI component library for React Native. It serves as a practical reference for developers, demonstrating how to implement and customize various UI elements in React Native applications using NativeBase.

Pros

  • Extensive showcase of NativeBase components and their usage
  • Provides real-world examples for developers to learn from
  • Regularly updated to reflect the latest NativeBase features
  • Cross-platform compatibility (iOS and Android)

Cons

  • May be overwhelming for beginners due to the large number of examples
  • Some examples might not cover all possible customization options
  • Requires a good understanding of React Native basics
  • Performance may vary on older devices due to the number of components

Code Examples

  1. Basic Button Component:
import React from 'react';
import { Button } from 'native-base';

export default function BasicButton() {
  return <Button>Click Me</Button>;
}

This example shows how to use a simple Button component from NativeBase.

  1. Custom Styled Card:
import React from 'react';
import { Box, Heading, Text, VStack } from 'native-base';

export default function CustomCard() {
  return (
    <Box
      bg="primary.600"
      py="4"
      px="3"
      rounded="md"
      width={64}
      maxWidth="100%"
    >
      <VStack space={2}>
        <Heading size="md" color="white">
          Welcome
        </Heading>
        <Text fontSize="xs" color="white">
          This is a custom styled card using NativeBase components.
        </Text>
      </VStack>
    </Box>
  );
}

This example demonstrates how to create a custom styled card using NativeBase components.

  1. Form with Input and Select:
import React from 'react';
import { VStack, FormControl, Input, Select, CheckIcon } from 'native-base';

export default function BasicForm() {
  return (
    <VStack width="90%" mx="3" maxW="300px">
      <FormControl isRequired>
        <FormControl.Label>Name</FormControl.Label>
        <Input placeholder="John Doe" />
      </FormControl>
      <FormControl mt="3">
        <FormControl.Label>Country</FormControl.Label>
        <Select
          minWidth="200"
          accessibilityLabel="Choose Country"
          placeholder="Choose Country"
          _selectedItem={{
            bg: "teal.600",
            endIcon: <CheckIcon size="5" />,
          }}
        >
          <Select.Item label="USA" value="usa" />
          <Select.Item label="Canada" value="canada" />
          <Select.Item label="UK" value="uk" />
        </Select>
      </FormControl>
    </VStack>
  );
}

This example shows how to create a basic form with an Input and Select component using NativeBase.

Getting Started

To get started with NativeBase-KitchenSink:

  1. Clone the repository:

    git clone https://github.com/GeekyAnts/NativeBase-KitchenSink.git
    
  2. Install dependencies:

    cd NativeBase-KitchenSink
    npm install
    
  3. Run the app:

    • For iOS: npx react-native run-ios
    • For Android: npx react-native run-android

Make sure you have React Native development environment set up before running the app.

Competitor Comparisons

Material Design for React Native (Android & iOS)

Pros of React Native Paper

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples for each component
  • Follows Material Design guidelines more closely, ensuring a consistent look and feel

Cons of React Native Paper

  • Larger bundle size due to the extensive component library
  • Less customizable than NativeBase-KitchenSink, which offers more flexibility in styling
  • Steeper learning curve for developers new to Material Design principles

Code Comparison

NativeBase-KitchenSink:

import { Container, Header, Content, Button, Text } from 'native-base';

<Container>
  <Header />
  <Content>
    <Button><Text>Click Me!</Text></Button>
  </Content>
</Container>

React Native Paper:

import { Provider as PaperProvider, Button } from 'react-native-paper';

<PaperProvider>
  <Button mode="contained" onPress={() => console.log('Pressed')}>
    Click Me!
  </Button>
</PaperProvider>

Both libraries offer easy-to-use components, but React Native Paper requires a Provider wrapper for theming and follows a more structured approach to component implementation.

UI Components Library for React Native

Pros of react-native-ui-lib

  • More extensive component library with over 60 customizable components
  • Better TypeScript support and type definitions
  • More active development and frequent updates

Cons of react-native-ui-lib

  • Steeper learning curve due to more complex API
  • Larger bundle size, which may impact app performance
  • Less focus on cross-platform consistency compared to NativeBase

Code Comparison

NativeBase-KitchenSink:

import { Container, Header, Content, Button, Text } from 'native-base';

<Container>
  <Header />
  <Content>
    <Button><Text>Click Me!</Text></Button>
  </Content>
</Container>

react-native-ui-lib:

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

<View>
  <Button label="Click Me!" />
  <Text>Some text</Text>
</View>

Both libraries offer a similar component-based approach, but react-native-ui-lib provides more granular control over styling and behavior. NativeBase-KitchenSink focuses on simplicity and ease of use, while react-native-ui-lib offers more advanced features and customization options.

: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 customizable themes and variables
  • Larger set of pre-built UI components (40+) compared to NativeBase-KitchenSink
  • Better TypeScript support and type definitions

Cons of react-native-ui-kitten

  • Steeper learning curve due to its more complex theming system
  • Less frequent updates and potentially slower bug fixes
  • Slightly larger bundle size, which may impact app performance

Code Comparison

NativeBase-KitchenSink:

import { Container, Header, Content, Button, Text } from 'native-base';

const MyComponent = () => (
  <Container>
    <Header />
    <Content>
      <Button><Text>Click Me</Text></Button>
    </Content>
  </Container>
);

react-native-ui-kitten:

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

const MyComponent = () => (
  <Layout>
    <Button>Click Me</Button>
    <Text>Hello World</Text>
  </Layout>
);

Both libraries offer similar component-based structures, but react-native-ui-kitten uses a more streamlined approach with fewer nested components. NativeBase-KitchenSink provides a more traditional mobile app structure with Container and Content components.

4,895

Customizable set of components for React Native applications

Pros of Shoutem UI

  • More extensive theming capabilities with a powerful theme engine
  • Includes additional UI components like navigation and layout elements
  • Better documentation and examples for complex UI patterns

Cons of Shoutem UI

  • Steeper learning curve due to its more complex architecture
  • Less frequent updates and maintenance compared to NativeBase
  • Smaller community and fewer third-party extensions

Code Comparison

NativeBase example:

import { Container, Header, Content, Button, Text } from 'native-base';

export default function App() {
  return (
    <Container>
      <Header />
      <Content>
        <Button><Text>Click Me!</Text></Button>
      </Content>
    </Container>
  );
}

Shoutem UI example:

import { Screen, NavigationBar, Button, Text } from '@shoutem/ui';

export default function App() {
  return (
    <Screen>
      <NavigationBar title="My App" />
      <Button styleName="secondary"><Text>Click Me!</Text></Button>
    </Screen>
  );
}

Both libraries offer similar basic components, but Shoutem UI provides more built-in styling options and a different approach to layout structure. NativeBase uses a more familiar React Native-like syntax, while Shoutem UI introduces custom components like Screen and NavigationBar for a more opinionated structure.

Cross-Platform React Native UI Toolkit

Pros of React Native Elements

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples for each component
  • Active community and frequent updates

Cons of React Native Elements

  • Larger bundle size due to the extensive component library
  • Less customizable theming system compared to NativeBase
  • Steeper learning curve for beginners

Code Comparison

NativeBase KitchenSink:

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, Button } from 'react-native-elements';

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

Both libraries offer similar component structures, but React Native Elements uses more specific props (e.g., title for Button) while NativeBase follows a more customizable approach with nested components.

React Native Elements provides a wider range of pre-built components, making it easier to quickly build complex UIs. However, NativeBase offers a more flexible theming system and a smaller bundle size, which can be beneficial for performance-critical applications.

Ultimately, the choice between these libraries depends on the specific needs of your project, such as the required components, customization level, and performance considerations.

17,543

Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more!

Pros of Ignite

  • Provides a complete boilerplate for React Native projects, including pre-configured navigation, state management, and testing setup
  • Offers a CLI tool for generating components, screens, and other project files, enhancing developer productivity
  • Includes a curated set of libraries and best practices, ensuring a solid foundation for scalable apps

Cons of Ignite

  • Steeper learning curve due to the opinionated project structure and included libraries
  • May include unnecessary dependencies for simpler projects, potentially increasing app size
  • Less focused on UI components compared to NativeBase-KitchenSink

Code Comparison

NativeBase-KitchenSink (UI component example):

import React from "react";
import { Button } from "native-base";

export default function MyButton() {
  return <Button>Click me</Button>;
}

Ignite (Component generation example):

ignite generate component MyComponent

This command generates a new component file with boilerplate code, including styling and basic structure.

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

NativeBase KitchenSink v2.12.0

An example app with all the UI components of NativeBase

NativeBase-KitchenSink comes in four forms of app for you!

  1. Pure React Native App with react-navigation on branch master
  2. Pure React Native App with RNRF on branch RNRF
  3. An Expo app with CRNA and react-navigation on branch CRNA
  4. A React App with NativeBase for web on branch web-support

Find the installation guide in ReadMe of appropriate branches

Demo

iOSAndroid
ios-demoandroid-demo

Installation

  • Clone and install packages
git clone git@github.com:GeekyAnts/NativeBase-KitchenSink.git
cd NativeBase-KitchenSink
yarn
react-native link react-native-vector-icons
  • Run on iOS

    • Opt #1:
      • Open the project in Xcode from ios/NativeBase-KitchenSink.xcodeproj
      • Click run button to simulate
    • Opt #2:
      • Run react-native run-ios in your terminal
  • Run on Android

    • Make sure you have an Android emulator installed and running
    • Run react-native run-android in your terminal

BuilderX

Another major project by us is BuilderX, a screen design tool which codes React Native for you.