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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jereztech/react-elements

v1.1.5

Published

A bundle of components for React projects.

Readme

@jereztech/react-elements

NPM Version GPL License

React Native component library that provides a set of highly customizable and easy-to-use UI components. This library provides utilities to manage theming (light/dark) in your application. It integrates smoothly with React’s native color scheme APIs (useColorScheme) so that components can respond automatically to system appearance changes, even without explicitly wrapping your app in a ThemeProvider.

Getting Started

To install the package, run:

npm install @jereztech/react-elements
# or
yarn add @jereztech/react-elements

ThemeProvider

Usage:

import { ThemeProvider } from '@jereztech/react-elements';
import { LightTheme, DarkTheme } from './your-themes-path';

export default function RootLayout() {

    return (
        <ThemeProvider lightTheme={LightTheme} darkTheme={DarkTheme}>
            <Slot />
        </ThemeProvider>
    );

}
  • lightTheme (optional): The theme object representing Light Mode. Defaults to LightTheme if not provided.
  • darkTheme (optional): The theme object representing Dark Mode. Defaults to DarkTheme if not provided.
  • children: The child components that will have access to the theme context.

Important Note

Wrapping your app with ThemeProvider is not mandatory. All core library components already listen to React’s appearance change events via useColorScheme under the hood. The ThemeProvider exists if you want to override or customize these themes globally.

Dynamic Hooks

useTheme(colorScheme?: ColorSchemeName)

Returns a Theme object. If you pass a colorScheme argument ("light" or "dark"), it will force the returned theme to that scheme instead of using the globally provided one. This is useful when you want a specific component to always render in a certain color scheme, regardless of the device or global theme context settings.

  • Example:
import { View, Text } from 'react-native';
import { useTheme } from '@jereztech/react-elements';

const BlackCta = () => {
    // Force this CTA to always use the dark theme
    const theme = useTheme('dark');

    return (
        <View style={{ backgroundColor: theme.colors.background }}>
            <Button>Press me</Button>
        </View>
    );
};

export default BlackCta;

useStyles(colorScheme?: ColorSchemeName)

A convenience hook that retrieves styles with dynamic Theme.

  • Example:
import { View, Text, StyleSheet } from 'react-native';
import { useStyles } from '@jereztech/react-elements';

const ThemedButton = () => {
    // Optionally override to "dark" to always have a dark-themed button
    const styles = useStyles('dark');

    return (
        <View style={styles.container}>
            <Text style={styles.text}>Dark Mode Button</Text>
        </View>
    );
};

export default ThemedButton;

Theme Type Definitions

Below are the core type definitions used by the library for describing a theme. You can customize or extend these for more detailed theming in your application.

/**
 * Material-based colors.
 * 
 * @see https://m3.material.io/styles/color/roles
 */
export type Palette = {
    primary: string;
    onPrimary: string;
    primaryContainer: string;
    onPrimaryContainer: string;
    secondary: string;
    onSecondary: string;
    secondaryContainer: string;
    onSecondaryContainer: string;
    tertiary: string;
    onTertiary: string;
    tertiaryContainer: string;
    onTertiaryContainer: string;
    error: string;
    onError: string;
    errorContainer: string;
    onErrorContainer: string;
    surface: string;
    surfaceContainer: string;
    onSurface: string;
    onSurfaceVariant: string;
    inverseSurface: string;
    inverseOnSurface: string;
    inversePrimary: string;
    outline: string;
    outlineVariant: string;
} & { [addon: string]: string; };

export type Typescale = 'display' | 'headline' | 'title' | 'body' | 'label';

export type TypescaleSize = 'small' | 'medium' | 'large';

export type Typography = {
    fontFamily: string;
} & {
    [typescale in Typescale]: {
        [size in TypescaleSize]: TextStyle;
    };
};

export type Theme = {
    schemeName: ColorSchemeName;
    roundness: number;
    boldness: number;
    spacing: number;
    breakpoints: {
        small: number;
        medium: number;
    },
    colors: Palette;
    typography: Typography;
    mixin: (factor: number) => number;
};
  • Palette: Contains color properties for different UI elements (primary, surface, etc.).
  • Typography: Contains fonts, sizes, and weights for text rendering.
  • Theme: The main interface that combines color palette, typography, layout metrics, and other design tokens.

Components

Autocomplete

A generic autocomplete component that fetches and displays suggestions dynamically as the user types. It supports custom rendering of suggestion items, theming, and style overrides.

CountrySelector

A specialized autocomplete component for selecting countries. It allows filtering by ISO country codes, supports locale-based translations, and offers customizable display options for country flags and text.

LanguageSwitcher

An autocomplete component for switching languages. It supports two variants—native and localized—to display languages in their native or localized forms. Customizable flag display and list styling options are provided.

PhoneInput

A phone number input component that integrates with Google's libphonenumber library to format and validate phone numbers according to international standards. It supports customizable styles and callback functions for handling phone number validation on blur.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Copyright (C) 2025 Jerez Tech