Skip to content

Workshop sign-up

A workshop registration form: a session, a T-shirt size, dietary needs, a parking pass, and the talks the person plans to attend. Every answer is a choice from a fixed list or an on/off switch, so the form uses Signal’s Choice and Toggle controls, bound to document state. It declares no business object and works in any host with no wiring beyond page routing.

  • Pick a session. Register appears only once one is chosen.
  • Tick a few dietary needs and watch Session state: /signup/diet is a list of the ticked values, always in the options’ order.
  • Turn on I need a parking pass. The number plate field appears, marked required, and hides again when you turn it off.
  • Mark a talk as attending. Only that row’s attending field changes.
  • Register, then Change my answers: everything you chose is still there.
{
"state": {
"signup": {
"session": "",
"shirt": "",
"diet": [],
"parking": false,
"plate": ""
},
"talks": [
{
"id": "tokens",
"title": "Design tokens at scale",
"attending": false
},
{
"id": "a11y",
"title": "Accessible forms, start to finish",
"attending": false
},
{
"id": "motion",
"title": "Motion with restraint",
"attending": false
}
]
}
}

The session is a Choice with display: "radio". Its options are literal value/label pairs, and the bound path receives the chosen option’s value:

{
"session": {
"type": "Choice",
"props": {
"label": "Session",
"display": "radio",
"options": [
{
"value": "morning",
"label": "Morning, 9:00–12:00"
},
{
"value": "afternoon",
"label": "Afternoon, 13:00–16:00"
},
{
"value": "evening",
"label": "Evening, 18:00–21:00"
}
],
"required": true,
"helpText": null,
"value": {
"$bindState": "/signup/session"
}
},
"children": []
}
}

The T-shirt size is the same control with display: "select". A condition can compare a single choice with eq, which is how the confirmation page picks its line:

{
"shirt": {
"type": "Choice",
"props": {
"label": "T-shirt size",
"display": "select",
"options": [
{
"value": "XS",
"label": "XS"
},
{
"value": "S",
"label": "S"
},
{
"value": "M",
"label": "M"
},
{
"value": "L",
"label": "L"
},
{
"value": "XL",
"label": "XL"
}
],
"required": false,
"helpText": "Every attendee gets a workshop T-shirt.",
"value": {
"$bindState": "/signup/shirt"
}
},
"children": []
},
"done-morning": {
"type": "Text",
"props": {
"content": "See you in the morning session, from 9:00.",
"size": "md",
"tone": "default",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/session",
"eq": "morning"
}
}
}

display: "checkboxes" makes the value a list of option values:

{
"diet": {
"type": "Choice",
"props": {
"label": "Dietary needs",
"display": "checkboxes",
"options": [
{
"value": "vegetarian",
"label": "Vegetarian"
},
{
"value": "vegan",
"label": "Vegan"
},
{
"value": "gluten-free",
"label": "Gluten-free"
},
{
"value": "nut-allergy",
"label": "Nut allergy"
}
],
"required": false,
"helpText": "Tick all that apply.",
"value": {
"$bindState": "/signup/diet"
}
},
"children": []
}
}

A condition cannot look inside that list, so nothing in the form shows or hides by dietary need; the host would read the list from state.

The parking pass is a Toggle. Its true/false value decides whether the number plate Input shows and is marked required:

{
"parking": {
"type": "Toggle",
"props": {
"label": "I need a parking pass",
"required": false,
"helpText": null,
"value": {
"$bindState": "/signup/parking"
}
},
"children": []
},
"plate": {
"type": "Input",
"props": {
"label": "Number plate",
"placeholder": "AB12 CDE",
"inputType": "text",
"required": {
"$cond": {
"$state": "/signup/parking",
"eq": true
},
"$then": true,
"$else": false
},
"helpText": null,
"value": {
"$bindState": "/signup/plate"
}
},
"children": [],
"visible": {
"$state": "/signup/parking",
"eq": true
}
}
}

The talks are a local list rendered with repeat. Inside the template, the Toggle binds with $bindItem, so each row edits its own attending field:

{
"talk-list": {
"type": "Stack",
"props": {
"direction": "vertical",
"gap": "sm",
"align": "stretch",
"justify": "start",
"wrap": false,
"padding": "none",
"surface": null
},
"children": [
"talk-row"
],
"repeat": {
"statePath": "/talks",
"key": "id"
}
},
"talk-attending": {
"type": "Toggle",
"props": {
"label": "Attending",
"required": false,
"helpText": null,
"value": {
"$bindItem": "attending"
}
},
"children": []
}
}
Complete document — examples/documents/workshop-signup.json
examples/documents/workshop-signup.json
{
"envelopeVersion": 1,
"ui": {
"root": "app",
"elements": {
"app": {
"type": "PageStack",
"props": {
"name": "Workshop sign-up"
},
"children": [
"page-signup",
"page-done"
]
},
"page-signup": {
"type": "Page",
"props": {
"title": "Sign up",
"background": "mist"
},
"children": [
"signup-heading",
"signup-copy",
"details",
"talks-section",
"register-hint",
"register"
]
},
"signup-heading": {
"type": "Heading",
"props": {
"content": "Design systems workshop",
"level": "1",
"align": "left",
"accent": true
},
"children": []
},
"signup-copy": {
"type": "Text",
"props": {
"content": "A day of talks and hands-on sessions. Pick a session, tell us what you need, and choose the talks you want to attend.",
"size": "lg",
"tone": "muted",
"align": "left",
"italic": false
},
"children": []
},
"details": {
"type": "Section",
"props": {
"eyebrow": "YOUR DETAILS",
"title": null,
"tone": "outlined",
"padding": "lg"
},
"children": [
"session",
"shirt",
"diet",
"parking",
"plate",
"parking-note"
]
},
"session": {
"type": "Choice",
"props": {
"label": "Session",
"display": "radio",
"options": [
{
"value": "morning",
"label": "Morning, 9:00–12:00"
},
{
"value": "afternoon",
"label": "Afternoon, 13:00–16:00"
},
{
"value": "evening",
"label": "Evening, 18:00–21:00"
}
],
"required": true,
"helpText": null,
"value": {
"$bindState": "/signup/session"
}
},
"children": []
},
"shirt": {
"type": "Choice",
"props": {
"label": "T-shirt size",
"display": "select",
"options": [
{
"value": "XS",
"label": "XS"
},
{
"value": "S",
"label": "S"
},
{
"value": "M",
"label": "M"
},
{
"value": "L",
"label": "L"
},
{
"value": "XL",
"label": "XL"
}
],
"required": false,
"helpText": "Every attendee gets a workshop T-shirt.",
"value": {
"$bindState": "/signup/shirt"
}
},
"children": []
},
"diet": {
"type": "Choice",
"props": {
"label": "Dietary needs",
"display": "checkboxes",
"options": [
{
"value": "vegetarian",
"label": "Vegetarian"
},
{
"value": "vegan",
"label": "Vegan"
},
{
"value": "gluten-free",
"label": "Gluten-free"
},
{
"value": "nut-allergy",
"label": "Nut allergy"
}
],
"required": false,
"helpText": "Tick all that apply.",
"value": {
"$bindState": "/signup/diet"
}
},
"children": []
},
"parking": {
"type": "Toggle",
"props": {
"label": "I need a parking pass",
"required": false,
"helpText": null,
"value": {
"$bindState": "/signup/parking"
}
},
"children": []
},
"plate": {
"type": "Input",
"props": {
"label": "Number plate",
"placeholder": "AB12 CDE",
"inputType": "text",
"required": {
"$cond": {
"$state": "/signup/parking",
"eq": true
},
"$then": true,
"$else": false
},
"helpText": null,
"value": {
"$bindState": "/signup/plate"
}
},
"children": [],
"visible": {
"$state": "/signup/parking",
"eq": true
}
},
"parking-note": {
"type": "Text",
"props": {
"content": "The pass is emailed to you the day before.",
"size": "sm",
"tone": "muted",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/parking",
"eq": true
}
},
"talks-section": {
"type": "Section",
"props": {
"eyebrow": "TALKS",
"title": "Which talks will you attend?",
"tone": "outlined",
"padding": "lg"
},
"children": [
"talk-list"
]
},
"talk-list": {
"type": "Stack",
"props": {
"direction": "vertical",
"gap": "sm",
"align": "stretch",
"justify": "start",
"wrap": false,
"padding": "none",
"surface": null
},
"children": [
"talk-row"
],
"repeat": {
"statePath": "/talks",
"key": "id"
}
},
"talk-row": {
"type": "Stack",
"props": {
"direction": "horizontal",
"gap": "md",
"align": "center",
"justify": "between",
"wrap": true,
"padding": "sm",
"surface": "paper"
},
"children": [
"talk-title",
"talk-attending"
]
},
"talk-title": {
"type": "Text",
"props": {
"content": {
"$item": "title"
},
"size": "md",
"tone": "default",
"align": "left",
"italic": false
},
"children": []
},
"talk-attending": {
"type": "Toggle",
"props": {
"label": "Attending",
"required": false,
"helpText": null,
"value": {
"$bindItem": "attending"
}
},
"children": []
},
"register-hint": {
"type": "Text",
"props": {
"content": "Choose a session to register.",
"size": "sm",
"tone": "muted",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/session",
"not": true
}
},
"register": {
"type": "Button",
"props": {
"label": "Register",
"variant": "solid",
"size": "lg",
"disabled": false,
"fullWidth": false
},
"children": [],
"on": {
"press": {
"action": "goToPage",
"params": {
"page": "page-done"
}
}
},
"visible": {
"$state": "/signup/session"
}
},
"page-done": {
"type": "Page",
"props": {
"title": "Registered",
"background": "paper"
},
"children": [
"done-heading",
"done-morning",
"done-afternoon",
"done-evening",
"done-parking",
"done-back"
]
},
"done-heading": {
"type": "Heading",
"props": {
"content": "You're registered",
"level": "1",
"align": "left",
"accent": true
},
"children": []
},
"done-morning": {
"type": "Text",
"props": {
"content": "See you in the morning session, from 9:00.",
"size": "md",
"tone": "default",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/session",
"eq": "morning"
}
},
"done-afternoon": {
"type": "Text",
"props": {
"content": "See you in the afternoon session, from 13:00.",
"size": "md",
"tone": "default",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/session",
"eq": "afternoon"
}
},
"done-evening": {
"type": "Text",
"props": {
"content": "See you in the evening session, from 18:00.",
"size": "md",
"tone": "default",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/session",
"eq": "evening"
}
},
"done-parking": {
"type": "Text",
"props": {
"content": "Your parking pass is on its way.",
"size": "md",
"tone": "accent",
"align": "left",
"italic": false
},
"children": [],
"visible": {
"$state": "/signup/parking",
"eq": true
}
},
"done-back": {
"type": "Button",
"props": {
"label": "Change my answers",
"variant": "outline",
"size": "md",
"disabled": false,
"fullWidth": false
},
"children": [],
"on": {
"press": {
"action": "goToPage",
"params": {
"page": "page-signup"
}
}
}
}
},
"state": {
"signup": {
"session": "",
"shirt": "",
"diet": [],
"parking": false,
"plate": ""
},
"talks": [
{
"id": "tokens",
"title": "Design tokens at scale",
"attending": false
},
{
"id": "a11y",
"title": "Accessible forms, start to finish",
"attending": false
},
{
"id": "motion",
"title": "Motion with restraint",
"attending": false
}
]
}
},
"meta": {
"pack": {
"id": "mica.core",
"version": "1.0.0"
}
}
}