Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/formsmd/formsmd/llms.txt

Use this file to discover all available pages before exploring further.

Installation

Forms.md can be installed via npm for modern JavaScript projects, or included directly in the browser using script and link tags.

Install via npm

For projects using Node.js and npm, install the formsmd package:
npm install formsmd

Import in your project

Once installed, import the CSS and JavaScript modules:
import "formsmd/dist/css/formsmd.min.css";
import { Composer, Formsmd } from "formsmd";

// Start building your form
const composer = new Composer({
  id: "my-form",
  postUrl: "/api/submit"
});
For right-to-left (RTL) languages, import formsmd.rtl.min.css instead of the standard CSS file.

Use in browser

For vanilla JavaScript projects or static sites, include Forms.md using <link> and <script> tags.

Download the files

Download the distribution files from the GitHub repository and include them in your project.

Include in your HTML

Add the CSS and JavaScript files to your HTML:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Form</title>
  
  <!-- Forms.md CSS -->
  <link rel="stylesheet" type="text/css" href="path/to/formsmd/dist/css/formsmd.min.css" />
</head>
<body>
  <div id="form-container"></div>
  
  <!-- Forms.md JS bundle -->
  <script src="path/to/formsmd/dist/js/formsmd.bundle.min.js"></script>
  <script>
    // Your form code here
    const composer = new Composer({
      id: "my-form",
      postUrl: "/api/submit"
    });
  </script>
</body>
</html>

TypeScript support

Forms.md includes TypeScript definitions out of the box. The types are located at types/index.d.ts and will be automatically picked up by TypeScript.
import { Composer, Formsmd } from "formsmd";

// TypeScript will provide full intellisense and type checking
const composer = new Composer({
  id: "typed-form",
  postUrl: "/api/submit",
  accent: "rgb(30, 55, 153)",
  colorScheme: "light"
});

File structure

The npm package includes the following files:
  • dist/css/formsmd.css - Unminified standard CSS
  • dist/css/formsmd.min.css - Minified standard CSS
  • dist/css/formsmd.rtl.css - Unminified RTL CSS
  • dist/css/formsmd.rtl.min.css - Minified RTL CSS

Next steps

Quickstart

Build your first form in minutes

Composer API

Learn about form field methods