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

@i34/show

v0.0.2

Published

> TODO: description

Downloads

2

Readme

@i34/show

An opinionated React layout component designed with "slots" for Apps and Blogs with built in semantic layout, responsiveness for mobile, tablet and desktop platforms and research-based UX best practices.

Storybook examples

Usage

This layout component has the following "slots" you can use to design pages:

  • page - replaces everything in the view (no other slot elements)
  • header - typical area at the top of the page, moves over in tablet mode
  • nav - displays at the top horizontally for desktop, left vertically for tablet, and bottom horizontally for mobile
  • main - body content
    • section - displays at the top or left of article
    • aside - left panel, next to article
    • details - right panel, next to article
  • footer - below main

All slots are not rendered unless content is set. Like: <Show header={<h1>Show</h1>}></Show>

Styling concepts

Mix and match any of the following methods:

CSS modules are used for styling All "functional" layout css is isolated using css-modules to avoid conflict with any existing CSS. Nice for embedding into apps or whatever.

But you can use inline styles kinda like styled components You can add inline styles (anything that would work in the react 'style' prop) for each slot in the form of: <Show headerStyle={{background: "black", color: "white"}} header={<h1>Show</h1>}></Show> All slot style props are available in the {slot}Style format like navStyle or mainStyle

Or Insert your own CSS classnames for any slot kinda like global CSS or use classes from existing CSS You can also add classes you write or that exist already in an app in a similar way to styles. All slot CSS class props are available in the {slot}Class format like navClass or mainClass For example:

<Show headerClass={'my-special-css-class'} header={<strong>Header with local style</strong>}></Show>

Semantic html elements

if you want to use global css, the following elements can be styled (or inherit existing styles)

header, nav, section, article, aside, details, footer, main

Targetable id's

If you want to target any of the layout elements, id's are assigned to the semantic elements above in the format of:

ux-show-{element}

So as an example you can do #ux-show-header { background: black; } in your css These id's can also be used to add your own styles or override any CSS from higher up the chain if required.

CSS variables

These css variables set the base size proportions.

--layout-base-size - sets the width/height of the nav (min-height of 48px is default but will grow to content) --layout-panel-size - sets the min width of the section and aside slots (240px is default but will grow to content)

React

const show = require('@i34/show');

Simply create your views using the dynamic slots provided:

<Show header="Header" nav="Nav" aside="Aside" details="Details" article="Article" footer="Footer"></Show>

Roadmap

  • Allow for local styling directly in react

Versions

0.0.2

  • Ability to add custom CSS inline styles
  • Ability to inject custom CSS classes

0.0.1

  • First release with base responsive layout frame with "slots"