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

dubl-shared-components

v1.0.2

Published

A reusable React Native component library for the **Dubl** project. Built with [React Native](https://reactnative.dev) and [Tailwind](https://tailwindcss.com) via [tailwind-rn](https://github.com/vadimdemedes/tailwind-rn).

Readme

Dubl Shared Components

A reusable React Native component library for the Dubl project. Built with React Native and Tailwind via tailwind-rn.

Table of Contents


Overview

The Dubl Shared Components repository provides a set of React Native UI components that can be consumed by multiple Dubl apps (e.g., Android-only and iOS-only apps).

  • TypeScript for type safety
  • ESLint + Prettier for consistent code formatting and linting
  • Jest for unit testing
  • Tailwind styling via tailwind-rn

Features

  • Reusable Components: Common UI elements (buttons, inputs, forms, etc.) shared across Dubl apps.
  • Tailwind-based: Consistent, utility-first styling for React Native.
  • Modular: Exported as a library for easy consumption in other projects.
  • Type Declarations: Ships .d.ts files for seamless integration with TypeScript apps.

Installation

  1. Clone the repository or include it as a submodule in your monorepo.
  2. Install dependencies:
    yarn
  3. Build the library to generate TypeScript declaration files:
    yarn build

Consuming in Another Project

If you’re linking locally:

# From the main app
yarn add file:../dubl-shared-components

You can then import shared components as:

import { Button } from 'dubl-shared-components';

Usage

In your React Native application:

  1. Install the library (local or via a private registry).

  2. Import the component you need:

    import React from 'react';
    import { View } from 'react-native';
    import { Button } from 'dubl-shared-components';
    
    export function HomeScreen() {
      return (
        <View>
          <Button label="Click Me" onPress={() => alert('Hello from Dubl!')} />
        </View>
      );
    }
  3. Run your React Native app (yarn android or yarn ios) to see the shared component in action.


Development

  1. Clone or open the dubl-shared-components repo.
  2. Install Dependencies:
    yarn
3. **Start coding**. All source files live in the `src/` folder.

### Creating New Components

To create a new component:

1. **Create the component structure**:

src/components/your-component/ ├─ YourComponent.tsx # Main component file ├─ YourComponent.styles.ts # Component styles └─ your-component.stories.tsx # Storybook stories


2. **Implement the component** (`YourComponent.tsx`):
```tsx
import React from 'react';
import { View } from 'react-native';
import { styles } from './YourComponent.styles';

interface YourComponentProps {
// Define your props here
testID?: string;
}

export function YourComponent({ testID }: YourComponentProps) {
return (
<View style={styles.container} testID={testID}>
    {/* Your component content */}
</View>
);
}
  1. Add styles (YourComponent.styles.ts):
import { StyleSheet } from 'react-native';

export const styles = StyleSheet.create({
container: {
// Your styles here
},
});
  1. Create Storybook stories (your-component.stories.tsx):
import type { Meta, StoryObj } from '@storybook/react';
import { YourComponent } from './YourComponent';

const meta: Meta<typeof YourComponent> = {
title: 'Components/YourComponent',
component: YourComponent,
};

export default meta;
type Story = StoryObj<typeof YourComponent>;

export const Default: Story = {
args: {
// Your default props
},
};
  1. Export the component in src/index.ts:
export * from './components/your-component/YourComponent';

Testing in Storybook

  1. Start Storybook:
yarn storybook
  1. View your component:
  • Open http://localhost:6006
  • Find your component under the Components section
  • Interact with different stories and props
  • Test various states and configurations
  1. Testing tips:
  • Use the Controls panel to modify props in real-time
  • Create multiple stories for different states/variations
  • Test edge cases and error states
  • Verify responsive behavior using the viewport controls

Linting & Formatting

  • Lint your code:
    yarn lint
  • Auto-format with Prettier:
    yarn format

Testing

  • Run all tests with Jest:
    yarn test
  • Write your unit tests in __tests__ directories or alongside components as *.test.ts or *.spec.ts.

Building

  • Generate .d.ts files (and optionally .js if you remove emitDeclarationOnly) in dist/:
    yarn build

Scripts

Below are the main npm/yarn scripts defined in package.json:

| Script | Command | Description | | -------- | ----------------------------------------- | ----------------------------------------------------------- | | lint | eslint 'src/**/*.{js,ts,tsx}' | Runs ESLint on all source files. | | format | prettier --write 'src/**/*.{js,ts,tsx}' | Formats all source files with Prettier. | | test | jest | Runs the unit test suite using Jest. | | build | tsc | Compiles TypeScript and emits declaration files to dist/. |


Project Structure

dubl-shared-components/
├─ .vscode/                # VS Code workspace settings (optional)
│   ├─ extensions.json
│   └─ settings.json
├─ src/
│   ├─ components/
│   │   └─ Button.tsx      # Example shared Button component
│   └─ tailwind.ts         # tailwind-rn config
├─ __tests__/              # Jest tests (optional structure)
├─ dist/                   # Output folder (after build)
├─ .gitignore
├─ .nvmrc                  # Optional Node version file for nvm
├─ package.json
├─ tsconfig.json
└─ yarn.lock

License

MIT


Happy coding! If you have any questions or issues, please feel free to open an issue or submit a pull request.