An open API service indexing awesome lists of open source software.

https://github.com/solarliner/preact-combinations

Pass an array of value per props; get the element rendered as all possible combinations of those props.
https://github.com/solarliner/preact-combinations

Last synced: 8 months ago
JSON representation

Pass an array of value per props; get the element rendered as all possible combinations of those props.

Awesome Lists containing this project

README

          

# preact-combinations
Pass an array of value per props; get the element rendered as all possible combinations of those props.

## Install

```bash
npm i preact-combinations
```

## Use

Pass an object of props, with each prop being an arry of potential values to take.

```tsx
const combinations = {
color: ["red","green","blue"],
elevation: [1,2,5,10],
children: ["Button", "🌍"]
}

```

Style the per-element wrapper to add gaps, etc.

```tsx
const style = {
margin: "1em .5em"
}

```