
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@formique/semantq
Advanced tools
Formique Semantq is a native Semantq JS framework Schema Defintion 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, Semantq, and Vue. This guide covers implementing Formique in Semantq.
Create a new Semantq project using the following commands:
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv 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 run dev
# or start the server and open the app in a new browser tab
npm run dev
For demo purposes, let's create a new route (page) in src/routes/registration.
Create the Route:
mkdir src/routes/registration
Create the Semantq Page:
touch src/routes/registration/+page.Semantq
The NPM option:
npm i formique-css
import 'formique-css';
The CDN Option:
Include this inside the @head .. @end block of page layout file: @layout.smq
<link rel="stylesheet" href="https://unpkg.com/formique-css@1.0.11/formique-css.css" />
Note: The provided Formique CSS is optional. Formique will function fully without it, allowing you full flexibility to apply your own styles. However, for convenience, a set of default class names is available to help you quickly style form containers, form elements, and input types. See the sections below for a complete list of available class names.
@formique/semantqTo use Formique in your Semantq application, you need to install the formique-semantq package.
npm i @formique/semantq
+page.SemantqAdd the following code to +page.Semantq:
<script>
import { onMount } from 'Semantq';
import Formique from '@formique/semantq';
// Define the form schema
const formSchema = [
['text', 'name', 'Name', { required: true }],
['text', 'surname', 'Surname', { required: true }],
['email', 'email', 'Email', { required: true }],
['singleSelect', 'title', 'Title', { required: true }, { dependents: ['status'] },
[
{ value: 'mr', label: 'Mr' },
{ value: 'ms', label: 'Ms' },
{ value: 'mrs', label: 'Mrs' },
{ value: 'dr', label: 'Dr' },
{ value: 'prof', label: 'Prof' }
]
],
['singleSelect', 'status', 'Status', { required: true }, { dependsOn: 'title', condition: 'prof' },
[
{ value: 'full professor', label: 'Full Professor' },
{ value: 'associate professor', label: 'Associate Professor' }
]
],
['submit', 'submit', 'Submit', {}, { style: 'width: 100%;' }],
];
// Define form parameters
const formParams = {
id: "regForm",
method: "POST",
};
// Define form settings
const formSettings = {
submitOnPage: true,
theme: "midnight-blush",
requiredFieldIndicator: true,
placeholders: true,
};
// Initialize the form on component mount
onMount(() => {
const form = new Formique(formSchema, formParams, formSettings);
});
</script>
<!-- Target element where the form will be inserted -->
<div id="formique"></div>
To see the form in your browser, run the following command:
npm run dev
Once the server is running, you can view the form at:
http://localhost:5173/registration
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 dark 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 .formique-input, .formique-label, .formique-submit. See section below.
Example:
.formique-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 that can be used directly on your form container:
| 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>
If you want precise control over the container styling, use the formContainerStyle setting:
const formSettings = {
formContainerStyle: 'width: 100%; max-width: 700px; padding: 2rem;'
};
This will override the container’s
styleattribute directly.
.formique-Scoped CSS ClassesHere is a clean, alphabetically grouped list of all unique CSS class selectors used in your Formique stylesheet:
.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.input-block.radio-group.checkbox-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 using @formique/semantq.
const formSettings = {
submitMode: 'email', // Required
submitOnPage: true, // Required
successMessage: 'Survey filled successfully', // Optional
errorMessage: 'Something went wrong', // Optional
sendTo: ['contacts@yourwebsite.com'] // Your actual email
};
Create your form fields using a simple schema array:
const formSchema = [
['text', 'name', 'Name', { required: true }],
['text', 'surname', 'Surname', { required: true }],
['email', 'email', 'Email', { required: true }, { style: 'color: red' }],
['textarea', 'message', 'Your Message here', { required: true }]
];
Each form field follows this format:
['field type', 'field name', 'Label', { inlineValidation }, { inputAttributes }, [options]]
Examples:
text, email, textarea, select, checkbox, radio{ required: true }style, placeholder, etc.) are supported.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 usage and options visit the Formique GitHub Repository.
FAQs
Formique is a native form builder for the Semantq JS Framework
The npm package @formique/semantq receives a total of 64 weekly downloads. As such, @formique/semantq popularity was classified as not popular.
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.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

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.