# tkdrb15-layout-component

> React 기본 레이아웃 컴포넌트 (Container, Grid, Flex)

Latest version **0.1.10** (published 2023-09-26) · 0 weekly downloads

## Install

```sh
npm install tkdrb15-layout-component
pnpm add tkdrb15-layout-component
yarn add tkdrb15-layout-component
bun add tkdrb15-layout-component
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.10 |
| Published | 2023-09-26 |
| First published | 2023-09-18 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | tkdrb15 |

## Links

- npm: https://www.npmjs.com/package/tkdrb15-layout-component
- Homepage: https://tkdrb12.github.io/layout-component
- npm.io page: https://npm.io/package/tkdrb15-layout-component

## Dependencies (10)

- [react](https://npm.io/package/react.md) ^18.2.0
- [gh-pages](https://npm.io/package/gh-pages.md) ^6.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [typescript](https://npm.io/package/typescript.md) ^4.9.5
- [@types/node](https://npm.io/package/@types/node.md) ^16.18.52
- [@types/react](https://npm.io/package/@types/react.md) ^18.2.21
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.1
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^18.2.7
- [styled-components](https://npm.io/package/styled-components.md) ^6.0.8
- [tkdrb15-layout-component](https://npm.io/package/tkdrb15-layout-component.md) ^0.1.9

## Recent versions

- 0.1.10 (latest) — 2023-09-26
- 0.1.9 — 2023-09-18
- 0.1.8 — 2023-09-18
- 0.1.7 — 2023-09-18
- 0.1.6 — 2023-09-18
- 0.1.5 — 2023-09-18
- 0.1.4 — 2023-09-18
- 0.1.3 — 2023-09-18
- 0.1.2 — 2023-09-18
- 0.1.1 — 2023-09-18
- 0.1.0 — 2023-09-18

## README

## 설명

React 기본 레이아웃 컴포넌트 (Container, Grid, Flex)

## version

version: 0.1.7 (updated in 2023.09.18)

## 사용법

### 설치

```Shell
npm i tkdrb15-layout-component
```

### 컴포넌트 삽입

```JavaScript
import { Container, Grid, Flex } from 'tkdrb15-layout-component';
```

## Prop

### Container

| props    | 타입           | 설명                             |
| -------- | -------------- | -------------------------------- |
| maxWidth | number, string | max-width of Container component |
| minWidth | number, string | min-width of Container component |

<br/>

```JavaScript
function App() {
  return (
      <Container
        maxWidth='300px'
        minWidth='200px'
      >
        <div>Item1</div>
        <div>Item2</div>
      </Container>
  );
}
```

<br/>

### Grid

CSS Grid를 사용하여 자식 컴포넌트들을 격자 형태로 배열하는 컴포넌트

| props | 타입           | 설명              |
| ----- | -------------- | ----------------- |
| cols  | number         | number of columns |
| rows  | number         | number of rows    |
| gap   | string, number | gap of children   |

<br/>

```JavaScript
function App() {
  return (
      <Grid
        cols={3}
        rows={5}
        gap="10px"
      >
        <div>Item1</div>
        <div>Item2</div>
        <div>Item3</div>
        <div>Item4</div>
      </Grid>
  );
}
```

<br/>

### Flex

CSS Flexbox를 사용하여 자식 컴포넌트들을 유연하게 배열하는 컴포넌트

| props     | 타입   | 설명                      |
| --------- | ------ | ------------------------- |
| direction | string | direction of flex display |
| justify   | string | justify of flex display   |
| align     | string | align of flex display     |
| gap       | string | gap of children           |

<br/>

```JavaScript
function App() {
  return (
      <Flex
        direction="row"
        justify="center"
        align="center"
        gap="10px"
      >
      <div>Item1</div>
      <div>Item2</div>
      <div>Item3</div>
      <div>Item4</div>
      </Flex>
  );
}
```

<br/>

### Masonry Layout

여러 크기의 아이템을 격자 형태로 정렬하되, 각 행과 열의 높이가 동일하지 않아 빈 공간이 최소화되는 레이아웃 컴포넌트

| props        | 타입                      | 설명                                                                 |
| ------------ | ------------------------- | -------------------------------------------------------------------- |
| column       | number ,'auto-fit'        | Number of columns, if auto-fit, fill the columns as much as possible |
| width        | number ,string, undefined | width of layout                                                      |
| itemWidth    | number ,string, undefined | width of layout item                                                 |
| columnGap    | number ,string, undefined | column-gap of layout                                                 |
| rowGap       | number ,string, undefined | row-gap of layout item                                               |
| borderRadius | number ,string, undefined | border-radius of layout                                              |

<br/>

```JavaScript
function App() {
  return (
    <MasonryLayout
     column={column}
     width={width}
     itemWidth={itemWidth}
     columnGap={columnGap}
     rowGap={rowGap}
     borderRadius={borderRadius}>
      <img/>
      <img/>
      <img/>
      <img/>
    </MasonryLayout>
  );
}
```

## 배포 링크

- [npm](https://www.npmjs.com/package/tkdrb15-layout-component)

- [사용설명서](https://tkdrb12.github.io/layout-component/)

---
_Source: https://npm.io/package/tkdrb15-layout-component · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
