Skip to content

Refzlund/svelte-object

Repository files navigation



👉   Define objects in your markup-structure!
💫   Driven by Svelte 5's runes for highly robust code
🔥   Handles submit events and validation


    Made for Svelte 5

Get started with literal wizardry!🧙‍♂️
bun add -D svelte-object  /  npm i -D svelte-object  /  pnpm add -D svelte-object


This could be your code See REPL

<h3> An array of pets </h3>

<I.Array bind:value={pets}>
	{#snippet item(prop)}
		<I.Object name={prop.index}>
			<Input name='name' min={2}>Pets name</Input>
			<Input name='age' type='number'>Pets age</Input>
		</I.Object>
	{/snippet}
	<button on:click={() => pets.push({})}> Add pet </button>
</I.Array>

Note
What are you waiting for? Get Started!