Textarea
Le composant Textarea permet d'afficher un champ texte multiligne.
- maxLength, permet de définir la longueur maximale du texte (au niveau HTML seulement, un contrôle est nécessaire si on souhaite valider la longueur)
- Source
- Data
{
"components": [
{
"page": "1",
"id": "name",
"componentType": "Textarea",
"label": {
"value": "\"Label\"",
"type": "VTL|MD"
},
"description": {
"value": "\"Description\"",
"type": "VTL|MD"
},
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"maxLength": 30,
"response": {
"name": "SOMETHING"
}
}
],
"variables": [
{
"variableType": "COLLECTED",
"name": "SOMETHING",
"componentRef": "name",
"values": {
"PREVIOUS": null,
"COLLECTED": null,
"FORCED": null,
"EDITED": null,
"INPUTTED": null
}
}
]
}
{}
- Code
- Rendu
import {
type LunaticData,
type LunaticSource,
useLunatic,
LunaticComponents,
} from '@inseefr/lunatic';
import '@inseefr/lunatic/lib/main.css'
type Props = {
source: LunaticSource;
data: LunaticData;
};
export function FormRenderer({ source, data }: Props) {
const { getComponents, Provider } = useLunatic(source, data, {
initialPage: '1',
});
return (
<Provider>
<LunaticComponents components={getComponents()} />
</Provider>
);
}
Loading...