Back to all frameworks

CSV importer and spreadsheet editor for Svelte

Install @updog/data-editor-wc, drop the Web Component into your Svelte components, and give users a full import and edit flow. 100% client-side, no upload server, flat $19/domain.

Importer.svelte
<script lang="ts">
  import "@updog/data-editor-wc";
  import "@updog/data-editor-wc/styles.css";
  import type { UpdogEditorElement } from "@updog/data-editor-wc";

  const columns = [
    { id: "name", title: "Name" },
    {
      id: "passport",
      title: "Passport",
      validators: [{ type: "required", message: "Passport is required" }],
    },
  ];

  let editorEl: UpdogEditorElement | undefined = $state();

  $effect(() => {
    if (!editorEl) return;
    const el = editorEl;
    el.configure({
      apiKey: "YOUR_API_KEY",
      columns,
      primaryKey: "passport",
      onComplete: (result) => {
        console.log(result);
        el.hide();
      },
    });
    const onClose = () => el.hide();
    el.addEventListener("close", onClose);
    return () => el.removeEventListener("close", onClose);
  });

  function open() {
    editorEl?.show();
  }
</script>

<button type="button" onclick={open}>Open Importer</button>
<updog-editor bind:this={editorEl}></updog-editor>
View the full example on GitHub

Try it in the browser

Install the package, add your columns, render the component. Free on localhost. Every feature included.