Getting SmarkForm

📖 Table of Contents

Choose a distribution

SmarkForm provides an ECMAScript module (ESM) and a UMD browser bundle. Choose the delivery method that fits your project:

  • CDN: quickest for a browser page, prototype, or small site. Use a version-pinned URL for production and an unpinned URL only for experiments. See the CDN guide for ESM, UMD, and stylesheet URLs.
  • npm: best for projects that already use a package manager and bundler. Install the smarkform package and import its ESM entry point:

    npm install smarkform
    
    import SmarkForm from "smarkform";
    
    const myForm = new SmarkForm(document.getElementById("myForm"));
    await myForm.rendered;
    
  • Downloaded bundle: use the ESM or UMD file when you want to serve the library from your own site. The Download page also provides the example CSS and an empty starter template.
  • Source checkout: clone the GitHub repository if you want to develop SmarkForm itself, run its tests, or build the library and examples.

The UMD bundle exposes SmarkForm as a browser global. For ESM, use a module script or your bundler. The examples in the next pages show complete forms and the standard Quick Start walks through building one.