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

tami-layout-component

v1.1.0

Published

Container, Grid, Flex, Drawer layout

Downloads

18

Readme

Install

npm install tami-layout-component
yarn add tami-layout-component

Container

화면의 폭에 따라 내용의 폭을 조절하고 레이아웃을 배치하는 컴포넌트입니다.

import { Container } from 'tami-layout-component';

Props

| props | value | description | | ---------------- | ---------------------- | ------------------------------------------------------------------ | | minWidth? | string | Container의 min-width값입니다. | | maxWidth? | string | Container의 max-width값입니다. (default 100%) | | padding? | string number | Container의 padding값입니다. | | centerContent? | boolean | Container의 자식 컴포넌트들의 중앙정렬 여부입니다. (default false) | | backgroundColor? | CSSProperties['color'] | Container의 배경색입니다.(default white) | | borderRadius? | string number | Container의 border-radius값입니다. | | children? | ReactNode | Container의 자식 컴포넌트입니다. |

Example

<Container maxWidth='600px' backgroundColor='#CCCCCC' centerContent>
  <div>Container</div>
</Container>

Flex

Flex 레이아웃(1차원 정렬)을 생성하기 위한 컴포넌트입니다.

import { Flex } from 'tami-layout-component';

Props

| props | value | description | | --------------- | ------------------------------- | ------------------------------------------ | | width? | CSSProperties['width'] | Flex의 너비값입니다. | | height? | CSSProperties['height'] | Flex의 높이값입니다. | | direction? | CSSProperties['flexDirection'] | Flex의 배치 방향을 정합니다. (default row) | | justifyContent? | CSSProperties['justifyContent'] | Flex의 중심축 정렬 방식입니다. | | alignItems? | CSSProperties['alignItems'] | Flex의 교차축 정렬 방식입니다. | | wrap? | CSSProperties['flexWrap'] | Flex Item들의 줄바꿈 설정입니다. | | gap? | number | Flex Item들 간의 간격입니다. | | children? | ReactNode | Flex의 자식 컴포넌트입니다. |

Example

<Flex direction='column' gap={12} width='300px'>
  <div>Item1</div>
  <div>Item2</div>
</Flex>

Grid

Grid 레이아웃 (2차원 정렬)을 생성하기 위한 컴포넌트입니다.

import { Grid } from 'tami-layout-component';

Props

| props | value | description | | -------- | ---------------------------------- | ---------------------------- | | height? | string | Grid의 높이값 입니다. | | areas? | CSSProperties['gridTemplateAreas'] | Grid의 영역입니다. | | rows? | number | Grid의 row 수 입니다. | | columns? | number | Grid의 column 수 입니다. | | gap? | number | Grid Item들 간의 간격입니다. | | children | ReactNode | Grid의 자식 컴포넌트입니다. |

Example

<Grid columns={4} gap={12}>
  <GridItem backgroundColor='#FFEC99'>Item 1</GridItem>
  <GridItem backgroundColor='#FFEC99'>Item 2</GridItem>
  <GridItem backgroundColor='#FFEC99'>Item 3</GridItem>
  <GridItem backgroundColor='#FFEC99'>Item 4</GridItem>
</Grid>

Grid Item

Grid의 자식 컴포넌트입니다.

import { GridItem } from 'tami-layout-component';

Props

| props | value | description | | ---------------- | ------------------------- | ---------------------------------------- | | width? | string number | GridItem의 너비값입니다. | | height? | string number | GridItem의 높이값입니다. | | area? | CSSProperties['gridArea'] | GridItem의 영역을 정의합니다. | | row? | number 'auto' | GridItem의 row 값 입니다. | | col? | number 'auto' | GridItem의 column 값 입니다. | | rowStart? | number 'auto' | GridItem의 row가 시작하는 위치입니다. | | rowEnd? | number 'auto' | GridItem의 row가 끝나는 위치입니다. | | colStart? | number 'auto' | GridItem의 column이 시작하는 위치입니다. | | colEnd? | number 'auto' | GridItem의 column이 끝나는 위치입니다. | | backgroundColor? | CSSProperties['color'] | GridItem의 배경색입니다. | | children? | ReactNode | GridItem의 자식 컴포넌트입니다. |

Example

<GridItem col={2} backgroundColor='#D8EAFF' />

Drawer

화면의 한 쪽에서 열고 닫을 수 있는 컴포넌트입니다.

import { Drawer } from 'tami-layout-component';

Props

| props | value | description | | ---------- | ------------------------ | ------------------------------------------ | | isOpen | booelan | Drawer가 열렸는지 여부입니다. | | width? | ()=> void | Drawer을 닫는 함수입니다. | | direction? | left, right, top, bottom | Drawer가 열리는 방향입니다. (default left) |

Example

const [isOpen, setIsOpen] = useState(false);
const handleDrawerClose = () => {
  setIsOpen(!isOpen);
};

return (
  <>
    <Drawer isOpen={isOpen} handleDrawerClose={handleDrawerClose}>
      <div>children</div>
    </Drawer>
  </>
);