npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-lite-ui

v1.0.3

Published

Custom UI components for react-native

Downloads

263

Readme

Custom UI Components with Theming

This package provides customizable and themable React Native components including Buttons, Chips, Text, and TextInput. All components are designed to work seamlessly with a theme context to provide a consistent UI experience.

Installation

npm install react-native-lite-ui

Usage

First, wrap your app with the ThemeProvider and provide initial values for the theme:

import React from 'react';
import { ThemeProvider } from 'react-native-lite-ui';

const App = () => {
  const theme = {
    colors: {
      primary: '#6200EE',
      buttonColor: '#03DAC6',
      textColor: '#000',
    },
    fontSizes: {
      medium: 16,
    },
    fonts: {
      regular: 'System',
      medium: 'System-Medium',
      bold: 'System-Bold',
    },
  };

  return (
    <ThemeProvider initialValues={theme}>
      {/* Your app code */}
    </ThemeProvider>
  );
};

export default App;

Button

A button component that supports multiple styles and theming.

Props

| Prop | Type | Description | Default | |------------|---------------------------------------|-----------------------------------------------------|-------------| | title | string | The text displayed on the button. | required | | onPress | () => void | Function to call when the button is pressed. | required | | style | ViewStyle | Custom style for the button. | undefined | | textStyle| TextStyle | Custom style for the text inside the button. | undefined | | type | 'contained' , 'outline' , 'text' | Button style type. | contained | | radius | 'xl' , 'l' , 'm' , 's' | Border radius of the button. | contained |

Example

import { Button } from 'react-native-lite-ui';

<Button title="Click Me" onPress={() => alert('Button pressed')} type="outline" />

Chip

A chip component that supports multiple styles and theming.

Props

| Prop | Type | Description | Default | |------------|---------------------------------------|-----------------------------------------------------|-------------| | title | string | The text displayed on the chip. | required | | style | ViewStyle | Custom style for the chip. | undefined | | textStyle| TextStyle | Custom style for the text inside the chip. | undefined | | type | 'contained' ,'outline' , 'text' | Chip style type. | contained | | radius | 'xl' , 'l' ,'m' , 's' | Border radius of the chip. | xl | | color | string | Custom color for the chip. | theme.colors.primary |

Example

import { Chip } from 'react-native-lite-ui';

<Chip title="Chip" type="outline" />

Text

A customizable text component that supports multiple font styles and colors.

Props

| Prop | Type | Description | Default | |------------|---------------------------------------|-----------------------------------------------------|-------------| | children | React.ReactNode | The text content inside the component. | required | | fontSize | 'medium',"large","extraLarge","extraExtraLarge","small","extraSmall" | Font Size. | medium | | style | TextStyle | Custom style for the text. | undefined | | mode | 'regular' , 'bold' , 'medium' | Font weight/style of the text. | regular | | colored | boolean | Whether to use the primary color from the theme. | false |

Example

import { Text } from 'react-native-lite-ui';

<Text mode="bold" colored={true}>Hello World</Text>

TextInput

A customizable text input field with support for different font weights.

Props

| Prop | Type | Description | Default | |------------|---------------------------------------|-----------------------------------------------------|-------------| | style | TextStyle | Custom style for the text input. | undefined | | fontWeight| 'regular' , 'bold' , 'medium' | Font weight of the text input. | regular |

Example

import { TextInput } from 'react-native-lite-ui';

<TextInput placeholder="Type here" fontWeight="bold" />

Theming

All components use the useTheme hook to apply colors, fonts, and styles from a theme. To change the appearance globally, provide custom values via the ThemeProvider.

import { ThemeProvider } from 'react-native-lite-ui';

const theme = {
  colors: {
    primary: '#6200EE',
    textColor: '#000',
  },
   fontSizes:{
      medium: 14,
      large: 16,
      extraLarge: 18,
      extraExtraLarge: 50,
      small:12,
      extraSmall: 10
  },
  fonts: {
    regular: 'System-Regular',
    medium: 'System-Medium',
    bold: 'System-Bold',
  },
};

<ThemeProvider initialValues={theme}>
  {/* Your app code */}
</ThemeProvider>

License

This project is licensed under the MIT License.