Developer-first, open source Typeform alternative
Forms.md lets you build powerful multi-step forms and surveys with minimal code. Create production-ready forms that are privacy-focused, accessible, localizable, and themeable. Perfect for user onboarding, data collection, customer feedback, and much more.
#! id = onboarding-form #! post-url = /api/onboard position* = ChoiceInput( | question = What's your position? | choices = Product Manager, Software Engineer, Founder, Other ) ::: [{$ position $}] {% if position == "Other" %} positionOther* = TextInput( | question = Other | labelStyle = classic ) {% endif %} ::: --- |> 50% referralSource* = ChoiceInput( | question = How did you hear about us? | choices = News, Search Engine, Social Media, Recommendation ) --- -> referralSource == "Recommendation" |> 75% recommender = EmailInput( | question = Who recommended you? | description = We may be able to reach out to them and provide a discount for helping us out. )
import { Composer, Formsmd } from "formsmd";
// Create form with ID and submission endpoint
const composer = new Composer({
id: "onboarding-form",
postUrl: "/api/onboard",
});
// Choice input for position
composer.choiceInput("position", {
question: "What's your position?",
choices: ["Product Manager", "Software Engineer", "Founder", "Other"],
required: true,
});
// Text input if user selects "Other" position
composer.textInput("positionOther", {
question: "Other",
required: true,
labelStyle: "classic",
displayCondition: {
dependencies: ["position"],
condition: "position == 'Other'",
},
});
// Start new slide, progress indicator at 50%
composer.slide({
pageProgress: "50%",
});
// Choice input for how user discovered the product
composer.choiceInput("referralSource", {
question: "How did you hear about us?",
choices: ["News", "Search Engine", "Social Media", "Recommendation"],
required: true,
});
// Start new slide, show only if user was recommended, progress indicator at 75%
composer.slide({
jumpCondition: "referralSource == 'Recommendation'",
pageProgress: "75%",
});
// Email input for recommender email address
composer.emailInput("recommender", {
question: "Who recommended you?",
description:
"We may be able to reach out to them and provide a discount for helping us out.",
});
// Initialize with template, container, and options
const formsmd = new Formsmd(
composer.template,
document.getElementById("onboarding-form-container"),
{
postHeaders: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
},
);
formsmd.init();
import { Composer } from "formsmd";
import { FormsmdComponent } from "formsmd-react";
// Create form with ID and submission endpoint
const composer = new Composer({
id: "onboarding-form",
postUrl: "/api/onboard",
});
// Choice input for position
composer.choiceInput("position", {
question: "What's your position?",
choices: ["Product Manager", "Software Engineer", "Founder", "Other"],
required: true,
});
// Text input if user selects "Other" position
composer.textInput("positionOther", {
question: "Other",
required: true,
labelStyle: "classic",
displayCondition: {
dependencies: ["position"],
condition: "position == 'Other'",
},
});
// Start new slide, progress indicator at 50%
composer.slide({
pageProgress: "50%",
});
// Choice input for how user discovered the product
composer.choiceInput("referralSource", {
question: "How did you hear about us?",
choices: ["News", "Search Engine", "Social Media", "Recommendation"],
required: true,
});
// Start new slide, show only if user was recommended, progress indicator at 75%
composer.slide({
jumpCondition: "referralSource == 'Recommendation'",
pageProgress: "75%",
});
// Email input for recommender email address
composer.emailInput("recommender", {
question: "Who recommended you?",
description:
"We may be able to reach out to them and provide a discount for helping us out.",
});
// Initialize with template, container, and options
const formsmd = new Formsmd(
composer.template,
document.getElementById("onboarding-form-container"),
{
postHeaders: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
},
);
formsmd.init();
import { Formsmd } from "formsmd";
// Create template
const template = `
#! id = onboarding-form
#! post-url = /api/onboard
position* = ChoiceInput(
| question = What's your position?
| choices = Product Manager, Software Engineer, Founder, Other
)
::: [{$ position $}]
{% if position == "Other" %}
positionOther* = TextInput(
| question = Other
| labelStyle = classic
)
{% endif %}
:::
---
|> 50%
referralSource* = ChoiceInput(
| question = How did you hear about us?
| choices = News, Search Engine, Social Media, Recommendation
)
---
-> referralSource == "Recommendation"
|> 75%
recommender = EmailInput(
| question = Who recommended you?
| description = We may be able to reach out to them and provide a discount for helping us out.
)
`;
// Initialize with template, container, and options
const formsmd = new Formsmd(
template,
document.getElementById("onboarding-form-container"),
{
postHeaders: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
},
);
formsmd.init();
Expand code Collapse code
import { Composer, Formsmd } from "formsmd";
// Create form with ID and submission endpoint
const composer = new Composer({
id: "onboarding-form",
postUrl: "/api/onboard",
});
// Choice input for position
composer.choiceInput("position", {
question: "What's your position?",
choices: ["Product Manager", "Software Engineer", "Founder", "Other"],
required: true,
});
// Text input if user selects "Other" position
composer.textInput("positionOther", {
question: "Other",
required: true,
labelStyle: "classic",
displayCondition: {
dependencies: ["position"],
condition: "position == 'Other'",
},
});
// Start new slide, progress indicator at 50%
composer.slide({
pageProgress: "50%",
});
// Choice input for how user discovered the product
composer.choiceInput("referralSource", {
question: "How did you hear about us?",
choices: ["News", "Search Engine", "Social Media", "Recommendation"],
required: true,
});
// Start new slide, show only if user was recommended, progress indicator at 75%
composer.slide({
jumpCondition: "referralSource == 'Recommendation'",
pageProgress: "75%",
});
// Email input for recommender email address
composer.emailInput("recommender", {
question: "Who recommended you?",
description:
"We may be able to reach out to them and provide a discount for helping us out.",
});
// Initialize with template, container, and options
const formsmd = new Formsmd(
composer.template,
document.getElementById("onboarding-form-container"),
{
postHeaders: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
},
);
formsmd.init();
import { Composer } from "formsmd";
import { FormsmdComponent } from "formsmd-react";
// Create form with ID and submission endpoint
const composer = new Composer({
id: "onboarding-form",
postUrl: "/api/onboard",
});
// Choice input for position
composer.choiceInput("position", {
question: "What's your position?",
choices: ["Product Manager", "Software Engineer", "Founder", "Other"],
required: true,
});
// Text input if user selects "Other" position
composer.textInput("positionOther", {
question: "Other",
required: true,
labelStyle: "classic",
displayCondition: {
dependencies: ["position"],
condition: "position == 'Other'",
},
});
// Start new slide, progress indicator at 50%
composer.slide({
pageProgress: "50%",
});
// Choice input for how user discovered the product
composer.choiceInput("referralSource", {
question: "How did you hear about us?",
choices: ["News", "Search Engine", "Social Media", "Recommendation"],
required: true,
});
// Start new slide, show only if user was recommended, progress indicator at 75%
composer.slide({
jumpCondition: "referralSource == 'Recommendation'",
pageProgress: "75%",
});
// Email input for recommender email address
composer.emailInput("recommender", {
question: "Who recommended you?",
description:
"We may be able to reach out to them and provide a discount for helping us out.",
});
// Initialize with template, container, and options
const formsmd = new Formsmd(
composer.template,
document.getElementById("onboarding-form-container"),
{
postHeaders: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
},
);
formsmd.init();
import { Formsmd } from "formsmd";
// Create template
const template = `
#! id = onboarding-form
#! post-url = /api/onboard
position* = ChoiceInput(
| question = What's your position?
| choices = Product Manager, Software Engineer, Founder, Other
)
::: [{$ position $}]
{% if position == "Other" %}
positionOther* = TextInput(
| question = Other
| labelStyle = classic
)
{% endif %}
:::
---
|> 50%
referralSource* = ChoiceInput(
| question = How did you hear about us?
| choices = News, Search Engine, Social Media, Recommendation
)
---
-> referralSource == "Recommendation"
|> 75%
recommender = EmailInput(
| question = Who recommended you?
| description = We may be able to reach out to them and provide a discount for helping us out.
)
`;
// Initialize with template, container, and options
const formsmd = new Formsmd(
template,
document.getElementById("onboarding-form-container"),
{
postHeaders: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
},
);
formsmd.init();