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

fenster

v1.3.2

Published

Isolated view of your react-native screens and components.

Downloads

4

Readme

fenster

fenster for React Native is a simple way to view and develop your components in isolation. Compared to storybook, fenster doesn't use a second bundler and also doesn't expose another app. Instead fenster is a part of your app and simply uses the metro bundler, which already bundles your app. No worries, fenster won't be included in production builds.

fenster stores which component you're currently viewing, so even if you reload the app to see changes, it won't lose its state.

Table of Contents

Background

Fenster, das
n – /ˈfɛnstɐ/ – german for "window"

fenster is a window into your app.

Viewing screens without navigating through your app is essential for fast and comfortable development. React Native's hot module reloading isn't 100% reliable, you don't want to navigate through your app all over again after reloading the app.

Maybe you too temporarily changed the initial screen of your app, just to fix some styling. And that's basically what fenster does: when active, fenster renders a single component instead of the whole app.

Install

npm install fenster

Setup

Wrap your whole app inside FensterRahmen and pass an array of components, which fenster should display.

import React from 'react'
import { FensterRahmen } from 'fenster'

import HomeScreen from './HomeScreen'
import fenster from './fenster'

export default class App extends React.Component {
  render() {
    return (
      <FensterRahmen components={fenster}>
        <HomeScreen />
      </FensterRahmen>
    )
  }
}
// fenster.js

import HomeScreen from './HomeScreen'
import FancyButton from './FancyButton'

export default [
  { name: 'Home Screen', component: HomeScreen },
  { name: 'FancyButton', component: FancyButton }
]

FensterRahmen

The wrapper around your app. It controls the currently visible component (children or an active fenster).

components

Array of objects { group, name, component }.

  • group (string, optional) allows you to group fensters. If you provide no group, it will show the component under "Components".
  • name (string, required) is the display name in the list of fensters.
  • component (React component, required) is the component to render.

Default: []

Example:

const components = [
  { group: 'Screens', name: 'Home', component: HomeScreen },
  { group: 'Screens', name: 'Settings', component: SettingsScreen },
  { name: 'FancyButton', component: FancyButton }
]

<FensterRahmen components={fenster}>
  {/* ... */}
</FensterRahmen>

You can also use FensterGroup to write your fenster components in a more convenient way.

import { FensterGroup } from 'fenster'

const screens = new FensterGroup('Screens')

screens.add('Home', () => <HomeScreen />)
screens.add('Settings', () => <SettingsScreen />)

const components = [
  screens,
  { name: 'FancyButton', component: FancyButton }
]

<FensterRahmen components={fenster}>
  {/* ... */}
</FensterRahmen>

frame

Render prop for the wrapper around the active component inside fenster.

Default: ({ children }) => children

Example:

const renderFrame = ({ children }) => (
  <React.Fragment>
    <StatusBar barStyle="dark-content" backgroundColor="white" />
    {children}
  </React.Fragment>
)

<FensterRahmen frame={renderFrame}>
  {/* ... */}
</FensterRahmen>

Usage

Open the fenster UI by swiping from right to left at the bottom of the screen.

Close the active fenster by pressing the × next to the active component name.

License

MIT © Timo Mämecke