
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@formique/semantq
Advanced tools
Formique Semantq is a native Semantq JS framework Schema Definition Language (SDL) and Formique Form Definition Language (Low Code). The library is a robust and elegant Web Content Accessibility Guidelines (WCAG) and Web Accessibility Initiative – Accessible Rich Internet Applications (WAI-ARIA) compliant form-building library tailored for JavaScript enthusiasts. It supports a wide array of input types, features JavaScript-driven themes, and offers advanced functionalities like nested conditional logic and dynamic dropdowns. Highly customizable and extensible, Formique is built for the Semantq JS Framework but integrates seamlessly with Vanilla JS, Semantq, and Vue. This guide covers implementing Formique in Semantq.
Create a new Semantq project using the following commands:
# install semantq globally
npm i -g semantq
# create a new project in my-app
semantq create my-app
Note: Always refer to the latest official Semantq guide on how to create a Semantq app, as this may change. Semantq Documentation: Creating a Project
npm i @formique/semantq
Formique now automatically injects its internal styles by default - no additional CSS files needed! The library handles styling internally with built-in themes and CSS variables.
Formique automatically applies its styling system. Just use the theme or themeColor options in your formSettings:
const formSettings = {
theme: 'midnight-blush', // Apply a built-in theme
// OR use a custom color:
themeColor: '#4338ca' // Override with your own hex color
};
If you prefer to use your own custom CSS, you can disable Formique's internal styles:
const formSettings = {
disableStyles: true, // Prevents internal CSS injection
// Now you can provide your own CSS file or styles
};
When disableStyles: true is set, Formique will not inject any styles, giving you complete control over the form's appearance. You can then link your own CSS file:
<!-- Your custom CSS -->
<link rel="stylesheet" href="/path/to/your-custom-form-styles.css" />
semantq make:route registration
@script
import Formique from '@formique/semantq';
const formSchema = [
['text', 'name', 'Name', { required: true }],
['text', 'surname', 'Surname', { required: true }],
['email', 'email', 'Email', { required: true }],
['submit', 'submit', 'Submit', {}, { style: 'width: 100%;' }],
];
const formParams = {
id: "regForm",
method: "POST",
};
const formSettings = {
submitOnPage: true,
theme: "midnight-blush",
requiredFieldIndicator: true,
placeholders: true,
};
$onMount(() => {
const form = new Formique(formSchema, formParams, formSettings);
});
@end
@html
<div id="formique"></div>
Formique uses a simple, intuitive array-based schema to define forms. Each field follows this format:
[type, name, label, validation, attributes, options]
[
['text', 'username', 'Username', { required: true, minlength: 3 }],
['email', 'user_email', 'Email Address', { required: true }],
['password', 'user_pass', 'Password', { required: true, minlength: 8 }],
['number', 'age', 'Age', { min: 18, max: 99 }],
['tel', 'phone', 'Phone Number', { pattern: '[0-9]{3}-[0-9]{3}-[0-9]{4}' }],
['date', 'dob', 'Date of Birth'],
['time', 'appointment', 'Appointment Time'],
['color', 'fav_color', 'Favorite Color', {}, { value: '#ff0056' }],
['file', 'avatar', 'Profile Picture', { accept: 'image/*' }],
['textarea', 'bio', 'Biography', { maxlength: 500 }, { rows: 5 }],
['url', 'website', 'Personal Website'],
['search', 'search', 'Search'],
]
// Radio buttons (single selection)
[
'radio', 'gender', 'Gender', { required: true }, {}, [
{ value: 'male', label: 'Male' },
{ value: 'female', label: 'Female' },
{ value: 'other', label: 'Other' }
]
],
// Checkbox group (multiple selection)
[
'checkbox', 'interests', 'Interests', {}, {}, [
{ value: 'coding', label: 'Coding', selected: true },
{ value: 'design', label: 'Design' },
{ value: 'music', label: 'Music' }
]
]
// Single select
[
'singleSelect', 'country', 'Country', { required: true }, {}, [
{ value: 'us', label: 'United States', selected: true },
{ value: 'uk', label: 'United Kingdom' },
{ value: 'ca', label: 'Canada' }
]
],
// Multiple select
[
'multipleSelect', 'skills', 'Skills', { required: true }, {}, [
{ value: 'js', label: 'JavaScript' },
{ value: 'python', label: 'Python' },
{ value: 'java', label: 'Java' }
]
]
Create cascading dropdowns where options in the second select depend on the first selection:
[
'dynamicSingleSelect', // Field type
'programming', // Field name
'Programming Languages', // Label
{ required: true }, // Validation
{}, // Attributes
[ // Main categories (appear in first dropdown)
{
id: 'frontend',
label: 'Front End',
options: [
{ value: 'javascript', label: 'JavaScript' },
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' }
]
},
{
id: 'backend',
label: 'Back End',
options: [
{ value: 'nodejs', label: 'Node.js' },
{ value: 'python', label: 'Python' },
{ value: 'java', label: 'Java' }
]
}
]
]
Insert custom HTML or plain text anywhere in your form. Perfect for section headers, instructional text, warnings, or embedded content:
[
'html', // Field type
'div', // HTML element to render (div, p, span, section, etc.)
'Your content here', // Content (HTML or plain text)
{}, // Validation (not used for HTML blocks -but do keep the empty {})
{ // Attributes for the HTML element
id: 'section-header',
class: 'info-message highlight',
style: 'color: #4338ca; padding: 1rem; background: #f5f3ff;',
'data-type': 'instructional'
}
]
Plain text paragraph:
['html', 'p', 'Please fill out all required fields marked with *', {}, {
class: 'instruction-text',
style: 'font-style: italic;'
}]
Section header with custom styling:
['html', 'h3', 'Personal Information', {}, {
class: 'form-section-header',
style: 'border-bottom: 2px solid #4338ca; margin-top: 2rem;'
}]
Warning message:
['html', 'div', '⚠️ Your session will expire in 5 minutes', {}, {
class: 'warning-banner',
role: 'alert'
}]
Complex HTML with nested elements:
['html', 'div', `
<div class="info-box">
<strong>Note:</strong>
<span>All fields are required unless marked optional</span>
</div>
`, {}, {
class: 'custom-wrapper'
}]
Resulting HTML structure:
<div class="form-group" id="section-header-block">
<div id="section-header" class="info-message highlight" style="color: #4338ca; padding: 1rem;">
Your content here
</div>
</div>
Each HTML block is automatically wrapped in a form-group div for consistent spacing and layout with form fields.
Show/hide fields based on other field values:
// Parent field with dependents
[
'singleSelect', 'role', 'Role',
{ required: true },
{ dependents: ['topic', 'mode'] }, // Fields that depend on this
[
{ value: 'attendee', label: 'Attendee' },
{ value: 'presenter', label: 'Presenter' }
]
],
// Dependent field with string condition
[
'text', 'topic', 'Presentation Topic',
{},
{
dependsOn: 'role',
condition: 'presenter' // Shows when role = 'presenter'
}
],
// Dependent field with function condition
[
'singleSelect', 'mode', 'Presentation Mode',
{ required: true },
{
dependsOn: 'role',
condition: (value) => value === 'presenter' // Function condition
},
[
{ value: 'virtual', label: 'Virtual' },
{ value: 'physical', label: 'Physical' }
]
]
Formique comes with a set of built-in themes to help you quickly style your forms. These themes are headless and minimal, allowing easy blending with your site's design system. They apply styling primarily to the submit button background and the bottom border of focused inputs, while maintaining a light background for most themes.
lightdarkpinkindigodark-bluelight-bluedark-orangebright-yellowgreenpurplemidnight-blushdeep-bluebluebrownorange⚠️ The
darktheme is more opinionated with full dark background support. All others are intentionally minimal.
To apply a theme, set the theme option in your formSettings:
const formSettings = {
theme: 'indigo'
};
If no theme is set, Formique will default to the light theme.
To override the button and focus color with your own custom color, use the themeColor option in hexadecimal format:
const formSettings = {
themeColor: '#327ba8' // Must be a valid hex value
};
Formique’s form classes are exposed for complete customization. You can target the form using .formique, and inputs with classes like .form-input, .form-label, .form-submit-btn. See section below.
Example:
.form-input {
border-radius: 5px;
padding: 10px;
}
Formique renders inside a container <div> that you specify by ID.
<div id="formique" class=""></div>
You can use any custom container ID by declaring it in your formSettings:
const formSettings = {
formContainerId: 'myForm'
};
And in your HTML:
<div id="myForm"></div>
Formique includes several responsive width utility classes:
| Class Name | Description |
|---|---|
width-full | 100% width |
width-half | 50% width |
width-medium | 600px fixed width |
width-small | 400px fixed width |
Example:
<div id="formique" class="width-half"></div>
For precise container control:
const formSettings = {
formContainerStyle: 'width: 100%; max-width: 700px; padding: 2rem;'
};
.formique-Scoped CSS Classes.formique.formique-form.width-full.width-half.width-medium.width-small.width-custom.form-label.form-input.form-control.form-textarea.form-select.form-select-input.form-radio-input.form-checkbox-input.form-color-input.input-block.radio-group.checkbox-group.form-group.custom-theme.dark-theme.light-theme.pink-theme.indigo-theme.dark-blue-theme.light-blue-theme.dark-orange-theme.bright-yellow-theme.green-theme.purple-theme.midnight-blush-theme.deep-blue-theme.blue-theme.brown-theme.orange-theme.form-submit-btn#formiqueSpinner.formique-spinner.formique-spinner .message.formique-success.formique-errorFormique supports plug-and-play email contact forms.
const formSettings = {
submitMode: 'email', // Required
submitOnPage: true, // Required
successMessage: 'Message sent successfully!',
errorMessage: 'Something went wrong',
sendTo: ['contacts@yourwebsite.com'] // Recipient email(s)
};
const formSchema = [
['html', 'h3', 'Get in Touch', {}, {
class: 'form-section',
style: 'margin-top: 0;'
}],
['text', 'name', 'Your Name', { required: true }],
['email', 'email', 'Email Address', { required: true }],
['text', 'subject', 'Subject', { required: true }],
['textarea', 'message', 'Message', { required: true, minlength: 20 }, { rows: 5 }],
['html', 'p', 'We\'ll respond within 24 hours', {}, {
class: 'form-note',
style: 'font-size: 0.9rem; color: #666;'
}],
['submit', 'submit', 'Send Message']
];
const formSettings = {
submitMode: 'email',
submitOnPage: true,
sendTo: ['hello@yourwebsite.com'],
theme: 'blue',
requiredFieldIndicator: true
};
To enable email submissions, ensure your domain is registered on your useformique.com account.
This is required for sender verification and spam protection.
For more comprehensive details on Formique's features and options, visit the Formique GitHub Repository.
FAQs
Formique is a native form builder for the Semantq JS Framework
We found that @formique/semantq demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.