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

open-palette

v1.0.3

Published

``` import {Separator} from 'open-palette' ```

Downloads

3

Readme

SEPARATOR works. The other things are half broken.




8797 yarn login 8798 yarn publish 8799 yarn start


How to use

import {Separator} from 'open-palette'

Storybook Example

You can use Storybook to test and share your component library quickly and easily! This example shows how to use Expo modules with Storybook CLI and Expo CLI.

Running with Storybook CLI

expo web with storybook-cli

web only

This method runs your Expo components in a Storybook-React environment. This is different to Expo web, but may prove helpful as the Storybook-React community is more robust than the Storybook-React Native community.

  • Create Expo project expo init my-project

    • You can use any template, we'll use the managed blank TypeScript project for this example.
  • cd into the project and run npx -p @storybook/cli sb init --type react to bootstrap a new React project

  • Install the expo webpack config so we can add unimodules support yarn add -D @expo/webpack-config

  • Create a custom webpack config touch .storybook/webpack.config.js

    const { resolve } = require('path')
    const { withUnimodules } = require('@expo/webpack-config/addons')
    
    module.exports = ({ config }) => {
      return withUnimodules(config, { projectRoot: resolve(__dirname, '../') })
    }
  • Run yarn build-storybook to try it out!

    • The example should open to http://localhost:6006/
  • You may also want to add storybook-static to your .gitignore

📁 File Structure

Expo with Storybook CLI
├── stories
│ └── Example.stories.js ➡️ A Storybook page to render
├── .storybook
│ ├── config.js ➡️ The entry point / config for a typical Storybook project.
│ └── webpack.config.js ➡️ The custom Webpack config used to add Expo support to Storybook CLI.
├── assets ➡️ All static assets for your project
├── storybook-static ➡️ Generated Storybook files (should be ignored)
└── babel.config.js ➡️ Babel config (should be using `babel-preset-expo`)

Running with Expo CLI

This method is universal :]

This project can be used for iOS, Android, and web! You may find that it's better to use it for native only, and to use the "Running with Storybook" method for web. Unlike the Expo + Next.js flow, you can use both web methods at the same time!

  • Create Expo project expo init my-project
    • You can use any template, we'll use the managed blank TypeScript project for this example.
  • cd into the project and run npx -p @storybook/cli sb init --type react to bootstrap a new React project.
  • Install the Storybook React Native package:
    • yarn add -D @storybook/react-native
  • In your App.tsx or App.js
import { configure, getStorybookUI } from '@storybook/react-native'

configure(() => {
  // Since require.context doesn't exist in metro bundler world, we have to
  // manually import files ending in *.stories.js
  require('./stories')
}, module)

export default getStorybookUI()
  • Create a file for importing all of the stories (stories/index.js):

    • touch stories/index.js
    • Import all of your stories in this file. Ex:
    // stories/index.js
    import './1-Button.stories'
  • Register your stories for React Native:

// Example.stories.js
+ import { storiesOf } from '@storybook/react-native';

export const text = () => ( /_ Example JSX _/ );

// Register your story with the `module`, name, and React functional component.

+ storiesOf('Button', module).add('Text', text);
  • Now run expo start to see it in action!

📁 File Structure

Storybook with Expo CLI
├── stories
│   ├── index.js ➡️ Native story imports
│   └── Example.stories.js ➡️ A Storybook page to render
├── assets ➡️ All static assets for your project
├── App.tsx ➡️ Entry Point for universal Expo apps
├── app.config.js ➡️ Expo config file
└── babel.config.js ➡️ Babel config (should be using `babel-preset-expo`)

📝 Notes

open-palette