0.1.31 • Published 3 months ago

pa-react-themes v0.1.31

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

To add themes to React Native

Installation:

npm install pa-react-themes

Updates:

npm update --save pa-react-themes

Initialization:

npx pa-react-themes init

Generated Files:

project_root_folder
|-- theme.app.example.js
|-- theme.component.example.js
|-- theme.config.js
|-- theme.css.example.json
|-- theme.shorcuts.js
|-- theme.tw.example.json

App.js Example:

import { Platform, useColorScheme } from "react-native";
import { ThemeProvider } from 'pa-react-themes';
import MyComponent from './theme.component.example';

export default function App() {
  return (
    <ThemeProvider mode={useColorScheme()} platform={Platform.OS}>
      <MyComponent /> 
    </ThemeProvider>
  );
}

Component Example:

import { Pressable, Text, View } from 'react-native'
import { Theme } from './theme.shorcuts'

export default function MyComponent() {
  const handlePress = () => {
      console.log("Button Pressed")
  }

  return (
    <View>
      <Text style={Theme.Text('h1')}>This is a Text

      <Pressable style={Theme.Button('primary', 'background')} onPress={handlePress}>
        <Text style={Theme.Button('primary', 'text')}>This is a Button 
      </Pressable>

      <Pressable style={Theme.Button('secondary').background} onPress={handlePress}>
        <Text style={Theme.Button('secondary').text}>This is another Button 
      </Pressable>
    </View>
  )
}

Documentation

The link to the documentation is shown when executing the init since it is located in the module folder. At the moment in Spanish because we are making improvements, soon in English but you can translate it with Google Translator...


Feedbacks

Any comments or improvements can write to us at ebfash2@hotmail.com, Thank you!


0.1.30

3 months ago

0.1.31

3 months ago

0.1.27

3 months ago

0.1.29

3 months ago

0.1.20

3 months ago

0.1.21

3 months ago

0.1.22

3 months ago

0.1.23

3 months ago

0.1.24

3 months ago

0.1.25

3 months ago

0.1.26

3 months ago

0.1.17

3 months ago

0.1.18

3 months ago

0.1.19

3 months ago

0.1.11

3 months ago

0.1.12

3 months ago

0.1.13

3 months ago

0.1.14

3 months ago

0.1.15

3 months ago

0.1.16

3 months ago

0.1.10

3 months ago

0.1.8

3 months ago

0.1.7

3 months ago

0.1.9

3 months ago

0.1.6

3 months ago

0.1.5

3 months ago

0.1.4

3 months ago

0.1.3

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago