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

golly

v0.3.1

Published

Powerful flexbox grid system built on top of glamor.

Downloads

12

Readme

Golly 👻

npm version Dependency Status styled with prettier

Powerful flexbox grid system built on top of glamor. If you want even more super powers, pair this library with react-matches to change yer columns when the screen resizes 🔥

near-future goals:

  • generate as little CSS as possible.

  • tests

  • docs/demo site

Install

yarn add golly

npm install golly --save

Example Usage

import { Flex, Grid, Cell } from 'golly'

const GridComponent = () => (
  <Grid size={12} gutter={{ x: 32, y: 16 }}>
    <Cell size={6} alignItems="center" justifyContent="center">
      <Flex>
        Flex all the way down 🐢
      </Flex>
    </Cell>
    <Cell size={6} alignItems="center" justifyContent="center">
      <Flex>
        Always rely on your flex hammer 🔨
      </Flex>
    </Cell>
  </Grid>
)

Flex component

This is the base component of the grid system. It renders a flex div by default and provides a convenient API around all of the possible flex styles.

tag: PropTypes.string

The HTML tag to render.

innerRef: PropTypes.func

Get access to the internal ref.

inline: PropTypes.bool

Sets CSS display property to inline-flex

order: PropTypes.number

Sets CSS order property

grow: PropTypes.number

Sets CSS flexGrow property

shrink: PropTypes.number

Sets CSS flexShrink property

basis: PropTypes.string

Sets CSS basis property as well as minWidth to help normalize bugs in IE

direction: PropTypes.oneOf(['row','row-reverse','column','column-reverse'])

Sets CSS flexDirection property

wrap: PropTypes.oneOfType([PropTypes.string, PropTypes.bool])

Sets CSS flexWrap property

justifyContent: PropTypes.oneOf(['center','end','space-around','space-between','space-evenly','start'])

Sets CSS justifyContent property, space-evenly is polyfilled by adding before and after pseudo elements.

align: PropTypes.oneOf(['baseline', 'stretch', 'center', 'end', 'start'])

Sets CSS alignSelf property

alignItems: PropTypes.oneOf(['baseline','stretch','center','end','start'])

Sets CSS alignItems property

alignContent: PropTypes.oneOf(['center','end','space-around','space-between','start','stretch'])

Sets CSS alignContent property

Grid component

Dictates the number of columns and the spacing between those columns. Accepts any props that the Flex component accepts.

size: PropTypes.number

The size of a track. This can either be a row or column depending on what the grid's direction prop is set to.

gutter: gutter: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({x:PropTypes.number, y:PropTypes.number})])

Horizontal and vertical spacing between cells, set each respective axis by passing an object of { x, y }.

Cell component

Use to lay content along the grid. Accepts any props that the Flex component accepts.

size: PropTypes.oneOfType([PropTypes.number, PropTypes.string])

The amount of space on the track a cell will occupy. Defaults to 1.

pull: PropTypes.number

Pull the cell by any number of track sizes.

push: PropTypes.number

Push the cell by any number of track sizes.

order: PropTypes.number

The order of the cell in the grid. Because of the grid implementation and how we set gutters, this will actually move the cell in your tree by ordering the children before rendering.

Running Locally

clone repo

git clone [email protected]:souporserious/golly.git

move into folder

cd ~/golly

install dependencies

yarn

run dev mode

yarn dev

open your browser and visit: http://localhost:8080/