Skip to content

Fields Guide

@enlolab/forms ships with a rich catalogue of fields—text inputs, selects, date pickers, sliders, switches and more—each exposed via a single declarative configuration. This guide gives you a bird’s-eye view of all available types and links to component-level docs for fine-grained details.

Why this matters: Knowing the field palette helps you prototype faster and pick the right control for the job.

TypeComponentTypical use-case
textText InputNames, generic strings
emailText InputEmail addresses (built-in pattern)
telText InputPhone numbers
textareaTextareaMulti-line descriptions
TypeComponentSingle / MultiNotes
selectSelectSingleCustom icons per option
radioInputSingleNative radio group
checkboxBooleanSimple true/false
switchSwitchBooleaniOS-style toggle
checkbox-groupCheckbox GroupMultiArray of selected values
switch-groupSwitch GroupMultiArray of selected values
button-radioButton RadioSingleSelect via button buttons
button-checkboxButton CheckboxMultiToggle buttons
button-cardButton CardSingle / MultiCard-style selectable options
TypeComponentModeFeatures
dateDate Pickersimple / popoverOptional presets, locale es by default
daterange(coming soon)RangeTwo-calendar selection
TypeComponentDescription
sliderSliderNumeric value or range (array)
htmlRaw HTMLEmbed headers, paragraphs or custom markup
buttonArbitrary ButtonUse inside fields when you need a CTA mid-form

Every field extends BaseFieldProps which includes:

  • label - Texto de la etiqueta (puede contener HTML)
  • hideLabel - Ocultar visualmente la etiqueta
  • label_className - Clases CSS para la etiqueta
  • colSpan - Número de columnas en diferentes breakpoints (default, sm, md, lg, xl, 2xl, 3xl)
  • wrapper_className - Clases CSS para el wrapper del campo
  • input_className - Clases CSS para el input/control
  • size - Tamaño del campo (xs, sm, md, lg, xl)
  • icon - Icono React (lucide-react, iconify, etc.)
  • iconProps - Props adicionales para el icono
  • value - Valor inicial del campo
  • schema - Requerido: Esquema Zod para validación
  • error_className - Clases CSS para mensajes de error
  • helperText - Texto de ayuda debajo del campo
  • helper_className - Clases CSS para el texto de ayuda
  • tooltip - Texto de ayuda contextual en tooltip
  • hidden - Ocultar campo (puede ser función reactiva)
  • disabled - Deshabilitar campo (puede ser función reactiva)
  • readOnly - Solo lectura (puede ser función reactiva)

Refer to the Common Props reference for full details and examples.

  1. Clarity first – Pick controls users recognise instantly (e.g., select vs radio).
  2. Validation – Prefer specialised types (email) that come with patterns.
  3. Mobile UX – Consider touch-friendly components (slider, date popovers).
  4. Accessibility – All @enlolab/forms components are ARIA-compliant; still provide labels.

Can’t find the field you need? Two options:

  1. Wrap an existing component using a field of type: "html" with custom React logic.
  2. Contribute—open a PR adding a new field renderer inside src/factory/fieldRenderers.tsx and update this guide.