Skip to main content

values

The record the editor edits. The editor deep-copies it into a draft whenever the prop changes, so the source object stays untouched until a save. Saved changes are written back through item setters and reported via onsave.

Usage

type TValues = Record<string, any>;

values?: TValues;

Default: {}. Keys are matched to items by each item's key (or keys/getter/setter).

Example

<script>
import { Editor, Willow } from "@svar-ui/svelte-editor";

const items = [
{ comp: "text", key: "name", label: "Name" },
{ comp: "checkbox", key: "admin", label: "Is Admin" }
];

const values = { name: "John Doe", admin: true };
</script>

<Willow>
<Editor {items} {values} />
</Willow>