# @gdo-bzh/stack

> ![version](https://img.shields.io/npm/v/@gdo-bzh/stack)

Latest version **1.0.0-rc.5** (published 2021-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gdo-bzh/stack
pnpm add @gdo-bzh/stack
yarn add @gdo-bzh/stack
bun add @gdo-bzh/stack
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-rc.5 |
| Published | 2021-05-12 |
| First published | 2020-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | gdo |
| Maintainers | gdo |
| Keywords | react, reakit, ui-library, ui, ux |

## Links

- npm: https://www.npmjs.com/package/@gdo-bzh/stack
- Repository: https://github.com/gdo-bzh/ui
- Homepage: https://github.com/gdo-bzh/ui#readme
- Issues: https://github.com/gdo-bzh/ui/issues
- npm.io page: https://npm.io/package/@gdo-bzh/stack

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0-rc.5 (latest) — 2021-05-12
- 1.0.0-rc.4 — 2020-10-01
- 1.0.0-rc.3 — 2020-09-23
- 1.0.0-rc.2 — 2020-09-18
- 1.0.0-rc.1 — 2020-09-16

## README

![version](https://img.shields.io/npm/v/@gdo-bzh/stack)

# stack

[![NPM](https://img.shields.io/npm/v/stack.svg)](https://www.npmjs.com/package/stack) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

Stack a group of elements together on a single row or column

## Install

```bash
yarn add @gdo-bzh/stack @gdo-bzh/theme @xstyled/styled-components react reakit styled-components
# or
npm i @gdo-bzh/stack @gdo-bzh/theme @xstyled/styled-components react reakit styled-components -S
```

## Usage

```tsx
import React from 'react'

const Example = () => {
  const items = ['one', 'two', 'three']
  return (
    <Stack spacing="sm">
      {items.map(label => (
        <Box
          display="flex"
          alignItems="center"
          justifyContent="center"
          backgroundColor="tomato"
          color="white"
          p={5}
          width={50}
        >
          {label}
        </Box>
      ))}
    </Stack>
  )
}
```

## Types

```tsx
import { Group } from 'reakit/Group'
import { StyledComponentProps, DefaultTheme } from '@xstyled/styled-components'

type Props = StyledComponentProps<typeof Group, DefaultTheme, any, never> & {
  /**
   * sets how flex items are placed in the flex container defining the main axis and the direction (normal or reversed)
   */
  direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'
  /**
   * spacing between each element
   */
  spacing?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl'
  /**
   * controls alignment of all items on the cross axis
   */
  align?: 'center' | 'flex-start' | 'flex-end' | 'stretch' | 'baseline' | 'initial' | 'inherit'
  /**
   * controls alignment of all items on the main axis
   */
  justify?:
    | 'center'
    | 'flex-start'
    | 'flex-end'
    | 'space-between'
    | 'space-around'
    | 'initial'
    | 'inherit'
}
```

## License

MIT © [gdo-bzh](https://github.com/gdo-bzh)

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