Formulaires v1.0.0

Champ numérique

Champ numérique avec boutons d'incrémentation/décrémentation, contraintes min/max et pas de progression. Offre une meilleure expérience que les champs numériques natifs avec un style cohérent entre navigateurs. Prend en charge le texte préfixe/suffixe, plusieurs tailles, les états d'erreur et la répétition en maintien sur les boutons.

Aperçu et code

Options

Nom Type Par défaut Description
value Integer/Float nil Initial numeric value
min Integer/Float nil Minimum allowed value
max Integer/Float nil Maximum allowed value
step Integer/Float 1 Increment/decrement step size
label String nil Label text displayed above the input
hint String nil Hint text displayed below the input
size Symbol :md Input size: :sm, :md, or :lg
prefix String nil Prefix text displayed inside the input (e.g. "$")
suffix String nil Suffix text displayed inside the input (e.g. "kg")
disabled Boolean false Whether the input is disabled
error String nil Error message — turns the border red and displays below the input
name String nil Form field name attribute
placeholder String nil Placeholder text shown when empty

Journal des modifications v1.0.0

- v1.0.0: Initial release with increment/decrement buttons, min/max/step support
- Hold-to-repeat on increment/decrement buttons (400ms delay, 75ms repeat)
- Keyboard arrow-key support (ArrowUp/ArrowDown)
- Prefix/suffix text, multiple sizes, error states, and disabled state
- Full 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