Skip to content
AddHunt
Obsidian plugins

Obsidian Modal Form

Obsidian plugin for structured input forms in a modal

Works with ObsidianOpen source

  • Open source
  • Licence: MIT

In short

Obsidian Modal Form is a plugin that lets users define forms and open them in a modal from anywhere JavaScript runs in Obsidian, returning the values to templates and scripts. It is for Obsidian users who capture structured data with Templater, QuickAdd or Dataview.

What you get

  • Modal forms callable from Templater, QuickAdd and DataviewJS
  • JSON form definitions or a form-builder UI
  • Many input types, from sliders to Dataview autocomplete
  • Create notes from forms with templates
  • Register forms as commands
  • Results as frontmatter, Dataview properties or strings

The details

Obsidian Modal Form fills a gap in how Obsidian captures structured data. Templater and QuickAdd can create notes with a fixed structure, but their built-in prompts ask for one value at a time and give little context about each field. This plugin opens a complete form in a modal window and hands all the entered values back to whatever called it.

Where forms can be opened

Forms can be triggered from Templater templates, QuickAdd captures, DataviewJS queries and other places that run JavaScript. Each form can also be registered as a command, so it opens from the command palette without QuickAdd or an external template in simple cases.

Building forms

  • Forms are defined in a simple JSON format or created through a user interface
  • A collection of forms is kept, each with a unique name
  • New notes can be created straight from a form using templates, with a template builder UI
  • Inputs include numbers, dates, times, sliders, toggles, free text, multiple choice and selects
  • Text fields can autocomplete note names from a folder or values from a Dataview query

Results can be turned into frontmatter, Dataview properties or a templated string through FormResult methods. Forms can also be imported, and inline and self-contained forms are documented. The plugin is MIT-licensed and can be installed through BRAT or manually.

Alternatives to Obsidian Modal Form

Questions

Do I need Templater or QuickAdd to use Modal Form?

Not for simple cases. Forms can be registered as commands and opened from the command palette, though the plugin also works with Templater, QuickAdd and DataviewJS.

What input types are available?

Numbers, dates, times, sliders, toggles, free text, multiple choice, selects from lists or folders, and text with autocompletion from note names or a Dataview query.

How do form results get into a note?

The returned result can be converted to a frontmatter string, Dataview properties or a custom templated string.

More like this