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

hello-grid

v0.1.9

Published

*Hello, Grid!* is a minimalist (1KB gzipped), flexbox-based, grid system created to simplify the process of programming complex (and not so complex) layouts for modern web-applications using JSX.

Downloads

2

Readme

Hello, Grid!

Hello, Grid! is a minimalist (1KB gzipped), flexbox-based, grid system created to simplify the process of programming complex (and not so complex) layouts for modern web-applications using JSX.

Out of the box, Hello, Grid! contains no initial styling, themes, or colors. It's primary purpose is layout architecture and content arrangement, relying on your application to style your blueprint however you see fit.

Installation

With npm:

npm i hello-grid

Or, with yarn:

yarn add hello-grid

Getting Started

Once installed, you can start using Hello, Grid! to create layouts using it's Grid, Row and Column component hierarchy

import { Grid, Row, Column } from "hello-grid";

const MyGrid = () => (
  <Grid>
    <Row>
      <Column>
        Row 1, Column 1
      </Column>
      <Column>
        Row 1, Column 2
      </Column>
    </Row>
    <Row>
      <Column>
        Row 2, Column 1
      </Column>
      <Column>
        Row 2, Column 2
      </Column>
    </Row>
  </Grid>
);

This should give you a result that looks extremely bare-bones, only using the flexbox styles to acheive what would look like this: basic screenshot

Using Props

Using the same example above, the layout can be significantly changed using the included formatting props.

const MyGrid = () => (
  <Grid margin padded bordered>
    <Row padded bordered>
      <Column margin padded centered bordered>
        Row 1, Column 1
      </Column>
      <Column margin padded bordered>
        Row 1, Column 2
      </Column>
    </Row>
    <Row margin="top">
      <Column padded bordered>
        Row 2, Column 1
      </Column>
      <Column centered>
        Row 2, Column 2
      </Column>
    </Row>
  </Grid>
);

This can create a more visible, spaced out, and arranged blueprint to work from: basic props screenshot

Props list

margin (boolean, string, array)

margin || margin={true} || margin={false}
  // boolean. margin will be placed around the entire component

margin="top" || margin="bottom" || margin="left" || margin="right"
  // string. margin will only be placed on specified area

margin={["top", "bottom", "left", "right"]}
  // array. margin will be placed on all specified areas

padded (boolean, string, array)

padded || padded={true} || padded={false}
  // boolean. padding will be placed within the entire component

padded="top" || padded="bottom" || padded="left" || padded="right"
  // string. padding will only be placed within specified area

padded={["top", "bottom", "left", "right"]}
  // array. padding will be placed within all specified areas

bordered (boolean, string, array)

bordered || bordered={true} || bordered={false}
  // boolean. border will be placed over the entire component

bordered="top" || bordered="bottom" || bordered="left" || bordered="right"
  // string. border will only be placed over specified area

bordered={["top", "bottom", "left", "right"]}
  // array. border will be placed over all specified areas

centered (boolean, string)

centered || centered={true} || centered={false}
  // boolean. content within component will be centered both horizontal and vertical

centered="horizontal" || centered="vertical" 
  // string. content within component will be centered as specified

flex (string)

flex acts as a shortcut to the flex CSS shorthand property. This is useful for defining your own ratios within Rows and Columns when you do not want them to be equally distributed. All other valid usage for flex can be found in the official mdn documentation.

Fun / Experimental Props

collapsible (boolean)

When collapsible is used, it identifies that the Column or Row can be collapsed. Currently, Column collapses horizontally and Row collapses vertically.

collapsed (boolean)

When true, collapsed will collapse a collapsible grid component. If your grid component is already collapsed, toggling the collapsed prop will return the component to it's previous state.

CSS-Variables

To customize the default values for the padded, margin, bordered, and collapsible props, CSS variables can be used. With these, your Grid layout can have the default stylings of your choosing application-wide for the their corresponding props.

:root {
  --hello-grid-var-padding: 5px;
    /* default 10px */
  --hello-grid-var-margin: 5px; 
    /* default 10px */            
  --hello-grid-var-border: 2px solid gray;
    /* default 1px solid gray */  
  --hello-grid-var-border-radius: 5px;
    /* default 0 */
  --hello-grid-var-collapsible-transition: all 2000ms;
    /* default all 500ms */
}

Code Sandbox

Finally, if you'd like to test out Hello, Grid! a code sandbox has been created that utilizes all features of the library and can be freely used, edited, and forked for testing or as a template project.