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

light-layout-component

v0.1.10

Published

easy and useful layout component

Downloads

39

Readme

Getting Started with light-layout-component

Try using a Container, Flex, Grid as layout component from where you want to use it!

Installation

npm install light-layout-component

or

yarn add light-layout-component

1. Container

It's the most basic layout element. You can wrap childrens or design background.

Props

All props are optional.

children?: ReactNode

as?: | "div" | "main" | "section" | "article" | "nav" | "header" | "footer" | "aside";

  • default value: "div"
  • a name of tag for semantic layout

mediaTarget?: "mobile" | "tablet" | "desktop"

  • It provides appropiate minWidth and maxWidth responding to media target.

minWidth?: string

maxWidth?: string;

minHeight?: string;

maxHeight?: string;

padding?: string;

margin?: string;

background?: string;

borderRadius?: string;

border?: string;

overflow?: string;

Example

<Container
  as="div"
  minWidth="100px"
  maxWidth="110px"
  minHeight="200px"
  maxHeight="300px"
  background="pink"
>
  It's Container
</Container>

2. Flex

Flex component can quickly manage the alignment of its children components.

Props

All props are optional.

children?: ReactNode

direction?: "column" | "column-reverse" | "row" | "row-reverse"

  • default value: "row"
  • a direction of Flex

justify?: CSS.Property.JustifyContent

  • default value: "flex-start"

align?: CSS.Property.AlignItems

  • default value: "flex-start"

gap?: string;

  • a gap of children components

Example

<Flex justify="center" align="center" gap="10px">
  <button>1</button>
  <button>2</button>
  <button>3</button>
</Flex>

3. Grid

Grid layout is a two-dimensional layout system. This feature allows you to content in rows and columns.

Props

rows and columns are required.

children?: ReactNode

rows: string

columns: string

gap?: string

isAutoFill?: string

  • When true, It fills as many columns as the width fits.

Example

<Grid rows="2" columns="3" gap="10px">
  <button>1</button>
  <button>2</button>
  <button>3</button>
  <button>1</button>
  <button>2</button>
  <button>3</button>
</Grid>

4. TabLayout

Props

tabsMenu is required.

tabsMenu: string[]

children?: ReactNode[]

tabWidth?: ${number}px | ${number}rem | ${number}em | ${number}vw | ${number}%

tabMenuHeight?: ${number}px | ${number}rem | ${number}em | ${number}vw | ${number}%

tabMenuFontSize?: string

tabMenuBorderBottomColor?: string

defaultTabIndex?: number;

Example

<TabLayout tabsMenu={["tab1", "tab2", "tab3"]} tabWidth="50%">
  <div>first Tab</div>
  <div>second Tab</div>
  <button>third Tab</button>
</TabLayout>