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-uix

v1.0.2

Published

An opinionated React Native UI component library that gets you up and running in minutes.

Downloads

3

Readme

react-native-uix

react-native-uix is an opinionated React Native UI component library that gets you up and running in minutes.

package_name

Features

  • Library of iOS-Style UI Components
  • Supports both iOS and Android platforms
  • Supports Dark Mode out-of-the-box
  • Full custom theme support
  • TypeScript support

📥 Installation

Using npm:

npm install react-native-uix

or with yarn:

yarn add react-native-uix

Requirements

This project has several project peer dependencies. A few of these include:

Refer to the project package.json file to view all required peer dependencies.

Quick Installation

To install all of these peer dependencies quickly, from the terminal in your project directory run the shell script:

bash node_modules/react-native-uix/install.sh

This will install the peer dependencies after choosing your desired package manager.

🔨 Usage

The best way to see react-native-uix in-action, is to take a look at the example!

import { ThemeProvider, useStyle, LayoutTopLevelScreen, GroupedTable } from "react-native-uix";

function HomeScreen() {
    const { themeSet } = useStyle();

    const tableItems = [
        {
            id: 0,
            label: "Hotels",
            count: 2,
            iconBackgroundColor: themeSet.red,
            icon: faBuilding,
            onPress: () => {},
        },
        {
            id: 1,
            label: "Restaraunts",
            count: 2,
            iconBackgroundColor: themeSet.teal,
            icon: faUtensils,
            onPress: () => {},
        },
        {
            id: 2,
            label: "Universities",
            count: 3,
            iconBackgroundColor: themeSet.yellow,
            icon: faUniversity,
            onPress: () => {},
        },
    ];

    return (
        <LayoutTopLevelScreen title="Home" navigation={navigation}>
            <GroupedTable title="Places" items={tableItems} />
        </LayoutTopLevelScreen>
    );
}

function App() {
    const HomeStack = createStackNavigator();

    return (
        <ThemeProvider>
            <HomeStack.Navigator>
                <HomeStack.Screen name="Home" component={HomeScreen} />
            </HomeStack.Navigator>
        </ThemeProvider>
    );
}

🎨 Custom Styling

Customising the theme of your app can be achieved using the ThemeProvider component. You can determine the colours for both light and dark mode.

| Light | Dark | | --- | --- | | light theme | dark theme

ThemeProvider component

Usage

import { ThemeProvide } from "react-native-uix";

const App: React.FC = () => {
  const theme = {
    light: {
      textPrimary: "#345000",
      tint: "#2188ff",
      systemBackground: "#ff0000"
    },
    dark: {
      textPrimary: "#345088",
      tint: "#388bfd",
      systemBackground: "#ff0055"
    },
  };

  return (
    <ThemeProvider theme={theme}>
      <AppNavigation />
    </ThemeProvider>
  );
};

You can customise any of the colors below for your theme. If a color is not provided, the corresponding color in the DEFAULT_THEME is used.

tint,
textPrimary,
textSecondary
textTertiary,
textQuarternary,
systemBackground,
secondarySystemBackground,
tertiarySystemBackground,
separator,
blue,
green,
indigo,
orange,
pink,
purple,
red,
teal,
yellow,
white,

useStyle hook

If you are making your own custom components and would like to make use of your custom theme, whilst supporting dark mode, this is where the useStyle hook becomes useful.

Usage

import { useStyle } from "react-native-uix";

const MyComponent = () => {
    const dynamicStyles = (theme) => {
        return {
            container: {
                width: 20,
                height: 20,
                backgroundColor: theme.systemBackground,
            }
        }
    }

    const { styles } = useStyle(dynamicStyles);
  
    return (
      <View style={styles.container} />
    );
  };
}

Roadmap

  • Documentation for individual components
  • JSON form component

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT