1.0.12 • Published 1 year ago

ow-vue-form-ui-kit v1.0.12

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

OrangeVue Form UI kit

A completely free simple UI form components for Vue 3 based entirely on Tailwind CSS. It includes:

  • Input
  • Button
  • Dropdown
  • Radio
  • Checkbox

Features

  • Light/dark mode
  • Three styles for inputs and dropdows: linear, rounded and pill
  • Four styles for buttons: linear, rounded, pill and outline (with or without icons)
  • Components are styled and set with props

Demo

Demo

Requirements

Vue 3.x, Font Awesome, Tailwind CSS 3.x and Tailwind CSS Form Plugin (see Acknowledgements)

Installation

npm i ow-vue-form-ui-kit`

Usage

After installation, import the component in your .vue file:

<template>
<div>
    <Input
        type="tel"
        v-model="data.inputValue"
        label="City"
        id="fb-link1"
        shape="linear"
        placeholder="This is a placeholder"
        errorMsg="This is an error message"
        :charsCounter="10"
        icon="fa-solid fa-check"
    />

    <Button
        text="Rounded"
        shape="rounded"
        mainColor="secondary"
    />

    <Select
        label="City"
        v-model="data.dropdownValue"
        :options="cities"
        defaultOption="Select city"
        shape="rounded"
        errorMsg="This is an error message"
    />
    
    <Radio
        v-for="city, id in cities"
        :label="city"
        :id="'city-' + id"
        name="city"
        v-model:checked="data.radioValue"
        :value="city"
        subLabel="Text under label"
    />

    <Checkbox
        v-for="city, id in cities"
        :label="city" :id="'city-2-' + id"
        name="city"
        v-model:checked="data.checkboxValues"
        :value="city"
        subLabel="Text under label"
    />
</div>
</template>

<script setup>
import { reactive } from 'vue';
import { Input, Checkbox } from 'ow-vue-form-ui-kit';

const data = reactive({
    inputValue: 'Milano',
    dropdownValue: 'Milano',
    radioValue: 'Torino',
    checkboxValues: ['Torino', 'Firenze'],
});

const cities = ['Milano', 'Roma', 'Firenze', 'Torino', 'Bologna'];
</script>

Props Reference

Inputs

PropsTypeDefaultValuesDescription
shapeStringlinearlinear, rounded, pillInput shape.
typeStringlineartext, url, email, password, tel, searchInput type.
labelStringnullAny stringInput label content.
nameStringlinearAny stringInput name attribute.
mainColorStringneutral1One of the twelve predefined colorsInput border in normal state.
focusColorStringprimaryOne of the twelve predefined colorsInput border and background in focus state.
placeholderStringnullAny stringContent of input placeholder. If shape="linear", placeholder will not display; the label is used instead.
idStringlinearAny stringInput id attribute.
min, max, stepNumber0, 100, 1Any numberUsed in inpup type="number" to define min, max and step value acceptable.
autocompleteStringonon, offInput autocomplete attribute, turn it on or off.
autofocusBooleanfalsetrue, falseInput autofocus attribute, turn it on or off.
iconStringnullFont Awesome classesSpecify family and icon, i.e.: fa-solid fa-check
iconColorStringtext-successAny Tailwind CSS classCould be one of predefined colors or any text-* Tailwind class, even in the form text-[#ff0000]
requiredBooleanfalsetrue, falseInput required attribute.
errorMsgStringnullAny stringAn error message to display.
disabledBooleanlineartrue, falseInput disabled attribute.
charsCounterNumbernullAny integerEnable the chars input count (spaces included) and it turns red when input length is grater than the set value`
patternStringnullJavaScript regular expressionInput pattern attribute.

Buttons

PropsTypeDefaultValuesDescription
shapeStringsquaredsquared, rounded, pillButton shape.
outlineBooleanfalsetrue, falseSet button with just border and pale background.`
mainColorStringprimaryOne of the twelve predefined colorsButton color.`
typeStringbuttonbutton, submit, resetButton type attribute.
textStringnullAny stringButton text content.
textColorStringtext-whiteAny Tailwind CSS classCould be one of predefined colors or any text-* Tailwind class, even in the form text-[#ff0000]
textColorOutlineStringtext-gray-700 dark:text-white|Any Tailwind CSS class|Could be one of predefined colors or any text-* Tailwind class, even in the form text-[#ff0000]
disabledBooleanfalsetrue, falseButton disabled attribute.
iconStringnullFont Awesome classesSpecify family and icon, i.e.: fa-solid fa-check

Dropdowns

PropsTypeDefaultValuesDescription
shapeStringlinearlinear, rounded, pillDropdown shape.
optionsArray[]An array of strings or numbersAn array of strings or numbers; arrays of objects will not work.
labelStringnullAny stringDropdown label content.
nameStringlinearAny stringDropdown name attribute.
mainColorStringneutral1One of the twelve predefined colorsDropdown border in normal state.
focusColorStringprimaryOne of the twelve predefined colorsDropdown border and background in focus state.
listColorStringneutral2One of the twelve predefined colorsDropdown list background color.
defaultOptionStringnullAny string|Content of dropdown default option that is the one when no value is selected.
idStringlinearAny stringDropdown id attribute.
errorMsgStringnullAny stringAn error message to display.
disabledBooleanlineartrue, false`Dropdown disabled attribute.

Radios and checkboxes

PropsTypeDefaultValuesDescription
valueString, NumbernullAny string, any numberInput radio or checkbox value.
checked
(for checkboxes)ArraynullAn array of strings or numbersTo be used in the form v-model:checked="["a", "b", "c"]" to determine the checked value; can be an array of strings or numbers; arrays of objects will not work.
checked
(for radios)String, NumbernullAny string, any numberTo be used in the form v-model:checked="data.myValue" to determine the checked value.
subLabelStringnullAny stringText displayed under the label.
idStringnullAny stringInput id attribute.
mainColorStringprimaryOne of the twelve predefined colorsElement color in all states.
nameStringnullAny stringInput name attribute.

Default color Reference

Light mode

ColorHex
primary#ff6600 #ff6600
secondary#6366f1 #6366f1
tertiary#06b6d4 #06b6d4
quaternary#ec4899 #ec4899
neutral1#6b7280 #6b7280
neutral2#cbd5e1 #cbd5e1
label#94a3b8 #94a3b8
placeholder#94a3b8 #94a3b8
info#3b82f6 #3b82f6
success#22c55e #22c55e
warning#f59e0b #f59e0b
danger#ef4444 #ef4444

Dark mode

ColorHex
primaryDark#ea580c #ea580c
secondaryDark#4f46e5 #4f46e5
tertiaryDark#0891b2 #0891b2
quaternaryDark#be185d #be185d
neutral1Dark#737373 #737373
neutral2Dark#1e293b #1e293b
labelDark#94a3b8 #94a3b8
placeholderDark#9ca3af #9ca3af
infoDark#2563eb #2563eb
successDark#047857 #047857
warningDark#d97706 #d97706
dangerDark#b91c1c #b91c1c

Acknowledgements

Author

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago