1.1.0 • Published 2 years ago

tami-layout-component v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Install

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

Container

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

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

Props

propsvaluedescription
minWidth?stringContainer의 min-width값입니다.
maxWidth?stringContainer의 max-width값입니다. (default 100%)
padding?string numberContainer의 padding값입니다.
centerContent?booleanContainer의 자식 컴포넌트들의 중앙정렬 여부입니다. (default false)
backgroundColor?CSSProperties'color'Container의 배경색입니다.(default white)
borderRadius?string numberContainer의 border-radius값입니다.
children?ReactNodeContainer의 자식 컴포넌트입니다.

Example

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

Flex

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

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

Props

propsvaluedescription
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?numberFlex Item들 간의 간격입니다.
children?ReactNodeFlex의 자식 컴포넌트입니다.

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

propsvaluedescription
height?stringGrid의 높이값 입니다.
areas?CSSProperties'gridTemplateAreas'Grid의 영역입니다.
rows?numberGrid의 row 수 입니다.
columns?numberGrid의 column 수 입니다.
gap?numberGrid Item들 간의 간격입니다.
childrenReactNodeGrid의 자식 컴포넌트입니다.

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

propsvaluedescription
width?string numberGridItem의 너비값입니다.
height?string numberGridItem의 높이값입니다.
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?ReactNodeGridItem의 자식 컴포넌트입니다.

Example

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

Drawer

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

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

Props

propsvaluedescription
isOpenbooelanDrawer가 열렸는지 여부입니다.
width?()=> voidDrawer을 닫는 함수입니다.
direction?left, right, top, bottomDrawer가 열리는 방향입니다. (default left)

Example

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

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

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago