Mithril UI Form Framework

VerifiedSafe

A declarative framework for building accessible, high-performance forms in Mithril applications. Uses JSON-based schemas to dynamically generate forms with rich input components, validation, and conditional logic. Includes a plugin system for extending functionality with custom components like map and rating inputs.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#mithril#forms#declarative#accessibility

Recommended for

Automated summary

mithril-ui-form is a declarative framework for creating accessible, high-performance forms in Mithril applications, driven by a JSON schema.

Strengths

  • Dynamic form generation from JSON
  • Supports conditional field display
  • Built-in validation with custom rules
  • Fully compliant with WCAG 2.1 AA accessibility standards

Limitations

  • Requires familiarity with Mithril
  • Custom plugins add complexity
  • Limited documentation for advanced scenarios
When to use it

Use this library when you need to quickly create complex, reusable forms in a Mithril application with minimal code.

When not to use it

Avoid using it if your application is not based on Mithril, or if you need full control over form rendering.

Security analysis

Safe
Quality score85/100

This is a documentation file for a Mithril form library. It contains no executable commands, no instructions for agents to perform actions, and no references to sensitive data or dangerous operations.

No concerns found

How this analysis is made

Examples

Create a simple contact form
Using mithril-ui-form, generate a JSON schema for a contact form with fields: name (text, required), email (email, required), message (textarea, max 500 chars), and a submit button.
Add conditional logic to a form
Create a mithril-ui-form schema for a registration form where an 'Other' radio option reveals an additional 'Please specify' text field.
Implement a file upload field
Show me how to define a file upload field in mithril-ui-form with mime type restrictions (images only) and a maximum file size of 5MB.

name: mithril-ui-form description: A powerful, declarative framework for creating accessible, high-performance forms in Mithril applications.

Mithril UI Form

mithril-ui-form is a powerful, declarative framework for creating accessible, high-performance forms in Mithril applications. It uses a JSON-based schema to dynamically generate forms with a wide range of features.

Key Features

  • Object-based and array-based forms: Support for editing single objects or collections of objects.
  • Rich component library: Includes a variety of input types, such as text, textarea, select, checkbox, radio, date, time, and file uploads.
  • Conditional logic: Show or hide form fields based on the values of other fields.
  • Validation: Built-in support for required fields and custom validation rules.
  • Plugin system: Extend the library with custom components and functionality.
  • Accessibility: Full compliance with WCAG 2.1 AA standards.

Core Components

The core library, mithril-ui-form, provides the main components for creating forms:

  • LayoutForm: For creating forms that edit a single object.
  • ArrayLayoutForm: For creating forms that edit a collection of objects.

Plugin System

mithril-ui-form has a plugin system that allows you to extend its functionality with custom components. The mithril-ui-form-plugin package defines the plugin architecture.

Some example plugins include:

  • mithril-ui-form-leaflet-plugin: Adds a Leaflet map component.
  • mithril-ui-form-rating-plugin: Adds a star rating component.

Form Field Examples

Here are some examples of the form fields you can create with mithril-ui-form.

Automatic id generation

Automatically generate an id for a new object, only if it is undefined. You can also use guid if you need GUID. And instead of type "none", you can also set type "text" and disabled to true. Using type "none" will not show it.

{ "id": "id", type: "none", "autogenerate": "id" }

Text Input

For single-line text input.

{
  "id": "name",
  "label": "Name",
  "type": "text",
  "required": true,
  "maxLength": 50,
  "placeholder": "Enter your full name"
}

Other useful types are url, email, and password.

Text Area

For multi-line text input.

{
  "id": "description",
  "label": "Description",
  "type": "textarea",
  "maxLength": 500,
  "placeholder": "Enter a description"
}

Number Input

For numeric input. Use integer for whole numbers.

{
  "id": "age",
  "label": "Age",
  "type": "number",
  "min": 0,
  "max": 120,
  "required": true
}

Date and Time

For date and time input. date, time, and datetime types are available.

{
  "id": "event_date",
  "label": "Event Date",
  "type": "datetime",
  "required": true
}

Color Picker

For selecting a color.

{
  "id": "theme_color",
  "label": "Theme Color",
  "type": "color"
}

Select Dropdown

For selecting one or more options from a list.

{
  "id": "country",
  "label": "Country",
  "type": "select",
  "options": [
    { "id": "us", "label": "United States" },
    { "id": "ca", "label": "Canada" },
    { "id": "mx", "label": "Mexico" }
  ]
}

Radio Buttons

For selecting a single option from a set of choices.

{
  "id": "gender",
  "label": "Gender",
  "type": "radio",
  "options": [
    { "id": "male", "label": "Male" },
    { "id": "female", "label": "Female" },
    { "id": "other", "label": "Other" }
  ]
}

Checkboxes

For selecting multiple options.

{
  "id": "interests",
  "label": "Interests",
  "type": "checkbox",
  "options": [
    { "id": "sports", "label": "Sports" },
    { "id": "music", "label": "Music" },
    { "id": "movies", "label": "Movies" }
  ]
}

Switch

For a boolean toggle.

{
  "id": "notifications",
  "label": "Enable Notifications",
  "type": "switch"
}

File Upload

For uploading files. The base64 type can be used to store the file as a base64 string.

{
  "id": "avatar",
  "label": "Avatar",
  "type": "file",
  "url": "/upload",
  "options": [{ "id": "image/*" }]
}

Tags Input

For creating a list of tags.

{
  "id": "tags",
  "label": "Tags",
  "type": "tags"
}

Autocomplete

For a text input with suggestions.

{
  "id": "framework",
  "label": "JS Framework",
  "type": "autocomplete",
  "options": [
    { "id": "react", "label": "React" },
    { "id": "vue", "label": "Vue" },
    { "id": "angular", "label": "Angular" }
  ]
}

Rating

A star rating component (requires the mithril-ui-form-rating-plugin).

{
  "id": "satisfaction",
  "label": "Satisfaction",
  "type": "rating",
  "min": 1,
  "max": 5
}

Map

For selecting a location on a map (requires the mithril-ui-form-leaflet-plugin).

{
  "id": "location",
  "label": "Location",
  "type": "map",
  "required": true
}

Markdown

For displaying static markdown content.

{
  "type": "md",
  "value": "### Section Title\n\nThis is some informational text."
}

Repeating Sections

To create a list of items, such as a list of editors.

{
  "id": "editors",
  "label": "Editors",
  "repeat": true,
  "type": [
    { "id": "name", "label": "Name", "type": "text" },
    { "id": "role", "label": "Role", "type": "text" }
  ]
}

Conditional Visibility

You can show or hide fields based on the values of other fields using the show property.

{
  "id": "is_company",
  "label": "Are you a company?",
  "type": "switch"
},
{
  "id": "company_name",
  "label": "Company Name",
  "type": "text",
  "show": "is_company"
}

This will only show the company_name field when the is_company switch is on. show can also be an array, using multiple properties, e.g. ["color=red", "optionId=4"].

Getting Started

To get started with mithril-ui-form, you can use the example application provided in the example package.

Installation

pnpm install

Development

pnpm start

This will build all the packages and start a development server for the example application.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/mithril-ui-form-framework-mm5t8978' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/mithril-ui-form-framework-mm5t8978/download' --output '.skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md.part' && mv '.skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md.part' '.skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Installation
pnpm install

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md' && test -s '.skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/mithril-ui-form' && cp -R '.skill-downloads/mithril-ui-form-framework-mm5t8978' '.claude/skills/mithril-ui-form'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/mithril-ui-form-framework-mm5t8978'

openskills read 'mithril-ui-form-framework-mm5t8978'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/mithril-ui-form-framework-mm5t8978/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills