type
prop of datetime-local
input (#1486)date_before_or_equal
, date_after_or_equal
, date_before_node
, date_after_node
data-invalid
attribute to not be removed when conditionally removing validation rules (#1384).context.state.passing
property indicates whether or not a given input is passing all its validation rules.mergeStrategy
to allow syncing between two nodes of the same name inside the same parent.@formkit/inputs
package.Transition
components.useFormKitContext
for access to a the context object of the parent FormKit
component — or any other FormKit
component in the tree. Optionally, you can provide an effect callback that is run when the context is available.useFormKitContextById
for access to the context object of any FormKit
component with an explicit id. Optionally, you can provide an effect callback that is run when the context is available.useFormKitNodeById
for access to a the node object of any FormKit
component with an explicit id. Optionally, you can provide an effect callback that is run when the node is available.type
prop of the FormKit component (#1241).stopWatch
function to the @formkit/core
package that allows de-registering receipts from the watchRegistry
function.getNode<T>()
function.@nuxt/tailwindcss
that automatically includes the formkit.theme.ts
file in the tailwind content
.currency
and unit
icons.library
prop to FormKit
and FormKitMessages
components that allows you to include additional components for the input schema, for example, when using sections-schema
to modify the input (#1145) (#1137).value
type of a FormKit
component that is passed a FormKitTypeDefinition
is now inferred from the FormKitTypeDefinition
.changeLocale
that caused updated locale to not be used on new nodes (#1143).@formkit/icons
package (#1184).FormKitIcon
component to the autoImport
feature of the Nuxt module (#1168).BeforeStepChangeData
(#1224).datetime-local
input type (#1129).peerDependency
of @formkit/vue
to reduce the incidents of multiple Vue instances in the same project (#1160).role="button"
to the icon wrappers when a click event is added to the icon (#1210).The type
argument of the FormKit
component now requires a matching type in the FormKitInputProps
type for TypeScript support. If you are using custom inputs and have not supplied a module augmentation for FormKitInputProps
, you will need to update the FormKitInputProps
type to include your types.
npx formkit@latest theme
command.prefix
content when calculating label position. (#878)@formkit/cli
package to allow generating of published themes locally in your projects. See the new documentation here. (#1170)multi-step
would not allow schema overrides of tabs
or tab
sections. (1110)FormKitKitchenSink
component to ship new $options
presets that can be used in the dynamically fetched schema examples for theme authors.1.5.0
that caused the context.value to not properly synced with the node.value
inside of nested group structures (#1133).FormKit 1.5.0 ships with a new development build of FormKit. In development FormKit now uses slightly different versions of its packages that include additional developer experience enhancements. This is similar to how Vue itself has "development" and "production" versions, and it allows FormKit to provide an improved developer experience such as improved HMR support and better error messages.
The groundwork is now laid for greatly improved developer experience in future releases. This release also includes dozens of bug fixes and improvements.
createInput
now supports a third argument, sectionsSchema which allows you to extend the default sections that come with createInput
(#882).didMount
and node event mounted
to recognize when the <FormKit>
component is mounted to the DOM (#0b8753d).node.children
are observed by @formkit/observer
, this allows validation rules to access node.children
with reactivity.changeLocale
composable that globally changes the locale of all forms with Options API, Composition API, and Nuxt autoimport (#1112)allow_non_alpha
and allow_numeric
.npx formkit@latest create-app
) to use themes.formkit.com’s theme system.options
(select, checkbox, radio, autocomplete etc) now properly count their __mask
value (#1046).@formkit/nuxt
’s experimental autoImport
feature (1095, and others).node.clearErrors()
always removes errors local to that node (#941)createInput()
(#1105).data-complete
on groups/lists (#1038).true
or false
(#989).Vitest does not automatically use the same node parameters (conditions) that Vite does (see #4971). If you find your tests failing after you update, you can add the following to your vitest.config.js
file:
export default defineConfig({
resolver: {
conditions: process.env.VITEST ? ['development'] : undefined
},
test: {
// ...vitest config
}
})
Vite hould be at ~1.2.x
or higher to use this feature.
<KitchenSink>
component that renders a specimen of every FormKit input (helpful for styling).state.required
property to the context object (makes adding asterisks to required inputs easier).aria-required
attribute to <input>
, <select>
, and <textarea>
elements when they are required (#984).force-show
prop to the <FormKitSummary>
component to force the summary to show even if there are no visible errors.create-theme
command for the formkit
CLI tool to scaffold a new theme from @formkit/theme-starter
.node.submit()
to fail when inside a custom element’s shadow root (#1057).<FormKitProvider>
(and related providers) (#1013).invalidDate
message to the to the validation
locale key (#953)min
and max
validation message (en
) to be the validation
locale key (#953)incomplete-message
prop (on forms) from being reactive (#1047).togglebuttons
input.length
rule.<KitchenSink>
component that renders all input specimen.data-has-multiple
attribute to file
inputs on the outer
section when they have multiple files.select
input with option groups containing non-string values (#986).autoImport
in webpack (#983)create-app
command of the formkit
cli tool when installing vite
.@formkit/nuxt
module with autoImport
to not include the FormKit component (#995)@formkit/nuxt
in autoImport
mode where the SSR context was not being reset after each request leading to hydration errors and broken UI on some pro inputs.@formkit/nuxt
with the autoImport
option enabled.select
input now supports grouped options (<optgroup>
) (#426).@formkit/nuxt
package now includes an experimental autoImport
option that only loads FormKit on the pages it is used rather than globally. This will remove FormKit from your entry file. We plan to eventually make this the default behavior and encourage everyone using the current nuxt module to try the new option.prefix-icon
and suffix-icon
to inputs created with createInput()
.colorpicker
input.color
icon.<FormKitProvider :config="yourConfig">
— a component that defines a new configuration boundary. Any <FormKit>
components that are nested beneath a <FormKitProvider>
will inherit their configuration from this location.<FormKitLazyProvider>
which checks for a higher order <Suspense>
boundary (if not found it injects one) and injects a <FormKitConfigLoader>
component.<FormKitConfigLoader>
component. An async component that performs a dynamic import for a configuration file.Note: The new components listed above are currently experimental and will be documented further as the API stabilizes.
<FormKit>
component that causes a TypeScript error in Vue Language Tools (Volar) > 1.8.11
.@formkit/*
packages.alpha
, alphanumeric
, and contains_*
validation rules for the latin
charset.With this release we are officially declaring FormKit stable and production ready. Many community members have already been using FormKit in production for over a year now and have been very happy with the results. We hope you will be too!
Additionally FormKit Pro is now available to the general public (no early access required). FormKit Pro is still in Beta, and we are working hard to prepare it for a stable release.
<FormKitSummary>
component that automatically lists all the errors and validation messages in a form with jump links to each (a11y).radio
, checkbox
, and range
inputs (a11y).4.5:1
(a11y).file
input now includes the file name in the remove file button (a11y).file
input now re-focuses after removing a file (a11y).config
object.StepHandlers
and MultiStepHandlers
and BeforeStepChangeData
to assist typing multi-step inputs.datetime-local
inputs to not resolve their slot typings.We don’t talk about Bruno.
meta
. Meta inputs are in-memory only and add data to your form without displaying it to the user or rendering anything on the page. Meta docs.number
prop to text
, number
, range
, and hidden
inputs that casts the value to a number using parseInt
or parseFloat
and expands or contracts the type definition of the value to match.id
attributes when used in a dynamic list (#908).stepIndex
and steps
to the step
input’s type definition.nl
locale translations.FocusEvent
to type definition of context.handlers.blur
.autoHeightTextareaPlugin
and greatly improves it’s resizing accuracy (#888)tet
and lt
translations (#886)barcode
input available via @formkit/barcode
package. Barcode docsdropdown
input functionalities:
whenAvailable
utility from @formkit/utils
dynamically references its document context, facilitating FormKit's usage within web component shadow DOM. #837dropdown
, autocomplete
, and taglist
inputs.#empty
section/slot for the repeater
input to display context when there are no values. Repeater docslt
)repeater
respects the disabled state of its parent form. #579taglist
accepts empty options. #586autocomplete
input compatibility with Vue's @focus
directive. #670taglist
accepts values outside its options list. #681datepicker
error on keyboard navigation in picker-only
mode. #736pointer-events: none
to submit-type buttons in the actions
slot. #790taglist
respects the max prop with open-on-click
enabled. #793autocomplete
with selectionAppearance
set to option
to work with open-on-click
prop. #817eq
function from @formkit/utils
. #819datepicker
navigation error when starting with year
. #827taglist
respects the max prop with close-on-select
disabled. #838formkit-icon
class aligns with config.rootClasses
. #859datepicker
Safari focus issue by modifying the open button to a role="button"
div. #864dropdown
, autocomplete
, taglist
) can now render values that are not part of their options list. #877<FormKitRoot>
component. This component provides context about the root element (Document
or ShadowRoot
). When using FormKit inside a Custom Element (Web Component) wrap one or many FormKit input’s in <FormKitRoot>
to ensure proper functionality.node.props.__root
and context.__root
property that references the node’s current root element (Document | ShadowRoot
).mult-step
input plugin would break when rendering steps
in a v-for
loop or conditionally rendering a step via schema. #823 #825data-empty
attribute to input outer
wrappers for styling purposes. #777runtimeConfig
support — see the new docs in the installation wizard guide. #795node.next()
, node.previous()
, and node.goTo()
extensions for multi-step
inputs via MultiStep plugin. This allows for easier external control of multi-step
input navigation. #685node.restoreCache()
extension for the localStorage plugin to allow restoring of form values to cache on failed submit. #727multi-step
input. #720blur
event could cause console errors on route change. #735beforeStepChange
now works with async
function calls. #743file
inputs would not allow re-uploading the same file after calling reset
. #762fk-
prefix.text
family of inputs to re-use the first schema(#719)FormKitValidationMessage
to help type validation message functions (#695)key
, control
, debounce
, beforeSave
, and beforeLoad
.group
. eg (form
, group
, multi-step
, etc).value
property of a slot to not be updated in some edge cases (#717).dynamic
list prop allows you to easily create your own repeaters.require_one
(thanks @devoidofgenius), contains_alpha
, contains_alphanumeric
, contains_alpha_space
, contains_symbol
, contains_uppercase
, contains_lowercase
, contains_numeric
, symbol
, uppercase
, and lowercase
(thanks @riderx).textarea
inputs with dynamically resizing height.commitRaw
event that fires even if there is no change to the input value.FormKitSchema
can now use a single root node (instead of a fragment)v-show
now work adding a key
to dynamic inputs is generally no longer required (#528).node.reset()
function become the new default value for the input (#621).zh-TW
)lv
)tet
)node.extend()
.@input
event and removed the now unnecessary debounce on the change event.@formkit/observer
will now observe changes to node._value
in instances where you want to operate on the non-debounced input value.range
icon in @formkit/icons
has been updated to only show one control handle since HTML range inputs do not support multiple values. The old multi-handle icon has been repurposed for the new slider
FormKit Pro input.repeater
inputs to not hydrate properly (#458).repeater
inputs to throw an error when being removed (#457).@blur
event on a custom input (#413).v-model
to only fire input events on every other input (#463)node.walk()
to prematurely end when using stopOnFalse
.Beta 16 is the first version of FormKit that does not have a pre-release identifier. Beta 16 and all remaining beta versions will be released under the 0.x.x
semantic version. The first stable release will be 1.0.0
and is targeted for later this year. This change in versioning should help with package manager dependency resolution as we complete our beta release cycles.
overlay
option.dirty-behavior
prop allows users to opt into a compare
behavior which compares the current value of the input to the original value of the input. If the input is changed back to its original state the context.state.dirty
flag will revert back to false.options
prop (used in select, radio, checkboxes and some pro inputs) can now differentiate between null
and undefined
values.@formkit/nuxt
module and syntax highlighting.dirty
state of an unrelated input to get incorrectly set true
when an object (like a group) was updated (#520).submitted
state like the form’s children on an unsuccessful form submission (#503).This release adds new 1st-party plugins to the @formkit/addons
package, ships bug fixes and styling updates for both CSS and Tailwind CSS users.
@formkit/addons
. Ships with standalone CSS styling you can import that works well with our genesis
theme. Check out the full documentation here.text
family (text
, email
, url
, etc) and textarea
inputs with the new floating labels plugin in @formkit/addons
. Check out the full documentation here.Next
and Previous
strings to UI localization object for use in plugins and custom inputs.@formkit/themes
.:focus-visible
styling to buttons to show focus state when using keyboard navigation.loading
styles for submit
buttons in the Tailwind CSS Genesis theme.This release addresses some issues for Tailwind users that were introduced in beta.13
.
@formkit/themes/tailwindcss
to only include a default
export of the FormKitVariants
plugin.@formkit/themes/dist/tailwindcss/genesis
.!
to $remove:
in order to not conflict with Tailwind's built-in !
operator that adds !important
to a style rule.<FormKitMessages>
component which allows relocation of a form’s validation and error messages and the ability for group
and list
inputs to display their own error and validation messages.!
prefix operator to selectively remove an existing class without needing to use the long-form object syntax. eg outer-class="my-class !formkit-outer"
adds my-class
and removes the default formkit-outer
class.checkbox
and radio
inputs now have a data-checked
attribute around their respective wrapper making it easy to add custom styling for checked vs non-checked states.en
, pt
, zh
).empty-message
prop allows for message to be rendered in listbox when no options are passed (dropdown
, autocomplete
, and taglist
). #502dropdown
, autocomplete
, taglist
). #350max
prop for taglist
and autocomplete
with multiple
inputs. #501closeOnSelect
prop will keep the listbox
expanded as selections are made (autocomplete
multiple and taglist
).forceExpanded
prop forces the listbox
to remain open for dev purposes (dropdown
, autocomplete
, and taglist
).disabled
attribute.date_after
rule showed a incorrect validation message because of timezones. #488v-model
values can now be initialized as undefined
. #235validation-rules
props to recurse unexpectedly. #514sections-schema
. #541disabled
prop to need null
instead of false
to render the data-disabled
attribute on the outer wrapper. #511v-if
on the <template v-slot>
block). #489sections-schema
prop.taglist
bug where duplicate options were loaded from API. #497taglist
would render duplicate props when multiple
prop set to false
. #494autocomplete
options
were duplicating when being used fast, repeatedly, or with pasted content. #431autocomplete
and taglist
could not be removed when the provided value was an object literal. #505listbox
was still visible when no options
were passed. #504formkit.config.js
file.npx formkit@latest create-app
command to easily bootstrap new FormKit projects.length
rule validation messages across all languages.stopIfFalse
argument on the walkTree
function.null
value doesn't have a good value #415.count:blocking
event was not emitting properly in Repeaters.[Object object]
to output after the reference does exists #368.3.0.0-rc.8
and 3.0.0-rc.9
#371 and #383.@formkit/themes/tailwindcss
with TypeScript #376.family
property, which adds a data-family
attribute, and sets the value on node.props.family
. This is useful for applying plugins and styles to entire "families" of inputs like the text family of inputs, which would apply to text
, email
, password
, number
, etc.forceTypeProp
property which ensures the node.props.type
is initialized as a given value even if the input is registered under a different name. For example myModifiedCheckbox
could still have node.props.type
report "checkbox".data-multiple
attribute to checkboxes and radios when they have multiple options.@submit-invalid
event to type="form"
inputs. The event is triggered when a user attempts to submit a form but it has invalid inputs.getValidationMessages
helper function to @formkit/validation
that extracts a Map of nodes and their validation messages.decorator-icon
section to checkboxes and radios, making it easy to use custom SVGs in your checkboxes and radios.context.state.dirty
to turn true when a v-modeled form was edited (#311).node.reset()
is called (#319).removeFiles
section has been renamed to fileRemove
.fileRemove
(previously removeFiles
) section used to rendered an <a>
tag, this has been changed to a button
.@formkit/inputs
have been replaced with "sections". This should only affect users who were creating their own inputs from pre-existing composables.@formkit/cli
command line tool. Alter existing inputs by adding, removing, updating, or re-ordering sections — or add your own exported and altered input variations to your input library.meta
property to schema specification (#248).theme
option in defaultConfig()
submit
and setErrors
hooks.key
property to not work when using the $formkit
shorthand in schema (#232).@blur
(#239).for
iterations on old Safari browsers (#299).input-errors
prop will now reset any errors it previously set when set to an empty object {}
(#277).alpha
and alpha_spaces
rules (#281).tailwindcss
, unocss
, and windicss
plugins must now be imported from their own subpath of the @formkit/themes
package. For example:import formKitTailwindPlugin from '@formkit/themes/tailwindcss'
windicss
, tailwindcss
and unocss
.update:model-value
event will now only be emitted when using the v-model
directive.input
event is now debounced to reduce the amount of noise being emitted. You can use the new input-raw
to listen to every input event.setErrors
are now automatically cleared on input by default. To revert to the previous behavior, set preserveErrors: true
in your global config object.@formkit/tailwindcss
package is now deprecated — both the formKitTailwind
plugin and the generateClasses
function have been moved to the @formkit/themes
package.checkbox
, radio
, and select
inputs (inputs that use :options
) can now use any data type as their value like numbers, objects, or even null
(#85).node.clearErrors
and clearErrors
utilities to assist in clearing backend errors from an input or form.node.setErrors()
on user input. You can override this default behavior (to keep the error on the input) with preserve-errors="true"
.node.addProps
function for adding new props in custom plugins.message
hook for modifying messages as they are being set.reset
— emitted after a form is reset.index
prop that allows inputs to be injected at a given index on a parent list
type.<FormKit>
component’s input
event is now debounced, meaning it emits much less noise.import { features } from '@formkit/inputs'
.input-raw
event to the <FormKit>
component which is emitted for every single input event in an input, list, group, or form (very noisy).input
, input-raw
, submit
and submit-raw
events.dom-input-event
which has the native HTML Event
object as the payload.@formkit/themes
now includes named exports for plugin functions for Tailwind CSS (formKitTailwind
), Windi CSS (formKitWindi
), and Uno CSS (formKitUno
). By adding the correct plugin to your CSS framework's configuration file you will have access to a variety of formkit variants such as formkit-invalid:
and formkit-disabled:
.@formkit/themes
now includes the generateClasses
helper function will allows you to easily supply different class lists to ${sectionKey}
s based on input type.v-model
performance and reliability for deeply nested structures like forms with list and groups.null
values to throw errors (#151)validation-visibility
to not change when updated reactively (#159)preserve
keyword to block some form submissions (#145)@formkit/tailwind
configuration (#143)on-value
to not be set their initial value when using the :value
prop.multiple="false"
attribute and a placeholder (#148).classes
prop to not react to Vue’s reactivity when using nested refs (#155).disabled
attribute on the form without specifying disabled="true"
(#215)alpha_spaces
validation rule (#83)node.input()
(#139)@submit
event (#130)data-loading
attribute has been moved from the submit button of a form
to the <form>
tag itself.@formkit/tailwindcss
plugin to easily create Tailwind themes for your FormKit forms. Check out the Create a Tailwind CSS theme guide for more details.reset
function. This can be done on any input, group, form, or list and it will restore the value back to its initial state. It also resets the context.state
object (like blurred
and dirty
).aria-describedby
and aria-live
to all provided input types. aria-describedby
now targets help text, validation messages, and error messages (labeling provided by <label>
tags that use the for
attribute).undefined
values to their children. In other words, if a form is v-modeled and its value is set to an empty object {}
, it will clear the entire form out.context.state.settled
property that signals when the input’s internal debounce cycle has ended and a value is finished being committed to the form.data-submitted
attribute to inputs that have been submitted.fileName
(thanks @santi).parent
prop that accepts a core node for advanced use cases where inputs are decoupled from their form or data structure is desired.input-class
) inside schemas to not properly respect the $reset
command because it was treated like a variable (#61).file-list-class
or file-item-class
(#120).import '@formkit/themes/genesis
.node.submit()
(including any child node of the form).this.$formkit.submit('form-id')
(for composition api it's submitForm('form-id')
).setErrors
DX:
node.setErrors(nodeErrors, childErrors)
.setErrors
now supports pure string node.setErrors('My error')
<FormKit>
component’s core node is now available via template ref.data-invalid
attribute to the outer
section when an input has failing validation messages that are currently displayed (playground example).data-errors
attribute to the outer
section when the input has explicitly placed errors (via prop or setErrors
).data-complete
attribute to the outer
section when an input (playground example):
context.state
properties:
state.rules
- true when the input has validation rules.state.errors
- true when the input has explicit errors placed on it.state.complete
- same as logic as data-complete
.state.validationVisible
- true when the validation-visibility
condition is met (it is showing validation errors if there are any).node.setErrors
documentation.context.state
documentation with new properties and better descriptions.file
inputs from triggering custom onChange
events (#90).id
to the DOM.:value
prop on forms to be mutated on input (#72).prop:{propName}
events emitted by default props and custom input defined props (#73)beta.3
was going to be such a great release we decided to skip it and go straight to beta.4
👀 ! Only kidding. We had issues with npm and had to bump 🤦.@formkit/nuxt
package is a full featured Nuxt 3 module that makes using FormKit with Nuxt 3 as simple as possible!defaultConfig
now includes a new package @formkit/dev
which decodes FormKit’s error codes to helpful console messages (no action required) (#56).preserve
key now applies to all descendants (#53).@formkit/i18n
package (#54).@formkit
organization!options
prop that is stored in an external variable (#55)placeholder
on select inputs to be removed if something caused the input to re-render (#52).submit-behavior
to opt-out of the new automatically disabled forms.bindings
in the @formkit/vue
package.button
and submit
are automatically ignored.messages
key to the defaultConfig
to allow partial overrides to locales. This allows selective message overrides for already registered locales (#42).$: undefined
would output the value undefined
instead of the string "undefined").options
to not properly hydrate when re-populated from a group
, list
, or form
(#45).options
to not display incorrectly when missing a the label prop (#41).validation-behavior
prop on the <FormKit>
component to validation-visibility
.schema
prop on the <FormKit>
component to sections-schema
.file
input type with support for some value-added features:
createInput
helper function to make custom inputs easy to write.incomplete-message
prop allows inline customization (or disabling) of the message displayed by a form when it attempts to submit and all its inputs are not valid.defaultConfig
to accept custom inputs.props
and attrs
properties with __raw__
to pass the raw value instead of its parsed result (#36).plugin.library
— the mechanism plugins use to define new input types..vue
, .js
, formkit.config.js
and tailwind.config.js
files.@submit
and @submit-raw
events.length
and between
validation messages to always place the lower number first (#35).:options
prop would not accept number values.v-if
), it now removes it’s value from the form data and de-registers its core node.preserve
prop allows inputs to not remove their data from groups, lists, and forms when they are removed.placeholder
to not render when the prop came after the options
prop.input-errors
prop or the $formkit.setErrors()
methods. Read more about it on the form docs.$formkit.setLocale()
reactively changes the language of all displayed messages.rootConfig
proxy object that is used to store global base config and prop values (significant refactor of configuration system).FormKitObservedNode
.child
node event emitted when a parent has a child added to it.length
rule can now take max/min arguments in either order length:15,5
or length:5,15
evaluate the same.getNode
function to directly access a FormKit node using the composition API.@formkit/theme
css import location.list
inputs to sometimes throw an exception when display validation errors.node.input()
calls to not trigger reactivity in Vue.$formkit
schema shorthand for using FormKit inputs in a schema (Issue #15).disabled
prop on form, list, and group inputs automatically disables all child inputs (Issue #16).submitAttrs
prop on forms allows you to pass attributes to the form’s submit button.ignore
prop that prevents an input’s data from being used in a form.children
property of a FormKit component. (Issue #21).rootClasses
function incorrectly returns undefined
(Issue #17).submit_x
property (Issue #22).$cmp
schema nodes to fail to remount if the schema’s root object was reset causing a full re-parse (Issue #14).