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 🙏

© 2026 – Pkg Stats / Ryan Hefner

styled-bento

v0.0.28

Published

Layout atoms based on styled-system and rebass

Downloads

5

Readme

styled-bento

Layout atoms based on styled-system and rebass

NPM JavaScript Style Guide

Install

npm install --save styled-bento

Usage

Theese components are builded in top of rebass and styled-system, so if you don't know about theese libraries, you should visit their documentation:
Rebass page
Styled System

import { Flex } from 'styled-bento'

const App = () => {
  return (
    <Flex 
      width={[1, 2, 5]}
      justifyContent={['column', 'row']}>
      <p>Responsive<p>
      <p>Props<p>
    </Flex>
  )
}
import { Flex } from 'styled-bento'

const App = () => {
  return (
    <Flex 
      width={[1, 2, 5]}
      justifyContent={['column', 'row']}>
      <p>Responsive<p>
      <p>Props<p>
    </Flex>
  )
}

Styled bento exports the following components:

Basic props: | Prop | Type | Required | Default | | ------ | ---------------- | -------- | ------- | | mark | Bool || String | false | false | | center | Bool || String | false | false |

  • mark: display a dashed border in the component.
    • mark='color' changes the color of the border.
  • center: centers horizontally and vertically the content, equivalent to justify-content: center and align-items: center.
    • center='v || h' applies only one orientation to center.

Mark and Center

Passing booleans

// centers horizontally and vertically and it's marked with black border
const markAndCentered = () => {
  return (
    <Flex mark center>
      <p>Marked<p>
      <p>And Centered<p>
    </Flex>
  )
}

Passing strings

// centers vertically and it's marked with yellow border

const markYellowAndVerticallyCentered = () => {
  return (
    <Flex mark='yellow' center='v'>
      <p>Vertically,<p>
      <p>yellow marks<p>
    </Flex>
  )
}

Bento

Bento is a conceptual way to understand grid with template areas, designed to maintain clear semantics for a good code readability, and easy responsive flexibility and composability. Bento is inspired by atomic-layout package but with rebass in mind.

Why use this pattern?

import { Bento } from 'styled-bento'

const App = () => {
  return (
    <Bento
      mark='pink'
      gap={['10px', '50px', '100px']}
      areas={[
        `'header' 'content'`,
        `'header header'
        'sidebar content'`,
        `'header header'
        'content sidebar'`
      ]}
    >
      {({ Header, Content, Sidebar }) => (
        <>
          <Header as={AutoColumns} center mark='blue'>
            <Text>Header</Text>
            <Text>Header</Text>
          </Header>
          <Content>Content</Content>
          <Sidebar mark center as={Row}>
            Sidebar
          </Sidebar>
        </>
      )}
    </Bento>
  )
}

Try the Demo.

Column

import { Column } from 'styled-bento'

const App = () => {
  return (
    <Column>
      <p>We<p>
      <p>are<p>
      <p>in<p>
      <p>a<p>
      <p>column<p>
    </Column>
  )
}

Try the Demo.

Row

import { Row } from 'styled-bento'

const App = () => {
  return (
    <Row>
      <p>side<p>
      <p>by<p>
      <p>side<p>
      <p>paragraph<p>
    </Row>
  )
}

Try the Demo.

AutoColumns

import { AutoColumns } from 'styled-bento'

const App = () => {
  return (
    <AutoColumns>
      <p>side<p>
      <p>by<p>
      <p>side<p>
      <p>paragraph<p>
    </AutoColumns>
  )
}

Try the Demo.

Masonry

Masonry layout.

Basic props: | Prop | Type | Required | Default | | ------ | ---------------- | -------- | ------- | | cols | int array | false | [3] | | gap | int | false | 0 |

import { Masonry } from 'styled-bento'

const App = () => {
  <Masonry cols={[4, 5, 6, 7]} mark='violet'>
    <Box mark='white' height='50px'>1</Box>
    <Box mark='white' height='150px'>2</Box>
    <Box mark='white' height='80px'>3</Box>
    <Box mark='white' height='50px'>4</Box>
    <Box mark='white' height='100px'>5</Box>
  </Masonry>
}

Try the Demo.

Text

Try the Demo.

ResizableText

Text that autoresizes to take one line in every screen size.

Basic props: | Prop | Type | Required | Default | | ------ | ---------------- | -------- | ------- | | maxSize| int | false | null | | center | Bool || String | false | false |

Try the Demo.

License

MIT © MigueloAtla