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.
<!-- 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()
PlaygroundLive demoOptionsAsync & tags
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()
PlaygroundTextareaLive demoOptions
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
PlaygroundLive demoOptions
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')
PlaygroundLive demoOptions
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
PlaygroundLive demoOptions
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
PlaygroundLive demoOptions
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)
PlaygroundLive demoOptions
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
PlaygroundLive demoOptions
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()
PlaygroundLive demoOptionsUpload pipeline
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()
Full option tablesValidation guideTheming