Skip to content
This repository was archived by the owner on Jul 12, 2019. It is now read-only.

nerdlabs/rnuix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a66c55c · Oct 13, 2017
Oct 13, 2017
Apr 3, 2017
Mar 26, 2017
Oct 13, 2017
Oct 13, 2017
Feb 7, 2017
Feb 4, 2017
Oct 13, 2017
Feb 4, 2017
Oct 13, 2017
Sep 27, 2017
Sep 27, 2017
Feb 4, 2017
Feb 4, 2017
Jun 18, 2017
Feb 7, 2017
Jun 6, 2017
Oct 13, 2017
Oct 13, 2017
Jun 8, 2017
Oct 13, 2017

Repository files navigation

React Native UI Explorer

The React Native UI Explorer, rnuix in short, is a tool to help developing and showcasing the UI components for your app. It's meant to be included in your project as a dependency, but you can also use it as a stand-alone app.

Philosophy

  • No native dependencies
  • Minimal amount of JS dependencies
  • No code duplication - directly use the components developed inside rnuix in your app

Installation

  • yarn add rnuix
  • Add a collect script to your package.json:
{
  "scripts": {
    "collect": "rnuix collect src/ui-components"
  }
}
  • Add rnuix to your main entry file:
import { App } from 'rnuix';

// components will be collected to a top-level components.js
import components from '../components';

// render the UI explorer. You might want to add a toggle in your app 
// to switch between rendering the app or the UI explorer.
// You may also provide an `onExit` prop on `App` to switch back
// to the app from inside the UI explorer.
export default function MyApp() {
  return (
    <App screenProps={{ components }} />
  )
}
  • Develop your components in src/ui-components
  • Add a demo.js for each component:
import React from 'react';
import MyComponent from './';

export default {
  displayName: 'MyComponent'
  description: 'Renders something beautiful.',
  demos: [
    {
      title: 'Default',
      render: () => (
        <MyComponent />
      )
    },
    {
      title: 'Some variation',
      render: () => (
        <MyComponent something="different" />
      )
    }
  ]
};
  • Regenerate components.js by running npm run collect