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-native-ui

v1.0.0

Published

Native UI is a react native UI library that comes with themed components built on top of default react native components. All components have been tested to work on Android, IOS and Web (React Native Web).

Downloads

12

Readme

React Native - Native UI

Native UI is a react native UI library that comes with themed components built on top of default react native components. All components have been tested to work on Android, IOS and Web (React Native Web).

  • [x] High Performant 📈
  • [x] Vast Components 💯
  • [x] Minimal Dependencies 🛠️
  • [x] Cross Platform 📱
  • [x] Blazingly Fast 🚀

Getting Started

  • Install the library to your project
npm install react-native-native-ui
  • Wrap your App with the UI Context Provider
import { UIProvider } from 'react-native-native-ui';

function App({ children, ...props })
{
    return <UIProvider>
        {children}
    </UIProvider>
}
  • Start using the various components Alt text
import { View, VStack, Button, HStack, Icon, Input, Text,
    Card, Colors, Divider, UIProvider, useMessage, Select, Radio } from 'react-native-native-ui';

function App()
{
    const { showMessage } = useMessage();

    return (
    <UIProvider>
        <SafeAreaView style={{ flex: 1, backgroundColor: Colors.background }}>
        <View style={{ flex: 1, backgroundColor: Colors.background, padding: 20 }}>
        <Card>
        <VStack style={{ padding: 20, backgroundColor: 'white' }}>
            <View>
                <HStack>
                    <Text variant='heading' style={{ flex: 1, fontSize: 20, }}>Heading</Text>
                    <IconButton name='close' />
                </HStack>
                <Divider/>
                <Text variant='key' style={{ fontSize: 15, fontWeight: '600', color: Colors.dark }}>Key text</Text>
                <Text variant='subtitle' style={{ fontSize: 14, fontWeight: '500' }}>Subtitle</Text>
            </View>
            <Input
                leftElement={<Icon name='account' />}
                placeholder='username'
                error='Invalid username!'
            />
            <HStack>
                <Button color='error' style={{ flex: 1 }}><Icon name='close' color='white' /><Text style={{ color: 'white' }}>Cancel</Text></Button>
                <Button style={{ flex: 1 }} title='Show Toast'
                    rightElement={<Icon name='chevron-right' color='white' />}
                    onPress={()=>{
                        showMessage({ title: 'Test', duration: 2000, status: 'error' });
                        showMessage({ title: 'Test 2', duration: 2000 });
                    }}
                />
            </HStack>

            <Select value={'1'} placeholder="select" onChange={(v)=>{}}
                items={[
                    { value: '1', label: 'One' },
                    { value: '2', label: 'Two' },
                    { value: '3', label: 'Three' },
                ]}
            />

            <Radio value='1' options={[{ value: '1', label: 'One' }, { value: '2', label: 'Two' }, { value: '3', label: 'Three' }]} onChange={(v)=>{}} />

        </VStack>
        </Card>
        </View>
        </SafeAreaView>
    </UIProvider>
    )
}

Components

Layout

  • Box
  • View
  • HStack
  • VStack
  • Card
  • Modal
  • Divider

Primitives

  • Text
  • Button
  • Icon (Uses react-native-vector-icons)
  • IconButton
  • Checkbox
  • Radio
  • Input
  • Image

Components

  • Select
  • Avatar
  • OverlaySpinner
  • Accordion

Notification Management System

This library also comes with a built-in notification management system and can be utilized with useMessage() hook. This system uses a message queue and shows notifications one after another using Toasts (can be modified to use custom render method)

import { useMessage } from 'react-native-native-ui';

function Component(props)
{
    const { showMessage } = useMessage();

    useEffect(() => {
        showMessage({ title: 'Message title', text: 'Message body', status: 'error', duration: 2000 });
    }, []);
}

Colors

This project uses the following color scheme to perform all styling:

  • 3 main colors (primary, secondary, tertiary)
  • 3 colors of statuses (success, warning, error)
  • 5 shades of white to black (white, light, grey, dark, black)

To override the colors simply import the Colors variable in your index file and edit the values as follows:

import { Colors } from 'react-native-native-ui';

Colors.primary = 'blue';
Colors.secondary = 'red';
Colors.tertiary = 'purple';

Extending the Theme

In your App file import extendTheme() and define the overrides to each individual component as follows

import { extendTheme } from 'native-ui';

extendTheme({
    Button: {
        style: {
            borderRadius: 25
        },
        variants: {
            'ghost': {
                paddingVertical: 20
            }
        }
    },
    Input: {
        style: {
            color: 'black',
        }
    }
});

Authors

Sainath Ganesh - @furyswordxd

License

This project is licensed under the MIT License - see the LICENSE.md file for details.