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.
- Host: GitHub
- URL: https://github.com/solarliner/preact-combinations
- Owner: SolarLiner
- License: mit
- Created: 2019-01-17T15:57:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-23T01:32:28.000Z (about 7 years ago)
- Last Synced: 2025-04-06T08:16:53.630Z (about 1 year ago)
- Language: TypeScript
- Size: 430 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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"
}
```