Sequence & SubSequence
Les composants Sequence et SubSequence permettent de démarrer une séquence de question et n'ont pour but de n'afficher que des informations textuelles à l'utilisateur (équivalent sémantique à des titres de premiers et second niveau).
- Source
- Data
{
"$schema": "../../../lunatic-schema.json",
"maxPage": "1",
"components": [
{
"id": "c1",
"componentType": "Sequence",
"page": "1",
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"label": {
"value": "\"Sequence example\"",
"type": "VTL|MD"
}
},
{
"id": "c2",
"componentType": "Subsequence",
"page": "1",
"conditionFilter": {
"value": "true",
"type": "VTL"
},
"label": {
"value": "\"Subsequence example\"",
"type": "VTL|MD"
}
}
],
"variables": []
}
{}
- 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...