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

rego-layout-component

v0.3.7

Published

React layout components, Container, Flex, Grid.

Downloads

20

Readme

Rego's Layout Components

Container

introduction

This is just simple Container that you can use.

You can control options(ex.minWidth) of Container with props.

example

<Container minWidth={100} maxWidth={200}>
  <div>Hello, World!</div>
</Container>

options

There are several options for Container. I'll describe all of options for you.

  1. minWidth: The minWidth setting requires number(px) or string(n%) to be entered(default: '100%').

example of number

<Container minWidth={100}>Hello, World!</Container>

example of string

<Container minWidth={'100%'}>Hello, World!</Container>
  1. maxWidth: The maxWidth setting requires number(px) or string(n%) to be entered(default: '100%').

  2. overflow: You can decide on the overflow option among the following options.

    auto | scroll | hidden | visible

  3. padding: You can determine padding by entering number for Container

  4. borderRadius: The borderRadius setting requires number(px) or string(n%) to be entered.

example of number

<Container borderRadius={8}>Hello, World!</Container>

example of string

<Container borderRadius={'50%'}>Hello, World!</Container>
  1. background: The background setting requires string that color name(ex.red, white) or Hex(ex. #ffffff)(default: 'white').

Grid

introduction

This is simple Gird layout component.

You can control number of Grid's columns, rows with props.

example

<Grid column={3} row={3} gap={10}>
  <div>first</div>
  <div>second</div>
  <div>third</div>
  <div>fourth</div>
  <div>fifth</div>
  <div>sixth</div>
</Grid>

options

  1. column: The column decides value of repeat($value, 1fr) attribute by entering number.

  2. row: The row decides value of repeat($value, 1fr) attribute by entering number like column does.

  3. gap: The gap decides gap of columns and rows by entering number.

  4. padding: You can determine padding by entering number for Grid


Flex

introduction

This is simple Flex component you can use.

There are several options you can control. direction, justify, and so on.

options

  1. direction: You can decide on the direction option among the following options.

    row | column

  2. justify: You can decide on the justify option among the following options.

    center | baseline | flex-start | flex-end | space-around | space-between | space-evenly

  3. align: You can decide on the align option among the following options.

    center | flex-start | flex-end

  4. gap: The gap decides gap of columns and rows by entering number.

  5. padding: You can determine padding by entering number for Grid


Drawer

introduction

This Drawer has children for render. Drawer appear where anchor you input.

example

import { Drawer, useDrawer } from 'rego-layout-component';

// ...

const { isOpen, closeDrawer, openDrawer } = useDrawer();

return (
  <div>
    <button onClick={openDrawer}>open drawer</button>
    <Drawer anchor="left" isOpen={isOpen} closeDrawer={closeDrawer} padding={1}>
      <div>Home</div>
      <div>MyPage</div>
      <div>Setting</div>
    </Drawer>
  </div>
);

options

  1. anchor: You can decide on the direction option among the following options.

    'left' | 'right' | 'top' | 'bottom'

  2. isOpen: You can control Drawer's state by isOpen.

  3. closeDrawer: This function is used to close Drawer.

  4. padding: You can determine padding by entering number for Grid