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

@horacehylee/flexbox-react

v4.4.1

Published

Unopinionated, standard compliant flexbox component. No propietary APIs. Nothing but flexbox.

Downloads

3

Readme

flexbox-react

Intro

Unopinionated, standard compliant flexbox components.

Why

You should not learn any proprietary syntax, classnames or API's for this. If you know how to use flexbox, you know how to use flexbox-react components.

No more <Container>, <SpacedBox>, <Column>, <View>, <Section> or any other arbitrarily named and spec ed components to layout your apps.

No more first={true}, ternary={true}, spaced={true},grouped={true} or any other arbitrarily named and spec ed props to layout your apps.

flexbox-react is agnostic of which post/pre css build flow you have, it works out of the box. It's agnostic to it. You could have all your styling on css files. Or all inlined. This sits just in the middle. It might be a good idea to see your components and know how they are laid out without jumping between css files or arbitrary, layout-exclusive components specifications.

How

No hardcoded, bloated, unnecessary vendor prefixes, by caniuse. Just those your browser needs, based on your userAgent.

No need to import any new stylesheet or to add any styles to your existing stylesheets. It works out of the box, just by using the component.

Install

yarn add @horacehylee/flexbox-react
# or
npm install --save @horacehylee/flexbox-react

Usage

import Flexbox from 'flexbox-react';

// ...
<Flexbox flexDirection="column" minHeight="100vh">
  <Flexbox element="header" height="60px">
    Header
  </Flexbox>

  <Flexbox flexGrow={1}>
    Content
  </Flexbox>

  <Flexbox element="footer" height="60px">
    Footer
  </Flexbox>
</Flexbox>

Sticky footer!

As you can see, there're some extra props as layout ing helpers. Those are height, minHeight, maxHeight, width, minWidth, maxWidth, padding, paddingTop, paddingRight, paddingBottom, paddingLeft, margin, marginTop, marginRight, marginBottom, and marginLeft. The idea of flexbox-react is to be a complete solution to build layouts. Since, well, flexbox is a complete solution to build layouts. It's all about the sugar. Feel free to create an issue or submit a PR if you think there's room for improvement here!

Semantic HTML tags

If you need to use a tag other than <div> for the layout, like <header> or <section>, you can pass an extra element prop to the <Flexbox /> component:

<Flexbox element="header" height="80px">
  ...
</Flexbox>

which will render to this:

<header style="display: flex; height: 80px;">
  ...
</header>

Props

Take a look at Flexbox PropTypes. No mysteries. As said, you just need to know actual flexbox properties not any proprietary syntax for them. If you're not familiar with flexbox, this is a good starting point.

If TypeScript is your cup of tea, check the type definitions, we support them too.

License

MIT © Ignacio Álvarez