New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-lite-ui

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-lite-ui

Custom UI components for react-native

latest
Source
npmnpm
Version
1.1.5
Version published
Maintainers
3
Created
Source

Custom UI Components with Theming

This package provides customizable and themable React Native components all synced with same fonts of your choice so you don's have to set fonts individually at every place, package including Buttons, Chips, Text, and TextInput, Toast, Alert. All components are designed to work seamlessly with a theme context to provide a consistent UI experience.

https://react-native-lite-ui.netlify.app/

Installation

npm install react-native-lite-ui @react-native-async-storage/async-storage react-native-vector-icons lottie-react-native

Usage

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

Setting Up Theme

Wrap your app with the ThemeProvider and provide initial values for colors, font sizes, and fonts. The ThemeProvider supports both light and dark themes as well as a system-based mode.

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

const App = () => {
  const theme:ThemeInitialValues = {
      colors:{
        primary: '#03DAC6',
        backgroundColor: '#FFFFFF',
        textColor: '#000',
        buttonColor: '#03DAC6',
        disabledColor: '#A9A9A9',
        // buttonColor: "yellow"
        
    },themesColors: {
      light: {
        primary: '#03DAC6',
        backgroundColor: '#FFFFFF',
        textColor: '#000',
        buttonColor: '#03DAC6',
        disabledColor: '#A9A9A9',
      },
      dark: {
        primary: '#03DAC6',
        backgroundColor: '#121212',
        textColor: '#FFFFFF',
        buttonColor: '#03DAC6',
        disabledColor: '#444444',
      },
    },
    fontSizes : {
      extraSmall: 10,   // Very small text (e.g., captions, helper text)
      small: 12,        // Small text (e.g., secondary labels)
      medium: 14,       // Default text (e.g., body text)
      large: 16,        // Slightly larger text (e.g., buttons, headlines)
      extraLarge: 20,   // Important headings or subheadings
      extraExtraLarge: 24, // Main headings or prominent text
    },
    fonts:{
        regular: 'string',
        bold: 'string',
        medium: 'string',
    },
    colorMode:'light'
    };

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


}


export default App;

Switching Themes

You can switch themes dynamically using the useTheme,setThemeMode hook, and get theme colors using colors of useTheme:

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

const ThemeSwitcher = () => {
  const {themeMode, setThemeMode, colors} = useTheme();

  return (
    <View style={{backgroundColor: colors.backgroundColor}}>
      <Button
        title={`Switch to ${themeMode === 'dark' ? 'Light' : 'Dark'} Mode`}
        onPress={() => setThemeMode(themeMode === 'dark' ? 'light' : 'dark')}
      />
    </View>
  );
};

Theming Details

The ThemeProvider allows you to define themes for light and dark modes as well as system-based preferences. It also provides additional customization options for font sizes and font families.

Available Properties

  • Colors:

    • primary
    • secondary
    • backgroundColor
    • buttonColor
    • textColor
    • disabledColor
    • primary2, primary3, secondary2, secondary3
    • backgroundColor2, backgroundColor3
  • Font Sizes:

    • medium, large, extraLarge, small, extraSmall,extraExtraSmall
  • Fonts:

    • regular, medium, bold
  • Theme Modes:

    • 'light', 'dark', 'system'

Example

 const theme:ThemeInitialValues = {
      colors:{
        primary: '#03DAC6',
        backgroundColor: '#FFFFFF',
        textColor: '#000',
        buttonColor: '#03DAC6',
        disabledColor: '#A9A9A9',
        // buttonColor: "yellow"
        
    },themesColors: {
      light: {
        primary: '#03DAC6',
        backgroundColor: '#FFFFFF',
        textColor: '#000',
        buttonColor: '#03DAC6',
        disabledColor: '#A9A9A9',
      },
      dark: {
        primary: '#03DAC6',
        backgroundColor: '#121212',
        textColor: '#FFFFFF',
        buttonColor: '#03DAC6',
        disabledColor: '#444444',
      },
    },
    fontSizes : {
      extraSmall: 10,   // Very small text (e.g., captions, helper text)
      small: 12,        // Small text (e.g., secondary labels)
      medium: 14,       // Default text (e.g., body text)
      large: 16,        // Slightly larger text (e.g., buttons, headlines)
      extraLarge: 20,   // Important headings or subheadings
      extraExtraLarge: 24, // Main headings or prominent text
    },
    fonts:{
        regular: 'string',
        bold: 'string',
        medium: 'string',
    },
    colorMode:'light'
    };

Button

A button component that supports multiple styles and theming.

Props

PropTypeDescriptionDefault
titlestringThe text displayed on the button.required
onPress() => voidFunction to call when the button is pressed.required
styleViewStyleCustom style for the button.undefined
textStyleTextStyleCustom 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
colorstringColor of Button.Themes default primary color
loadingbooleanshow loading indicator.false
disabledbooleanTo Disable button.false
startComponentReactNodeComponent to show on the left of button.
tailingComponentReactNodeComponent to show on the right of button.
tailingIConReactNode / stringIcon to show on the right of button.
tailingIconSizeNumberIcon size.12
tailingIconColorStringIcon size.default theme color

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

PropTypeDescriptionDefault
titlestringThe text displayed on the chip.required
styleViewStyleCustom style for the chip.undefined
textStyleTextStyleCustom 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
colorstringCustom color for the chip.themes primary color
iconReactNodeIcon on the right of chip.
gapNumberGap between Icon and Text.3
selectedbooleanbackground filled if true.false
isTouchablebooleanis Touchable.false
backgroundColorstringbackground color when not selected.``

Example

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

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

ChipGroup

Group of Chips in a row that can be used as select options.

Props

PropTypeDescriptionDefault
chipsChipProps[]chips data.required
onSelectFunctionFunction on Select.required
containerStyleViewStyleCustom style for the container.undefined
chipStyleViewStyleCustom style for the chips.undefined
textStyleTextStyleCustom 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
colorstringCustom color for the chip.themes primary color
iconReactNodeIcon on the right of chip.
gapNumberGap between Chips.3
iconGapNumberGap between Icon and Text.3
selectedIdbooleanbackground filled if true.false
isTouchablebooleanis Touchable.false
backgroundColorstringbackground color when not selected.``

ChipProps

PropTypeDescription
idnumberid.required
titlestringtitle.required
iconReactNodeIcon on the right of chip.``

Example

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

<ChipGroup
  onSelect={id => setSelectedChip(id)}
  chips={[
    {
      title: 'REC',
      id: 'REC',
      icon: (color, selected) =>
        selected ? (
          <Feather
            style={{marginTop: 3}}
            name={'check'}
            size={12}
            color={color || theme.colors.primary}
          />
        ) : (
          <></>
        ),
    },
    {
      title: 'RTM',
      id: 'RTM',
      icon: (color, selected) =>
        selected ? (
          <Feather
            style={{marginTop: 3}}
            name={'check'}
            size={12}
            color={color || theme.colors.primary}
          />
        ) : (
          <></>
        ),
    },
  ]}
  selectedId={selectedChip}
  backgroundColor="#e6ebea"
  radius="l"
  gap={5}
/>;

Text

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

Props

PropTypeDescriptionDefault
childrenReact.ReactNodeThe text content inside the component.required
fontSize'medium',"large","extraLarge","extraExtraLarge","small","extraSmall","extraExtraSmall"Font Size.medium
styleTextStyle Custom style for the text.undefined
mode'regular' , 'bold' , 'medium'Font weight/style of the text.regular
coloredbooleanWhether 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

PropTypeDescriptionDefault
styleTextStyleCustom style for the text input.undefined
fontWeight'regular' , 'bold' , 'medium'Font weight of the text input.regular
disabledbooleanIs disable input.false
isErrorbooleanError Condition in the case of true a error message will be shown on the bottom of input.false
errorMessageStringError message will be shown on the bottom of input."Invalid Input"
gapBetweenErrorMessageNumberGap between textInput and error message.3
errorColorStringColor of error message."red"

Example

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

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

Selector

RNPopoverSelector with theme support. visit https://www.npmjs.com/package/rn-popover-selector for documentation

License

This project is licensed under the MIT License.

react-native-lite-ui

Keywords

react-native

FAQs

Package last updated on 18 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts