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

rebase-ui

v0.2.0

Published

Reusable react native UI components

Readme

Rebase UI

A production-ready React Native UI component library with theming support, built for developers who don't want to reinvent the wheel.

Installation

npm install rebase-ui
# or
yarn add rebase-ui

Peer Dependencies

npm install react-native-svg

Quick Start

import { ThemeProvider, Button, useTheme } from 'rebase-ui';


export default function App() {
  return (
    <ThemeProvider>
      <YourApp />
    </ThemeProvider>
  );
}


function YourComponent() {
  const { theme } = useTheme();
  
  return (
    <Button 
      title="Press me" 
      onPress={() => console.log('Pressed')}
    />
  );
}

Features

  • Consistent theming system - Light/dark modes with proper colour tokens
  • Spacing scale - 4px increment system that actually makes sense
  • Platform shadows - Works properly on both iOS and Android
  • TypeScript first - Proper type definitions, not afterthoughts
  • Zero configuration - Sensible defaults that work out of the box

Components

Button

Standard button with theming support.

<Button 
  title="Primary Button"
  onPress={() => {}}
  variant="primary" // or "secondary"
/>

Theme System

The theming system uses a factory function to generate consistent themes:

import { createTheme } from 'rebase-ui';

// Default themes
const lightTheme = createTheme('light');
const darkTheme = createTheme('dark');

// Custom overrides
const customTheme = createTheme('light', {
  colors: {
    primary: '#007AFF',
  },
  spacing: {
    custom: 18,
  }
});

Spacing Scale

spacing: {
  0: 0,    1: 4,    2: 8,    3: 12,   4: 16,
  5: 20,   6: 24,   8: 32,   10: 40,  12: 48,  16: 64
}

Border Radius

radius: {
  none: 0, sm: 4, md: 8, lg: 12, xl: 16, full: 9999
}

Shadows

shadows: {
  sm: { /* subtle depth */ },
  md: { /* standard cards */ }
}

Theme Provider

import { ThemeProvider, useTheme } from 'rebase-ui';

function App() {
  return (
    <ThemeProvider initialMode="light">
      <YourApp />
    </ThemeProvider>
  );
}

// In components
function MyComponent() {
  const { theme, isDark, toggleTheme } = useTheme();
  
  return (
    <View style={{ backgroundColor: theme.colors.surface }}>
      {/* Your content */}
    </View>
  );
}

Usage Examples

Custom Styling

import { StyleSheet } from 'react-native';
import { useTheme } from 'rebase-ui';

function Card({ children }) {
  const { theme } = useTheme();
  
  const styles = StyleSheet.create({
    card: {
      backgroundColor: theme.colors.surface,
      borderRadius: theme.radius.lg,
      padding: theme.spacing[4],
      ...theme.shadows.sm,
    }
  });
  
  return <View style={styles.card}>{children}</View>;
}

Typography

function TextExample() {
  const { theme } = useTheme();
  
  return (
    <Text style={[
      theme.typography.heading1,
      { color: theme.colors.onSurface }
    ]}>
      Heading Text
    </Text>
  );
}

API Reference

createTheme(mode, overrides?)

Creates a theme object with the specified mode and optional overrides.

  • mode: 'light' | 'dark'
  • overrides: Partial<Theme> - Optional theme customisations

useTheme()

Hook that returns the current theme context:

const { 
  theme,      // Current theme object
  isDark,     // Boolean indicating dark mode
  toggleTheme // Function to toggle between light/dark
} = useTheme();

Theme Object Structure

interface Theme {
  colors: ThemeColors;
  typography: Typography;
  spacing: Record<string | number, number>;
  radius: Record<string, number>;
  shadows: Record<string, object>;
}

Best Practices

  • Always use theme tokens instead of hardcoded values
  • Stick to the spacing scale for consistent visual rhythm
  • Test both light and dark themes during development
  • Use semantic colour names from the theme
  • Keep theme overrides minimal

Requirements

  • React Native >= 0.70
  • React >= 18.0
  • TypeScript >= 4.5 (recommended)

Contributing

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a pull request

Licence

MIT © cmcWebCode40

Links