Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/theetrain/svelte-cartesian

Cartesian Product component for Svelte
https://github.com/theetrain/svelte-cartesian

svelte svelte-component testing visual-regression-testing

Last synced: 11 days ago
JSON representation

Cartesian Product component for Svelte

Awesome Lists containing this project

README

        

## Svelte 5 usage (experimental)

> [!WARNING]
> This component is based on the release candidate of Svelte 5 and is considered
> unstable. Any breaking changes will not be properly indicated in
> `svelte-cartesian` releases at this time, but there are no planned changes.

1. Install package

```bash
npm install -D svelte-cartesian
```

2. Add component to your page.

```html

import Button from "./Button.svelte"
import { CartesianWithRunes as Cartesian } from "svelte-cartesian"


{#snippet children()}
Click me
{/snippet}



```

3. Pass props with array of potential values, including an explicit `undefined`
where applicable. Ensure snippets are passed in as props and defined within
the markup of the page using ``.

### Styling ``

Styling `` is done in the exact same way as with [``](./README.md#styling-cartesian).

### `` props

| prop | type | description |
| --------------- | ------------------------------- | ------------------------------------------------------------------------------- |
| `Component` | `ComponentType` | **Required**: A Svelte component. |
| `props` | `Record` | **Required**: An object containing prop names and an array of potential values. |
| `unstyled` | `?boolean=false` | Disable built-in CSS. |
| `divAttributes` | `?SvelteHTMLElements["div"]={}` | Attributes to be spread onto the wrapping `

` element. |