Declaration - smbc-digital/form-builder GitHub Wiki
Refer to Stockport Design System for styling information and reference images
DSL properties
Property | Type | Required | Default Value | Description |
---|---|---|---|---|
QuestionId | string | ✔️ | ❌ | Unique question id allowed charatcers are [a-zA-Z] only |
Label | string | ✔️ | ❌ | Label associated with the search term |
Text | string | ✔️ | ❌ | Describes what the reason of the checkbox is |
Hint | string | ❌ | ❌ | Hint which appears above the declaration checkbox |
Optional | bool | ❌ | false | |
CustomValidationMessage | string | ❌ | ❌ | Set a custom validation message for when user does not check the declaration checkbox |
TargetMapping | string | ❌ | ❌ | Used for custom object mapping when creating submit data |
LegendAsH1 | bool | ❌ | false | Display the inputs label as a h1 and not a label (if this is set to true, HideTitle in the Page properties should also be set to true) |
HideLabel | bool | ❌ | false | Hide the label above the checkbox |
StrongLabel | bool | ❌ | true | Specifies if the label associated with the declaration is strong(fieldset-heading--m) |
SummaryLabel | string | ❌ | ❌ | Change the label associated with this input on the summary |
Declaration examples
DS Json for declaration
{
"Title": "Required Declaration",
"PageSlug": "page1",
"HideTitle": false,
"Elements": [
{
"Type": "Declaration",
"Properties": {
"Label": "Declaration",
"QuestionId": "Declaration",
"Text": "I agree to the terms and conditions",
"StrongLabel": false
}
}
]
}
All possible properties example:
{
"Type": "Declaration",
"Properties": {
"Label": "Declaration",
"LegendAsH1": true,
"QuestionId": "Declaration",
"Text": "I agree to the terms and conditions",
"Hint": "This is a required declaration",
"CustomValidationMessage": "You must agree to the terms and conditions",
"Optional": false,
"TargetMapping": "customer.Declaration",
"HideLabel": true,
"StrongLabel": false
}
}