v2.4.2 · zero dependencies · full or subset builds

Every form control, one small library.

ZidanForm upgrades native inputs in place — select, checkbox, switch, radio, file upload and text fields — while keeping real form values, FormData, form.reset() and constraint validation intact. Structure ships separately from the theme, so you can restyle everything with a handful of CSS variables.

Controls
6
Themes
5
Adapters
4
Dependencies
0

Choose your build

One library, or just the controls you need

The full bundle ships every control. Select-only and file-only builds keep the same API, markup attributes, themes, layouts and framework adapters for their controls, with their own smaller CSS. Load one build per page — never a subset together with the full bundle.

Full build ≈224 kB · ≈131 kB min

Select, checkbox, switch, radio, file upload and text fields in one file.

JS JS min core CSS theme CSS

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/plugin-core.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/plugin-theme.min.css">
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/zidan-form.min.js"></script>

Select-only ≈114 kB · ≈68 kB min

Select, combobox, tags and multi-select — everything the select family needs.

JS JS min core CSS theme CSS

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/select/plugin-select-core.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/select/plugin-select-theme.min.css">
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/select/zidan-select.min.js"></script>

File-only ≈86 kB · ≈50 kB min

Dropzone, picker and inline file upload with progress, cancel and previews.

JS JS min core CSS theme CSS

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/file/plugin-file-core.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/file/plugin-file-theme.min.css">
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.2/dist/file/zidan-file.min.js"></script>

The snippets load the real .min files shipped in the npm package — drop .min to load the readable source. Sizes are rounded from the 2.4.2 build (1 kB = 1,024 bytes). ESM variants and every per-file URL are listed in the README build section and docs/build.md. Not sure which options to pick? Build the field in the playground.

Reference

Every control, its options and how to use it

All nine control families share the same field options for theme, layout, labelling and validation, and each adds its own. The lists below are the options you will reach for most; the playground exposes all of them one control at a time and copies both the attribute and JavaScript form.

Two ways to initialise

Add data-zidan / data-zidan-select for auto-init, or call the function directly on an element, ID, class or list. JS-only options — callbacks, fetchers, validators — need the second form.

<!-- 1. markup: auto-initialised on DOMContentLoaded -->
<select id="country" data-zidan-select="combobox"
        data-zidan-searchable="true" data-zidan-clearable="true">…</select>

<!-- 2. JavaScript: script a field that is already in the page -->
const picker = zidanSelect('#country', {
  mode: 'combobox',
  clearable: true,
  onChange: ({ value }) => console.log(value)
});

const email = zidanField('#email', {
  label: 'Email', hint: 'We never share it.',
  clearable: true, alwaysValidate: true
});

Select, combobox & tags

ZidanSelect

One control with three modes: plain list, type-to-filter and tag entry.

  • modeselect · combobox · tags
  • searchableType-to-filter; off for a plain select.
  • clearableClear button when a value is set.
  • multipleSeveral values; also from the native attribute.
  • maxTags minTagLengthTag limits, with messages.
  • allowFreeTextfalse limits tags to the option list.
  • scrollbardefault · thin · fancy · hover · hidden.
  • fetchOptions fetchPageSizeAsync pages, cache and load-more.
  • renderOption renderTag filterOptionRendering hooks.

picker.getTags() · picker.addTag('css') · picker.setOptions(items) · picker.loadMore()

Text & textarea

ZidanTextField

Text, email, password, url, search, textarea and colour, with icons and counters.

  • label hint placeholderGenerated label replaces the author's and is restored by destroy().
  • autoIcon iconIcon from the input type, a built-in name or SVG.
  • iconPosition iconClickableLeft/right; clickable emits zidan:icon-click.
  • prefix suffixStatic adornments inside the shell.
  • clearable revealClear button; password show/hide.
  • counterCharacter counter, defaults to maxlength.
  • validationIconCheck/alert glyph driven by the validation state.

field.getValue() · field.validate() · field.setError('…') · field.clearError()

Number & stepper

ZidanTextField

A native number input with a stacked, split or inline stepper.

  • stepperstacked · split · inline, or off.
  • stepperPositionLeft or right for the inline mode.
  • stepperWrapWrapping border around the whole field.
  • stepperLongPress stepperDelay stepperIntervalHold-to-repeat timing.
  • stepperUpLabel stepperDownLabelAria labels for “+/−”.

field.stepUp(2) · field.stepDown() · field.setStepper(false) · event zidan:step

Phone

ZidanTextField

Caret-safe formatting with a country selector and per-country length checks.

  • phonetrue or { country, format, validate }.
  • phoneCountryISO-2 code, e.g. GB.
  • phoneFormatnational · international · e164.
  • phoneCountrySelect phoneCountriesSelector visibility and the ISO list.
  • phoneCountryLabelAria-label for the selector.

field.setPhoneCountry('DE') · field.setPhoneFormat('e164') · ZidanForm.formatPhone('07700900123','GB','e164')

Range

ZidanTextField

Value bubble, progress fill, ticks and formatted readouts around a native range.

  • rangeVariantdefault · gradient · stepped · minimal.
  • rangeBubbleMode rangeBubblePositionalways · active · never; top or bottom.
  • rangeFill rangeMinMaxProgress colour and the min/max scale.
  • rangeTicks rangeTickLabelsCount, array, JSON or comma list; labels replace duplicate scale ends.
  • rangeLabels rangeFormatLabel map and template/function; also feeds aria-valuetext.
  • outputMirror the formatted display value into an <output>.

field.getValue() stays the raw value · output shows the formatted one

Date & time

ZidanTextField

Native pickers with an optional button, weekend/date rules and custom validators.

  • pickerButton pickerIcon pickerLabelExplicit picker button and icon.
  • disableWeekendsSaturday/Sunday fail validation.
  • disabledDatesComma list, array or function.
  • validateDate(value, date, field) returns boolean or a message.

field.openPicker() · field.validate() · event zidan:picker

Checkbox & switch

ZidanCheckbox

Checkbox, iOS/Material/square switch, card, filter button and minimal variants.

  • variantdefault · switch · card · button · minimal.
  • switchStyleios · material · square · labeled · icon.
  • onLabel offLabelText inside labeled/icon switches.
  • descriptionSecond line under the label.
  • indeterminateStart in the mixed state.

field.isChecked() · field.setChecked(true) · field.setIndeterminate(true)

Radio group

ZidanRadioGroup

Enhances the <fieldset> once and keeps the real radios as the source of truth.

  • variantstacked · inline · card · button · tile.
  • deselectableClicking the checked radio clears the group.
  • labels{ value: 'Label' } fallback text per option.
  • descriptionsSecond line per option value.
  • native requiredOne radio per group carries it; the browser blocks submit.

group.getValue() · group.setValue('pro') · group.destroy() restores the fieldset

File upload

ZidanFileUpload

Dropzone, button, avatar, gallery or compact picker with progress, retry and previews.

  • variantdropzone · button · avatar · gallery · compact.
  • accept maxFiles maxSizeMB maxSizeValidated and reported.
  • upload uploadUrl uploadFieldFunction, XHR endpoint or visual simulation.
  • uploadData uploadHeaders withCredentialsExtra FormData, headers and credentials.
  • autoUpload simulateUpload simulateDurationWhen uploads start, and the demo pipeline.
  • showPreview showFileMeta renderFileRow rendering.
  • progressTemplate uploadedLabel failedLabel cancelLabel retryLabelPer-file copy.

upload.getFiles() · upload.uploadAll() · upload.cancelUpload(file) · upload.retryUpload(file) · upload.clear()

Shared by every field

ZidanFieldBase
  • themedefault · modern · minimal · dark · glass, or a registered name.
  • frameworknone · bootstrap · tailwind · bulma · foundation.
  • layoutstacked · inline · compact · floating · outlined · card.
  • validation alwaysValidateInitial state; mark invalid while typing instead of on blur.
  • hintLinked with aria-describedby and restored by destroy().
  • messagesOverride any validation message.
  • validate checkAsync()Custom and Promise-based rules.
  • onInit onChange onValidationCallbacks, plus matching zidan:* DOM events.

setTheme() setFramework() setLayout() setValidation() update() destroy()

Options playground

Changes apply live to every control on this page and update the config snippet.

Theme showcase

One form, every control type

Everything opt-in in a single form: submit it, reset it, or run it through your validation library.

Plan
Notifications

Live events

Event console

Every zidan:* event fired by the demos above is appended here — steps, pickers, phone formats, uploads, validation and icon clicks.

0 events

    Interact with any control above to see events.

    Why ZidanForm

    One library for the whole form

    Select libraries usually stop at the select box. ZidanForm styles every native control with the same API and the same two stylesheets — and never hides the real input.

    One API, every control

    Select, combobox, tags, checkbox, switch, radio, file upload, text, phone, stepper, range and date/time inputs share one lifecycle and one theme.

    Native underneath

    The real control stays in the DOM at 1×1 px, so FormData, reset(), required and :invalid keep working.

    Theme without forking

    Structure lives in plugin-core.css, colour and skins in plugin-theme.css — override tokens, not layout.

    Feature comparison of ZidanForm with other form and select libraries
    Feature ZidanForm Select2 Choices.js Tom Select Slim Select
    Runtime dependencies None jQueryNoneNoneNone
    Controls covered Select, combobox, tags, check, switch, radio, file, text, date/time, range, phone Select / tagsSelect, text, tagsSelect / tagsSelect
    Input icons & adornments Auto, custom SVG, left/right, clickable ————
    Phone number formatting Per country, 3 styles each ————
    Number stepper Stacked, split, inline, hold-to-repeat ————
    Range slider skins Gradient, stepped, minimal, formatter functions ————
    File upload variants & progress Dropzone, button, avatar, gallery, compact, progress ————
    Text input utilities Clear, reveal, prefix/suffix, counter, floating labels ————
    Date/time picker customization Icon as picker button, left/right, labels, date rules ————
    Built-in validation rules Every type, weekend/blocked dates, validation icons ————
    No-JS init (ID, class, JSON) Config targets, marker classes, data-zidan-options JSON JS selectorJS selectorJS selectorJS selector
    Split structure / theme CSS Yes PartialPartialPartialPartial
    Select-only / file-only bundles Yes — trimmed JS + matching CSS Core is select-onlyCore is select + textCore is select-onlyCore is select-only
    Built-in themes 5 + custom tokens Via CSSVia CSSVia CSSVia CSS
    CSS-framework adapters Bootstrap, Tailwind, Bulma, Foundation ————
    Validation coexistence Native, jQuery Validation, JustValidate, Parsley ————
    Framework support Vanilla API + React, Next.js, Vue, Svelte, Angular guides Community wrappersCommunity wrappersCommunity wrappersCommunity wrappers

    Describes each project's core package; plugins can close some gaps. Full matrix, trade-offs and migration notes in docs/comparison.md. Trimmed select-only and file-only bundles are listed in the README and docs/build.md.

    Questions

    Frequently asked

    The short answers. The detailed ones live in the docs.

    Does it require jQuery?

    No. ZidanForm is vanilla JavaScript with no runtime dependencies. It works alongside jQuery, but never needs it.

    Will FormData, reset and validation still work?

    Yes. The native control stays in the DOM at 1×1 px and is only visually covered, so FormData, form.reset(), required, :invalid and input.files behave exactly as before.

    Can I use it with React, Vue or Angular?

    Yes — initialise in a mount/effect and call destroy() on cleanup. The framework guide covers React, Next.js SSR, Vue and Angular patterns.

    Does it conflict with jQuery Validation, JustValidate or Parsley?

    No. These libraries ignore hidden fields, so ZidanForm keeps the native control reachable and syncs aria-invalid. There is a runnable test bench for all four validators.

    How do I customise the look?

    Load plugin-core.css then plugin-theme.css, and override CSS variables or add a theme. Register custom names with ZidanForm.themes.push('brand') before initialising. See theming.

    Can I enhance just one select?

    Yes. Everything is opt-in: add a data-zidan-select attribute, initialise only that element, or call zidanField() / zidanSelect() directly. destroy() restores the original markup.

    Is there a build step or bundler requirement?

    No. It ships as a classic script, an ESM wrapper and plain CSS. Use a CDN, npm, or copy the files; no compiler or bundler is required.

    Which browsers are supported?

    Current Chromium (105+), Firefox (121+) and Safari 15.4+ / iOS 15.4+. Firefox exposes thin native scrollbars only. See the browser matrix in the theme showcase.