# @ssen/each-options

> Each options

Latest version **0.1.0** (published 2020-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ssen/each-options
pnpm add @ssen/each-options
yarn add @ssen/each-options
bun add @ssen/each-options
```

## 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.0 |
| Published | 2020-04-30 |
| First published | 2020-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | SSen |
| Maintainers | ssen |

## Links

- npm: https://www.npmjs.com/package/@ssen/each-options
- Repository: https://github.com/iamssen/ssenkit
- Homepage: https://github.com/iamssen/ssenkit#readme
- Issues: https://github.com/iamssen/ssenkit/issues
- npm.io page: https://npm.io/package/@ssen/each-options

## Recent versions

- 0.1.0 (latest) — 2020-04-30

## README

# Install

```sh
npm install @ssen/each-options
```

# Example

```tsx
import { Button } from '@material-ui/core';
import eachOptions from '@ssen/each-options';
import React, { ComponentProps } from 'react';
import styled from 'styled-components';

// buttonOptions will be made of 9
const buttonOptions = eachOptions<ComponentProps<typeof Button>>({
  variant: ['contained', 'outlined', 'text'],
  size: ['small', 'medium', 'large'],
});

export default function () {
  return (
    <div>
      <Group>
        {buttonOptions.map((buttonProps) => (
          <Section>
            <Button {...buttonProps} color="default">
              BUTTON
            </Button>
            <Button {...buttonProps} color="primary">
              BUTTON
            </Button>
            <Button {...buttonProps} color="secondary">
              BUTTON
            </Button>
            <Button {...buttonProps} color="default" disabled>
              BUTTON
            </Button>
            <Button {...buttonProps} color="primary" disabled>
              BUTTON
            </Button>
            <Button {...buttonProps} color="secondary" disabled>
              BUTTON
            </Button>
          </Section>
        ))}
      </Group>
    </div>
  );
}

const Group = styled.div`
  padding: 20px;
  background-color: ${({ theme }) => theme.palette.background.default};
`;

const Section = styled.div`
  display: flex;

  justify-content: left;
  align-items: center;

  :not(:first-child) {
    margin-top: 10px;
  }

  > :not(:first-child) {
    margin-left: 10px;
  }
`;
```

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