Once installed, import the CSS and JavaScript modules:
import "formsmd/dist/css/formsmd.min.css";import { Composer, Formsmd } from "formsmd";// Start building your formconst 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.
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 checkingconst composer = new Composer({ id: "typed-form", postUrl: "/api/submit", accent: "rgb(30, 55, 153)", colorScheme: "light"});