AccueilComponentsNumberInput

NumberInput

Champ de saisie numérique, nu : il rend un nombre, et on le place dans un FormControl pour son libellé, son aide et sa validation.
ui
Default
tsx
export const Default = () => {
const [value, setValue] = useState<number | null>(null);
return (
<FormControl label="Montant">
<NumberInput value={value} onChange={setValue} placeholder="Quantité" />
</FormControl>
);
};
AvecUnites
€TTCtsx
export const AvecUnites = () => {
const [value, setValue] = useState<number | null>(null);
return (
<FormControl label="Avec unités">
<NumberInput
value={value}
onChange={setValue}
startAdornment={
<Box style={{ paddingLeft: Spacings['1W'], paddingRight: Spacings['1V'] }}>
<Typography>€</Typography>
</Box>
}
Desactive
tsx
export const Desactive = () => (
<FormControl label="Désactivé">
<NumberInput value={42} onChange={() => {}} disabled />
</FormControl>
);
Alveole UI Kit — v2.0.0-alpha.30