1.1.2 • Published 8 months ago

@bassyu/layout-component v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@bassyu/layout-component

Container

기본적인 컨테이너 레이아웃 입니다.

가운데 정렬을 합니다.

속성

속성기본값설명
as'div'Block-level 요소의 이름을 지정합니다.
minWidth'none'해당 픽셀만큼 최소 너비를 지정합니다.
maxWidth'none'해당 픽셀만큼 최대 너비를 지정합니다.

예제

import { Container } from '@bassyu/layout-component';

const App = () => (
  <Container minWidth={600} maxWidth={960}>
    <div>Content</div>
  </Container>
);

Grid

Grid 레이아웃의 속성을 사용하는 컴포넌트 입니다.

속성

Container 속성을 상속 받습니다.

속성기본값설명
rows1행 개수를 줍니다.
columns1열 개수를 줍니다.
gap0해당 픽셀만큼 간격을 줍니다.

예제

import { Grid } from '@bassyu/layout-component';

const App = () => (
  <Grid rows={3} columns={3} gap={10} minWidth={600} maxWidth={960}>
    <div>Item 1</div>
    <div>Item 2</div>
    <div>Item 3</div>
  </Grid>
);

Flex

Flex 레이아웃의 속성을 사용하는 컴포넌트 입니다.

속성

Container 속성을 상속 받습니다.

속성기본값설명
directionundefined축의 방향을 줍니다.
justifyundefined축 정렬을 합니다.
alignundefined아이템 정렬을 합니다.
gap0해당 픽셀만큼 간격을 줍니다.

예제

import { Flex } from '@bassyu/layout-component';

const App = () => (
  <Flex direction="row" justify="center" align="center" gap={5} minWidth={600} maxWidth={960}>
    <div>Item 1</div>
    <div>Item 2</div>
    <div>Item 3</div>
  </Flex>;
);

Masonry

자식의 높이를 계산해서 Masonry 레이아웃으로 재정렬 해주는 컴포넌트입니다.

속성

Container 속성을 상속 받습니다.

속성기본값설명
columns2열의 개수를 줍니다.
gap0해당 픽셀만큼 간격을 줍니다.

예제

import { Masonry } from '@bassyu/layout-component';

const App = () => (
  <Masonry columns={3} gap={5} minWidth={600}>
    <div>Item 1</div>
    <div>Item 2</div>
    <div>Item 3</div>
  </Masonry>;
);
1.1.2

8 months ago

1.1.1

8 months ago

1.1.0

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago