Skip to content

pedrorosarioo/natds-rn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

███╗   ██╗ █████╗ ████████╗██████╗ ███████╗      ██████╗ ███╗   ██╗
████╗  ██║██╔══██╗╚══██╔══╝██╔══██╗██╔════╝      ██╔══██╗████╗  ██║
██╔██╗ ██║███████║   ██║   ██║  ██║███████╗█████╗██████╔╝██╔██╗ ██║
██║╚██╗██║██╔══██║   ██║   ██║  ██║╚════██║╚════╝██╔══██╗██║╚██╗██║
██║ ╚████║██║  ██║   ██║   ██████╔╝███████║      ██║  ██║██║ ╚████║
╚═╝  ╚═══╝╚═╝  ╚═╝   ╚═╝   ╚═════╝ ╚══════╝      ╚═╝  ╚═╝╚═╝  ╚═══╝

The Natura Design system for react-native

Build Status npm version npm GitHub issues NPM

:bowtie: Check out our component docs

You can also install our sample apps in your iOS or android device, check the information version page to get the latest versions of the sample apps

For iOS you will need to have your device registered as a beta tester. you can request access opening an issue or at your slack channel


Get started

Our library is made to be used with react-native and because of this, we usume that you already have a few things setup and a react-native project up and running.

If that is not the case, we strongly recommend that you finish the get started and environment setup from the official react-native docs.

Prerequisites

  • node>=12
  • yarn or npm
  • a working project with:
    • react@>=16.8.0
    • react-native@>=0.59.10

Installation

To start using the natds-rn components on you project, first you will need to install it

npm install --save @naturacosmeticos/natds-rn

# OR

yarn add @naturacosmeticos/natds-rn

Dependencies

This package currently depend on natds-themes and styled-components. This packages will be installed automatically with the command above.

If you have currently installed versions of this packages, be sure to check the installation logs for version incompatibilities

Usage

You can edit this live example to test component props and theme setup

Setup the theme

On your application entry point, add the <Provider /> and choose the theme to be applied to the components

import React from 'react';
import { ThemeProvider } from 'styled-components/native';
import { buildTheme } from '@naturacosmeticos/natds-rn';
import { App } from './app';

export const Main = () => {
  /**
   * The `buildTheme` function accepts three parameters:
   *
   * brand: the name of the brand to applied ('natura' | 'avon' | 'theBodyShop')
   * mode: the color scheme for the current branch ('light' | 'dark')
   */
  const theme = buildTheme('natura', 'light');

  return (
    <ThemeProvider theme={theme}>
      <App /> // add your application component inside the `ThemeProvider`
    </ThemeProvider>
  );
};

Using the components in your app

import React from 'react';
import { View, Text } from 'react-native';
import { Button } from '@naturacosmeticos/natds-rn';

export const App = () => {
  const onPress = () => console.log('I am pressed!');

  return (
    <View>
      <Text>A page title</Text>
      <Button onPress={onPress} text="default" type="contained" />
    </View>
  );
};

Icons

We have the icons package @naturacosmeticos/natds-icons as a dependency of this library, so you have the font icon files available in your node_modules folder after installation. To use the fonts in your app, you need to add the font icons path to your react-native.config.js file:

module.exports = {
  assets: [
    'node_modules/@naturacosmeticos/natds-icons/dist/fonts',
  ],
};

and the run:

npx react-native link

For component detailed API and usage examples, check out the docs.

Issues

Have an issue, need help or have a feature request? create a issue

Contributing

If you want to add a new component or feature to natds-rn check our contributing docs 🎉 🎉

License

ISC

About

Natura Design System React Native

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 87.5%
  • JavaScript 5.8%
  • Java 2.3%
  • Objective-C 1.9%
  • HTML 1.0%
  • Shell 0.6%
  • Other 0.9%