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

@intactile/react-layout

v0.6.0

Published

React layout components

Downloads

5

Readme

React Layout

The Every Layout layouts implemented as a set of React components.

Install

$ yarn add @intactile/react-layout

Setup

This set of components is highly opiniated and as advised in “Every Layout” it makes use of a modular scale to set some sensible default. You should define at least 2 custom css properties: --s1 (default spacing value) and --measure (sensible default for the length of a text line). I encourage you to start with the following scale and adapt it to your needs.

:root {
  --ratio: 1.5;
  --s-5: calc(var(--s-4) / var(--ratio));
  --s-4: calc(var(--s-3) / var(--ratio));
  --s-3: calc(var(--s-2) / var(--ratio));
  --s-2: calc(var(--s-1) / var(--ratio));
  --s-1: calc(var(--s0) / var(--ratio));
  --s0: 1rem;
  --s1: calc(var(--s0) * var(--ratio));
  --s2: calc(var(--s1) * var(--ratio));
  --s3: calc(var(--s2) * var(--ratio));
  --s4: calc(var(--s3) * var(--ratio));
  --s5: calc(var(--s4) * var(--ratio));

  --measure: 65ch;
}

Use

import { Box } from '@intactile/react-layout';

function MyComponent() {
  return (
    <Box>content</Box>
  );
}

Layouts

Eleven differents layouts are currently implemented: Box, Center, Cluster, Cover, Frame, Grid, Imposter, Reel, Sidebar, Stack and Switcher.

Box

Props

| Name | Type | Default | Description | | ------------ | ------- | -------- | ----------- | | padding | string | var(--s1, 1.5rem) | Set the padding around the box, accept any valid css size value | | borderWidth | number | 1 | Set the width of the border around the box |

Center

Props

| Name | Type | Default | Description | | ------------ | ------- | -------- | ----------- | | gutters | string | null | Set the gutters on each side of the layout, accept any valid css size value | | max | string | var(--measure, 65ch) | Set the max width of the layout, accept any valid css size value | | andText | bool | false | Should the text inside the layout also be centered or not? | | intrinsic | bool | false | Should the “nodes” inside the layout also be centered or not? |

Cluster

Props

| Name | Type | Default | Description | | ------------ | ------- | -------- | ----------- | | space | string | var(--s1, 1.5rem) | Set the gutters on each side of the layout, accept any valid css size value | | justify | string | flex-start | Use a valid justify-content css property value | | align | string | flex-start | Use a valid align-items css property value |

Sidebar

Props

| Name | Type | Default | Description | | ------------ | ------- | -------- | ----------- | | side | string | left | Which element to treat as the sidebar, accept "left" or "right" | | sideWidth | string | null | Represents the width of the sidebar when adjacent. If not set (null) it defaults to the sidebar's content width | | contentMin | string | 50% | A CSS percentage value. The minimum width of the content element in the horizontal configuration | | space | string | var(--s1) | Set the space between the sidebar and the main content, accept any valid css margin value |

Stack

Props

| Name | Type | Default | Description | | ------------ | ------- | -------- | ----------- | | space | string | var(--s1) | Set the space between each children of the layout, accept any valid css margin value | | splitAfter | number | null | The element after which to split the stack with an auto margin |

Switcher

Props

| Name | Type | Default | Description | | ------------ | ------- | -------- | ----------- | | space | string | var(--s1) | Set the space between each children of the layout, accept any valid css margin value | | threshold | number | var(--measure) | Represent the container breakpoint, accept any valid css width value | | limit | number | 4 | Represent the maximum number of items allowed for a horizontal layout |