react-native-tree-themes
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

react-native-tree-themes

Allows you to create and manage themes in react-native using a theme tree.

Installation

Typescript not yet supported, it is on the Roadmap for version 0.2

npm install react-native-tree-themes

Usage

Import the theme provider near the start of your project.

import {ThemeProvider, ThemeContext } from 'react-native-tree-themes';

function Ancestor = (props){
  return
    <ThemeProvider theme={theme}>
      <Child />
    </ThemeProvider>
}

The child can either be themed or handle the context directly.

class Child {
  static theme = ThemeContext.useContext;
  render(){
    <Element style={theme.background_bordered}>
  }
}

or

const Parent = Themed(class ChildComponent {
  render(){
    return
      <ThemedContext.Consumer>
        value = <Child theme={value} />
      </ThemedContext.Consumer>
  }
});

Components

There are currently four030 componnents, though I plan to make more over the next few weeks. - Themed text - Themed Italics - Themed bold

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i react-native-tree-themes

Weekly Downloads

0

Version

0.2.2

License

MIT

Unpacked Size

63 kB

Total Files

39

Last publish

Collaborators

  • sacridias