Common, optional, first-party add on features for FormKit.
You can add this package by using npm install @formkit/addons
or yarn add @formkit/addons
.
Adds auto-animate to each input automatically:
createAutoAnimatePlugin(options?: AutoAnimateOptions, animationTargets?: Record<string, string[]>): FormKitPlugin;
options
optional — AutoAnimateOptionsanimationTargets
optional — A map of input types and an array of their sections that should be animated.import { createApp } from 'vue'
import App from 'App.vue'
import { createAutoAnimatePlugin } from '@formkit/addons'
import { plugin, defaultConfig } from '@formkit/vue'
createApp(app).use(plugin, defaultPlugin({
plugins: [
createAutoAnimatePlugin({
// optional config
duration: 250,
easing: 'ease-in-out',
delay: 0,
},
{
// optional animation targets object
global: ['outer', 'inner'],
form: ['form'],
repeater: ['items'],
})
]
}))
Creates a new auto-height textarea plugin.
createAutoHeightTextareaPlugin(): FormKitPlugin;
Creates a new floating label plugin.
createFloatingLabelsPlugin(FloatingLabelsOptions?: FloatingLabelsOptions): FormKitPlugin;
FloatingLabelsOptions
optional — The options of FloatingLabelsOptions to pass to the pluginCreates a new save-to-local-storage plugin.
createLocalStoragePlugin(localStorageOptions?: LocalStorageOptions): FormKitPlugin;
localStorageOptions
optionalCreates a new multi-step plugin.
createMultiStepPlugin(options?: MultiStepOptions): FormKitPlugin;
options
optional — The options of MultiStepOptions to pass to the pluginThe options to be passed to createFloatingLabelsPlugin
interface FloatingLabelsOptions {
useAsDefault?: boolean;
}
The options to be passed to createLocalStoragePlugin
interface LocalStorageOptions {
beforeLoad?: (payload: any) => any;
beforeSave?: (payload: any) => any;
control?: string;
debounce?: number;
key?: string | number;
maxAge?: number;
prefix?: string;
}
The options to be passed to createMultiStepPlugin
interface MultiStepOptions {
allowIncomplete?: boolean;
hideProgressLabels?: boolean;
tabStyle?:'tab' | 'progress';
}