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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rn-base-component

v0.6.0

Published

Base component for React Native

Readme

rn-base-component

A comprehensive React Native component library with modern, customizable, and accessible components.

📖 Documentation

🌐 Complete Documentation Website - Interactive documentation with examples and API references

Features

  • 🎯 Modern Components - Built with the latest React Native patterns
  • 🎨 Highly Customizable - Extensive theming and styling options
  • Accessible - Full accessibility support with screen readers
  • 🎮 TypeScript Ready - Complete type safety and IntelliSense
  • 📱 Mobile Optimized - Optimized for both iOS and Android
  • 🎪 Storybook Integration - Interactive component playground

Installation

Before you install rn-base-component, make sure you have the following prerequisites installed:

You can install these dependencies using npm or yarn (note: Current, we dont support react-native-reanimated v3 and styled-components 6.*):

npm install react-native-reanimated styled-components react-native-gesture-handler

Or

yarn add react-native-reanimated styled-components react-native-gesture-handler

Then

npm install rn-base-component

Quick Start

import React from 'react'
import {BaseProvider, Button, CodeInput} from 'rn-base-component'

export default function App() {
  return (
    <BaseProvider>
      <Button onPress={() => console.log('Pressed!')}>Click Me</Button>

      <CodeInput length={6} onSubmit={code => console.log('Code:', code)} autoFocus />
    </BaseProvider>
  )
}

Components

🔗 📚 Complete Component Documentation - Comprehensive guide to all components with examples, API references, and best practices.

Input Components

CodeInput

A highly customizable and accessible code input component for OTP, PIN, and verification codes.

Features:

  • 🎯 Flexible length (1-20 digits) • 🔒 Secure text entry mode • 🎨 Extensive styling options
  • ♿ Full accessibility support • 🎮 Controlled/uncontrolled modes • 📱 Mobile-optimized keyboard handling
<CodeInput length={6} onSubmit={code => verifyOTP(code)} placeholderAsDot secureTextEntry autoFocus />

📖 CodeInput Documentation

TextInput

Enhanced text input with multiple variants, validation, and icon support.

<TextInput.Outlined label="Email" placeholder="Enter email" errorText={error} />

📖 TextInput Documentation

Checkbox

Animated checkbox component with custom styling and label support.

<Checkbox label="Accept terms" onChange={setAccepted} />

📖 Checkbox Documentation

RadioButton

Radio button component for mutually exclusive selections.

<RadioButton text="Option 1" value={selected === 'option1'} onPressButton={() => setSelected('option1')} />

📖 RadioButton Documentation

Slider

Interactive slider for value selection with single and range variants.

<Slider minimumValue={0} maximumValue={100} onValueChange={setValue} />
<Slider.Range initialLowValue={20} initialHighValue={80} onValueChange={(low, high) => setRange({low, high})} />

📖 Slider Documentation

UI Components

Button

Customizable button component with multiple variants and icon support.

<Button onPress={handlePress}>Primary Button</Button>
<ButtonOutline onPress={handlePress}>Outline Button</ButtonOutline>

📖 Button Documentation

Card

Flexible card container for content organization with optional touch interactions.

<Card onPress={navigateToDetails}>
  <Text>Card content</Text>
</Card>

📖 Card Documentation

Icon

Versatile icon component with touch interactions and customizable styling.

<Icon source={require('./icon.png')} size={24} onPress={handlePress} />

📖 Icon Documentation

Layout Components

Accordion

Collapsible content sections with smooth animations and custom rendering.

<Accordion sections={faqSections} expandMultiple={false} />

📖 Accordion Documentation

Feedback Components

Progress

Progress indicators for loading states with determinate and indeterminate modes.

<Progress value={65} filledTrackColor="#4CAF50" />
<Progress isIndeterminateProgress />

📖 Progress Documentation

Typography Components

Text

Enhanced text component with theme integration and multiple variants.

<Text color="#007AFF">Colored text</Text>
<TextBold>Bold text</TextBold>

📖 Text Documentation

Typography

Consistent typography system with predefined variants.

<Typography variant="h1">Large Heading</Typography>
<Typography variant="regular">Body text</Typography>

📖 Typography Documentation

Development

Preview/Debug Components

yarn bootstrap
yarn example ios/android

Update Storybook (Debug purpose only)

To update Storybook after running it on the Simulator and adding new components or updating existing ones, run the following command.

yarn example update-stories

Documentation

📚 Component Documentation

🔗 Complete Components Guide - Comprehensive overview of all components

Individual Component Documentation

Input Components:

UI Components:

  • Button - Customizable button with variants
  • Card - Flexible content container
  • Icon - Versatile icon component

Layout Components:

Feedback Components:

Typography Components:

🛠️ Development Guides

Theming

The library includes a comprehensive theming system:

import {BaseProvider, extendTheme} from 'rn-base-component'

const customTheme = extendTheme({
  colors: {
    primary: '#007AFF',
    secondary: '#5856D6',
  },
  spacing: {
    small: 8,
    medium: 16,
    large: 24,
  },
})

export default function App() {
  return <BaseProvider theme={customTheme}>{/* Your app components */}</BaseProvider>
}

TypeScript Support

All components are built with TypeScript and include comprehensive type definitions:

import {CodeInputRef, CodeInputProps} from 'rn-base-component'

const codeInputRef = useRef<CodeInputRef>(null)

const handleSubmit = (code: string) => {
  // Full type safety
  codeInputRef.current?.clear()
}

Accessibility

All components follow accessibility best practices:

  • Screen reader support with proper labels
  • Keyboard navigation where applicable
  • Focus management with clear indicators
  • ARIA attributes for complex components
  • High contrast support

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT