formify-vue
v1.9.0
Published
  : The text displayed on the button.
Usage:
<script setup>
import { Button } from 'formify-vue'
const handleClick = () => {
console.log('Button clicked!')
}
</script>
<template>
<Button label="Click Me" @click="handleClick" />
</template>Checkbox
A checkbox component that supports different sizes and states with built-in validation for both boolean and array models.
Props:
name(string, required): The name attribute for the checkbox.value(string, required): The value associated with the checkbox.inputId(string, required): The ID of the checkbox input.size(string, required): The size of the checkbox. Options:sm,md,lg,xl.
v-model:
- Type:
boolean | string[] - Description: Binds the checked state of the checkbox. For single checkboxes, it is a
boolean. For grouped checkboxes, it is an array of selected values.
Usage:
<script setup>
import { Checkbox } from 'formify-vue'
import { ref } from 'vue'
const checked = ref(false)
const selectedValues = ref([])
</script>
<template>
<!-- Single Checkbox -->
<Checkbox name="example" value="test" inputId="checkbox1" size="md" v-model="checked"
>Accept Terms</Checkbox
>
<!-- Grouped Checkboxes -->
<Checkbox name="group" value="option1" inputId="checkbox2" size="md" v-model="selectedValues"
>Option 1</Checkbox
>
<Checkbox name="group" value="option2" inputId="checkbox3" size="md" v-model="selectedValues"
>Option 2</Checkbox
>
</template>MultipleSelect
A multi-select component featuring a customizable input field, allowing for dynamic addition and removal of options.
Props:
inputId(string, required): The ID of the input element.autocompleteOptions(array, optional): Options for autocomplete suggestions.allowCustom(boolean, optional, default:true): Whether custom options are allowed.preventDuplicates(boolean, optional, default:true): Whether duplicate options are prevented.
v-model:
- Type:
string[] - Description: Binds the array of selected items.
v-model:searchTerm:
- Type:
string - Description: Binds the current search term typed in the input, for custom logic or display.
Usage with searchTerm:
<script setup>
import { MultipleSelect } from 'formify-vue'
import { ref } from 'vue'
const selectedItems = ref([])
const searchValue = ref('')
const options = ['Option 1', 'Option 2', 'Option 3']
</script>
<template>
<MultipleSelect
inputId="multi-select"
v-model="selectedItems"
v-model:searchTerm="searchValue"
:autocompleteOptions="options"
>
Select Items
</MultipleSelect>
<p>Current search term: {{ searchValue }}</p>
</template>NumberInput
A number input component built with support for minimum, maximum, and step values.
Props:
min(number, optional): The minimum value.max(number, optional): The maximum value.step(number, optional): The step value.inputId(string, required): The ID of the input element.prefix(string, optional): A prefix displayed before the input.suffix(string, optional): A suffix displayed after the input.
v-model:
- Type:
number - Description: Binds the numeric value of the input.
Usage:
<script setup>
import { NumberInput } from 'formify-vue'
import { ref } from 'vue'
const value = ref(0)
</script>
<template>
<NumberInput
inputId="number-input"
v-model="value"
:min="0"
:max="100"
:step="1"
prefix="$"
suffix="%"
>Enter Value</NumberInput
>
</template>Select
A dropdown select component with customizable options.
Props:
options(array, required): An array of objects withnameandvalueproperties for the dropdown options.
v-model:
- Type:
string - Description: Binds the selected value of the dropdown.
Usage:
<script setup>
import { Select } from 'formify-vue'
import { ref } from 'vue'
const selected = ref('')
const options = [
{ name: 'Option 1', value: 'option1' },
{ name: 'Option 2', value: 'option2' },
]
</script>
<template>
<Select v-model="selected" :options="options">Choose an Option</Select>
</template>Slider
An interactive slider component with markers, value validation, and a dynamic progress indicator.
Props:
min(number, optional, default:0): The minimum value.max(number, optional, default:100): The maximum value.step(number, optional, default:1): The step value.markers(array, optional): An array of marker values to display on the slider.
v-model:
- Type:
number - Description: Binds the numeric value of the slider.
Usage:
<script setup>
import { Slider } from 'formify-vue'
import { ref } from 'vue'
const sliderValue = ref(50)
</script>
<template>
<Slider v-model="sliderValue" :min="0" :max="100" :step="10" :markers="[0, 25, 50, 75, 100]"
>Adjust Value</Slider
>
</template>Development Setup
Prerequisites
Installation
Run the following command to install all dependencies:
npm install