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

@qatalog/react-flex

v0.2.2

Published

A browser-agnostic flexbox component with CSS gap support

Downloads

3

Readme

@qatalog/react-flex

  1. What's this?
  2. Why should I use this package?
  3. What CSS-in-JS library does this package use?
  4. How do I use it?
  5. What is the full list of props?
  6. What versions of Node does it support?
  7. Is there a changelog?
  8. What license is it released under?

What's this?

A browser-agnostic flexbox component with CSS gap polyfill support. Uses feature detection to ensure consistent rendering across platforms.

Why should I use this package?

There are 3 main reasons to use this package compared to other similar packages in the ecosystem.

  1. Simplicity: This package provides only a single component called Flex which renders a single DOM element with flexbox. This allows users to compose however many layers of flexboxes they want. This package also keeps the props of the component simple and straightforward.
  2. Flexibility: This package neither assumes any responsive design logic nor hardcodes measurements. This allows users to provide these values when using the component making it usable in all scenarios.
  3. Compatibility: This package supports browsers that do not support gap CSS property by using margin CSS properties and custom calculation logic. This allows users to fearlessly use the flexbox grid design everywhere.

What CSS-in-JS library does this package use?

While we do use styled-components, we are open to any contributions that makes this package independent of styling libraries.

How do I use it?

Simply import it and use it as any regular component.

import Flex from '@qatalog/react-flex';

const Button = ({}) => {
  return (
    <Flex direction="row" alignItems="center" wrap="wrap" gap={8}>
      <div>One</div>
      <div>Two</div>
    </Flex>
  );
};

export default Button;

What is the full list of props?

All the below props are optional.

  • alignContent: Value for CSS style property align-content
  • alignItems: Value for CSS style property align-items
  • justifyContent: Value for CSS style property justify-content
  • direction: Value for CSS style property flex-direction
  • wrap: Value for CSS style property flex-wrap
  • inline: Extrapolates value for CSS style property display. Defaults to false.
    • false: Value is flex
    • true: Value is inline-flex
  • gap: Value of gap between children in px units. Defaults to 0. Uses gap CSS style property if supported.
  • as: Renders the component as this type of DOM element. Type of prop is React.ElementType. Defaults to div.

What versions of Node does it support?

Minimum supported node version is 14.

Is there a changelog?

Yes.

What license is it released under?

MIT.