Formulaires v1.0.0

Groupe de champs

Un champ de texte avec des compléments optionnels en préfixe et suffixe pour icônes, texte ou boutons. Prend en charge le mode form builder (avec les objets formulaire Rails) et l'utilisation autonome. Les compléments peuvent être en ligne (à l'intérieur du champ) ou en style addon (bloc visuel séparé).

Aperçu et code

Options

Nom Type Par défaut Description
form FormBuilder nil Rails form builder object (for form builder mode)
attribute Symbol nil Model attribute name (for form builder mode)
name String nil Input name attribute (for standalone mode)
value String nil Input value (for standalone mode)
label String nil Label text (auto-generated from attribute if not provided)
hint String nil Help text displayed below the input
type String "text" Input type: text, email, password, tel, url, number
placeholder String nil Placeholder text
prefix String nil Text or HTML to display before the input (inline style)
suffix String nil Text or HTML to display after the input (inline style)
leading_addon String nil Text for a leading addon block (e.g., "https://")
trailing_addon String nil Text for a trailing addon block (e.g., ".com")
required Boolean false Whether the field is required
disabled Boolean false Whether the field is disabled
error String nil Manual error message (auto-detected from form object if not provided)
class String "" Additional CSS classes for the input

Journal des modifications v1.0.0

- Initial release with form builder and standalone modes
- Inline prefix/suffix support (icons, text)
- Addon block support (leading_addon, trailing_addon)
- ViewComponent slots for custom addon content
- Automatic error detection from Rails form objects
- Dark mode support

Obtenir l'accès complet

Débloquez le code source de ce composant et de tous les autres. Paiement unique pour un accès à vie.

Obtenir l'accès maintenant