# @kyleshevlin/layout

> Basic React layout components

Latest version **0.6.3** (published 2024-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @kyleshevlin/layout
pnpm add @kyleshevlin/layout
yarn add @kyleshevlin/layout
bun add @kyleshevlin/layout
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.3 |
| Published | 2024-01-19 |
| First published | 2022-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Kyle Shevlin |
| Maintainers | kyleshevlin |

## Links

- npm: https://www.npmjs.com/package/@kyleshevlin/layout
- Repository: https://github.com/kyleshevlin/layout
- Homepage: https://github.com/kyleshevlin/layout#readme
- Issues: https://github.com/kyleshevlin/layout/issues
- npm.io page: https://npm.io/package/@kyleshevlin/layout

## Recent versions

- 0.6.3 (latest) — 2024-01-19
- 0.6.2 — 2024-01-19
- 0.6.1 — 2024-01-19
- 0.6.0 — 2023-09-19
- 0.5.1 — 2022-12-31
- 0.5.0 — 2022-12-31
- 0.4.0 — 2022-10-29
- 0.3.0 — 2022-10-29
- 0.2.4 — 2022-10-29
- 0.2.3 — 2022-10-29
- 0.2.2 — 2022-10-29
- 0.2.1 — 2022-10-29
- 0.2.0 — 2022-10-29

## README

# `@kyleshevlin/layout`

Just some basic layout components I use over & over.

- `Flex` & `FlexItem`
- `Stack` & `Row` (for when I get lazy with `Flex`)
- `Margin`
- `ShiftBy`

It also exports a `SpacingProvider` and uses a `useSpacing` hook under the hood. This allows you to modify gaps and margins with a function. For example.

```tsx
// If the `value` is a number, treat it as a factor and multiply by 8(px)
const spacing = (value: string | number) => {
  return typeof value === 'number' ? value * 8 : value
}

function App() {
  return (
    <SpacingProvider spacing={spacing}>
      {/* gap={2} will create 16px of spacing between items */}
      <Flex direction="column" gap={2}>
        <h3>Hello!</h3>
        <p>World</p>
      </Flex>
    </SpacingProvider>
  )
}
```

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