AccueilComponentsTextInput

TextInput

Champ de saisie texte, nu : on le place dans un FormControl pour son libellé, son aide et sa validation.
ui
Default
tsx
export const Default = () => (
<FormControl label="Nom">
<TextInput placeholder="Jean Dupont" />
</FormControl>
);
Email
tsx
export const Email = () => (
<FormControl label="Adresse email">
<TextInput type="email" placeholder="jean@exemple.fr" />
</FormControl>
);
Telephone
tsx
export const Telephone = () => (
<FormControl label="Téléphone">
<TextInput type="tel" placeholder="06 12 34 56 78" />
</FormControl>
);
MotDePasse
tsx
export const MotDePasse = () => (
<FormControl label="Mot de passe">
<TextInput type="password" placeholder="Votre mot de passe" />
</FormControl>
);
NonModifiable
tsx
export const NonModifiable = () => (
<FormControl label="Adresse email">
<TextInput type="email" value="jean@exemple.fr" editable={false} />
</FormControl>
);
Multiline
tsx
export const Multiline = () => (
<FormControl label="Message">
<TextInput placeholder="Votre message..." multiline numberOfLines={4} />
</FormControl>
);
MultilineWithModal
tsx
export const MultilineWithModal = () => {
const [text, setText] = useState('');
return (
<FormControl label="Description">
<TextInput
value={text}
onChangeText={setText}
placeholder="Taper pour ouvrir la modale de saisie..."
multiline
openModal
modalSubmitLabel="Confirmer"
/>
Alveole UI Kit — v2.0.0-alpha.30