Releases
Formwerk

Build
High-Quality

Vue.js form components

A suite of Vue.js composables designed to enhance your forms with built-in behaviors, interactions, internationalization, and accessibility, seamlessly integrating with your markup and styles.

Get started Composables

Craft with your own styles.

Formwerk provides a blank canvas, free of predefined styles or HTML, enabling you to craft a custom design system using any styling or animation library. Each composable integrates with its designated elements, managing behavior and state while leaving the structure and styling entirely in your hands.

TextField.vue
<script setup lang="ts">
import { type TextFieldProps, useTextField } from '@formwerk/core';
const props = defineProps<TextFieldProps>();
const { inputProps, labelProps, errorMessage, errorMessageProps } =
useTextField(props);
</script>
<template>
<div class="TextField">
<label v-bind="labelProps">{{ label }}</label>
<input v-bind="inputProps" />
<div v-bind="errorMessageProps" class="error">
{{ errorMessage }}
</div>
</div>
</template>
<style scoped>
.TextField {
position: relative;
width: 100%;
max-width: 20rem;
margin-bottom: calc(1em * 1.5);
label {
display: block;
margin-bottom: 0.25rem;
white-space: nowrap;
font-size: 0.875rem;
font-weight: 600;
color: white;
}
input {
width: 100%;
cursor: pointer;
white-space: nowrap;
border-radius: 0.375rem;
font-size: 0.875rem;
border: 1px solid rgb(63, 63, 70);
background-color: rgb(39, 39, 42);
padding: 0.75rem 0.75rem 0.75rem 1rem;
color: white;
transition-property: all;
transition-duration: 200ms;
&:focus {
border-color: rgb(16, 185, 129);
outline: none;
box-shadow: 0 0 0 1px rgb(16, 185, 129);
background-color: rgb(24, 24, 27);
}
&:hover {
background-color: rgb(24, 24, 27);
}
&:user-invalid {
border-color: rgb(239, 68, 68);
outline: none;
box-shadow: 0 0 0 1px rgb(239, 68, 68);
background-color: rgb(39, 39, 42);
}
&::placeholder {
color: rgb(161, 161, 170);
}
}
.error {
position: absolute;
left: 0;
display: none;
font-size: 0.875rem;
color: rgb(239, 68, 68);
white-space: nowrap;
text-overflow: ellipsis;
width: 100%;
}
&:has(:user-invalid) {
.error {
display: block;
}
}
}
</style>

Preview

Thoughtfully accessible.

Aria Semantics

Formwerk follows the W3C ARIA Authoring Practices Guide, ensuring proper aria attributes and keyboard interactions for all input types.

Adaptive Attributes

You can use almost any HTML markup you prefer. The attributes and listeners will adapt based on the elements you use.

Built for international users.

Formwerk is built for international audiences, with support for RTL, localized number formatting and parsing with multiple numbering systems, and integrates with vue-i18n and nuxt-i18n.

Locale
Amharic (Ethiopia)
Arabic (Algeria)
Arabic (Egypt)
Arabic (Saudi Arabia)
Arabic (United Arab Emirates)
Bulgarian (Bulgaria)
Chinese (China)
Chinese (Taiwan)
Croatian (Croatia)
Czech (Czechia)
Danish (Denmark)
Dutch (Netherlands)
English (United Kingdom)
English (United States)
Estonian (Estonia)
Finnish (Finland)
French (Canada)
French (France)
German (Germany)
Greek (Greece)
Hebrew (Israel)
Hindi (India)
Hungarian (Hungary)
Italian (Italy)
Japanese (Japan)
Korean (South Korea)
Latvian (Latvia)
Lithuanian (Lithuania)
Norwegian Bokmål (Norway)
Persian (Afghanistan)
Polish (Poland)
Portuguese (Brazil)
Romanian (Romania)
Russian (Russia)
Serbian (SP)
Slovak (Slovakia)
Slovenian (Slovenia)
Spanish (Spain)
Swedish (Sweden)
Thai (Thailand)
Turkish (Türkiye)
Ukrainian (Ukraine)
Numbering system
Latin
Arabic
Hanidec
Format
Decimal
Percent
Currency
Unit
Unit
Acre
Bit
Byte
Celsius
Centimeter
Day
Degree
Fahrenheit
Fluid Ounce
Foot
Gallon
Gigabit
Gigabyte
Gram
Hectare
Hour
Inch
Kilobit
Kilobyte
Kilogram
Kilometer
Liter
Megabit
Megabyte
Meter
Microsecond
Mile
Scandinavian Mile
Milliliter
Millimeter
Millisecond
Minute
Month
Nanosecond
Ounce
Percent
Petabyte
Pound
Second
Stone
Terabit
Terabyte
Week
Yard
Year
Unit Display
Short
Long
Narrow

Polished built-in interactions.

All components built with Formwerk will have the keyboard shortcuts, focus management, and behaviors that your users expect and rely on.

Select a country
Argentina
Australia
Brazil
Canada
China
France
Germany
India
Italy
Japan
Egypt
Mexico
South Africa
United Kingdom
United States

Try the following interactions:

  • Focus the field, then press Space
    .
  • Move through the list with
    and
    .
  • Select the focused option with
    or
    .
  • Find "Egypt" in the list by typing "E...".
  • Focus the last option with End
    or Page Down
    .
  • Focus the first option with Home
    or Page Up
    .

Supercharge your forms.

Formwerk doesn't just help you build form controls, it also tackles the most annoying parts about forms, like value tracking, submissions, form groups, and repeaters. Also, validation with HTML attributes or with schema providers like Zod, Valibot, or Arktype, and more.

ZodForm.vue
<script setup lang="ts">
import { z } from 'zod';
import { useForm } from '@formwerk/core';
import TextField from './TextField.vue';
const { handleSubmit } = useForm({
schema: z.object({
email: z.string().email().min(1, 'Email is required'),
password: z.string().min(6, 'Password must be at least 6 characters'),
}),
});
const onSubmit = handleSubmit((data) => {
alert(JSON.stringify(data.toObject(), null, 2));
});
</script>
<template>
<form @submit="onSubmit" novalidate>
<TextField name="email" type="email" label="Email" />
<TextField name="password" type="password" label="Password" />
<button type="submit">Submit</button>
</form>
</template>

Zod

Start with Starter Kits!

To get you started quickly, we are working on a few starter kits for you that you can easily copy into your project. You can choose the starting point that suits you the most and then make it your own.

Frequently Asked Questions

Who is Formwerk for?

Formwerk is for developers who want to build high-quality, scalable forms. It is ideal for those building internal UI design systems or UI libraries intended for other developers.

How large is the bundle size?

Formwerk is tree-shakable, meaning only the composables you use will be included in your bundle. The total bundle size is around 18.2 kB gzipped.

What validation options does Formwerk provide?

Out of the box, you can use HTML validation attributes without any additional dependencies. Formwerk also supports Schema Standards, allowing you to use Zod, Valibot, Arktype, and other validation libraries with your forms.

What kind of composables are within the scope of Formwerk?

Any functionality related to forms or form management falls within Formwerk's scope. Beyond typical form components, we welcome suggestions for useful composables that could enhance form development.