-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponent.schema.json
More file actions
1505 lines (1459 loc) · 59.7 KB
/
component.schema.json
File metadata and controls
1505 lines (1459 loc) · 59.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://formspec.org/schemas/component/1.0",
"title": "Formspec Component Document",
"description": "A Formspec Component Document per the Component Specification v1.0. Defines a Tier 3 parallel presentation tree of UI components bound to a Formspec Definition's items via slot binding. The component tree controls layout and widget selection but cannot override core behavioral semantics (required, relevant, readonly, calculate, constraint) from the Definition. Multiple Component Documents MAY target the same Definition for platform-specific presentations.",
"type": "object",
"required": [
"$formspecComponent",
"version",
"targetDefinition",
"tree"
],
"patternProperties": {
"^x-": true
},
"additionalProperties": false,
"properties": {
"$formspecComponent": {
"type": "string",
"const": "1.0",
"description": "Component specification version. MUST be '1.0'.",
"examples": ["1.0"],
"x-lm": {
"critical": true,
"intent": "Version pin for component document compatibility."
}
},
"url": {
"type": "string",
"format": "uri",
"description": "Canonical URI identifier for this Component Document."
},
"name": {
"type": "string",
"description": "Machine-friendly short identifier."
},
"title": {
"type": "string",
"description": "Human-readable name."
},
"description": {
"type": "string",
"description": "Human-readable description."
},
"version": {
"type": "string",
"minLength": 1,
"description": "Version of this Component Document.",
"examples": ["1.0.0"],
"x-lm": {
"critical": true,
"intent": "Revision identifier for the component tree document."
}
},
"targetDefinition": {
"$ref": "#/$defs/TargetDefinition",
"description": "Binding to the target Formspec Definition and optional compatibility range.",
"examples": [
{ "url": "https://agency.gov/forms/budget", "compatibleVersions": ">=1.0.0 <2.0.0" }
],
"x-lm": {
"critical": true,
"intent": "Declares which definition this component tree is designed to render."
}
},
"breakpoints": {
"$ref": "#/$defs/Breakpoints",
"description": "Named viewport breakpoints for responsive prop overrides. Keys are breakpoint names; values are minimum viewport widths in pixels. Mobile-first cascade: base props apply to all widths, then overrides merge in ascending order.",
"examples": [
{ "sm": 576, "md": 768, "lg": 1024 }
]
},
"tokens": {
"$ref": "#/$defs/Tokens",
"description": "Flat key-value map of design tokens. Referenced in style objects and token-able props via $token.key syntax. Tier 3 tokens override Tier 2 theme tokens of the same key.",
"examples": [
{ "color.primary": "#0057B7", "spacing.md": "16px", "border.radius": "6px" }
]
},
"components": {
"type": "object",
"description": "Registry of custom component templates. Keys are PascalCase names (MUST NOT collide with built-in names). Each template has params and a tree that is instantiated with {param} interpolation.",
"patternProperties": {
"^[A-Z][a-zA-Z0-9]*$": {
"$ref": "#/$defs/CustomComponentDef"
}
},
"additionalProperties": false,
"examples": [
{
"LabeledField": {
"params": ["field", "label"],
"tree": {
"component": "Stack",
"gap": "$token.spacing.sm",
"children": [
{ "component": "Heading", "level": 4, "text": "{label}" },
{ "component": "TextInput", "bind": "{field}" }
]
}
}
}
]
},
"tree": {
"$ref": "#/$defs/AnyComponent",
"description": "Root component node of the presentation tree. MUST be a single component object (wrap multiple children in Stack or Page).",
"examples": [
{
"component": "Stack",
"children": [
{ "component": "TextInput", "bind": "name" }
]
}
],
"x-lm": {
"critical": true,
"intent": "Entry point for all component layout and binding declarations."
}
},
"extensions": {
"type": "object",
"propertyNames": { "pattern": "^x-" },
"description": "Document-level extension properties. All keys MUST be prefixed with 'x-'."
}
},
"$defs": {
"TargetDefinition": {
"type": "object",
"required": ["url"],
"additionalProperties": false,
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "Canonical URL of the target Definition (its url property)."
},
"compatibleVersions": {
"type": "string",
"description": "Semver range expression using node/npm-style range syntax describing which Definition versions this document supports. When absent, compatible with any version."
}
}
},
"Tokens": {
"type": "object",
"description": "Flat design token map. Keys are dot-delimited names (e.g. color.primary, spacing.md). Values are strings or numbers. Referenced via $token.key syntax. MUST NOT contain nested objects, arrays, booleans, or null.",
"additionalProperties": {
"oneOf": [
{ "type": "string" },
{ "type": "number" }
]
}
},
"Breakpoints": {
"type": "object",
"description": "Named viewport breakpoints. Keys are breakpoint names; values are minimum viewport widths in pixels (non-negative integers).",
"additionalProperties": {
"type": "integer",
"minimum": 0
}
},
"StyleMap": {
"type": "object",
"description": "Flat style map. Values MAY contain $token.path references (e.g. $token.color.primary). Not CSS — renderers map to platform equivalents.",
"additionalProperties": {
"oneOf": [
{ "type": "string" },
{ "type": "number" }
]
}
},
"AccessibilityBlock": {
"type": "object",
"description": "Accessibility overrides applied to the component's root element. Supplements or replaces renderer defaults.",
"additionalProperties": false,
"properties": {
"role": {
"type": "string",
"description": "ARIA role override (e.g. 'region', 'group', 'status'). Replaces renderer-default role."
},
"description": {
"type": "string",
"description": "Accessible description text. Renderers SHOULD wire to aria-describedby."
},
"liveRegion": {
"type": "string",
"enum": ["off", "polite", "assertive"],
"description": "Sets aria-live on root element. Renderers MUST NOT apply live-region semantics unless explicitly set."
}
}
},
"ResponsiveOverrides": {
"type": "object",
"description": "Breakpoint-keyed prop overrides. Keys are breakpoint names; values are objects of component-specific props to shallow-merge at that breakpoint. MUST NOT contain component, bind, when, children, or responsive.",
"additionalProperties": {
"type": "object"
}
},
"ChildrenArray": {
"type": "array",
"description": "Ordered list of child components. Renderers MUST preserve array order.",
"items": {
"$ref": "#/$defs/AnyComponent"
}
},
"CustomComponentDef": {
"type": "object",
"description": "A reusable component template. Instantiated by using the registry key as the component value and providing params. Templates MUST NOT reference themselves (directly or indirectly).",
"required": ["tree"],
"additionalProperties": false,
"properties": {
"params": {
"type": "array",
"items": { "type": "string" },
"description": "Parameter names accepted by this template. Each name MUST match [a-zA-Z][a-zA-Z0-9_]*. Referenced in allowed string props via {paramName} interpolation."
},
"tree": {
"$ref": "#/$defs/AnyComponent",
"description": "Component subtree instantiated when this custom component is used."
}
}
},
"ComponentBase": {
"type": "object",
"description": "Base properties shared by all component objects. Every component inherits these via $ref.",
"required": ["component"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-zA-Z][a-zA-Z0-9_\\-]*$",
"description": "Optional unique identifier for this node within the component tree. Used for locale string addressing ($component.<id>.prop), test selectors, and accessibility anchoring. When present, MUST be unique across the entire component tree document. Inside repeat templates (DataTable, Accordion), the id identifies the template node — all rendered instances share the same id."
},
"component": {
"type": "string",
"minLength": 1,
"description": "Component type name. MUST be a built-in name or a key in the components registry."
},
"when": {
"type": "string",
"description": "FEL boolean expression for conditional rendering. false/null hides the component and all children. Presentation-only — does NOT affect data (unlike Bind relevant which may clear data). When BOTH when and relevant apply: relevant=false always wins; when=false hides but preserves data."
},
"responsive": {
"$ref": "#/$defs/ResponsiveOverrides",
"description": "Breakpoint-keyed prop overrides for responsive design. Mobile-first cascade."
},
"style": {
"$ref": "#/$defs/StyleMap",
"description": "Flat style map. Values MAY contain $token.path references."
},
"accessibility": {
"$ref": "#/$defs/AccessibilityBlock",
"description": "Accessibility overrides for the component's root element."
},
"cssClass": {
"oneOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"description": "CSS class name(s) applied to root element. Additive to renderer-generated classes. Non-web renderers MAY ignore. Values MAY contain $token. references."
}
}
},
"AnyComponent": {
"type": "object",
"required": ["component"],
"properties": {
"component": { "type": "string", "minLength": 1 }
},
"oneOf": [
{ "$ref": "#/$defs/Page" },
{ "$ref": "#/$defs/Stack" },
{ "$ref": "#/$defs/Grid" },
{ "$ref": "#/$defs/Spacer" },
{ "$ref": "#/$defs/TextInput" },
{ "$ref": "#/$defs/NumberInput" },
{ "$ref": "#/$defs/DatePicker" },
{ "$ref": "#/$defs/Select" },
{ "$ref": "#/$defs/CheckboxGroup" },
{ "$ref": "#/$defs/Toggle" },
{ "$ref": "#/$defs/FileUpload" },
{ "$ref": "#/$defs/Heading" },
{ "$ref": "#/$defs/Text" },
{ "$ref": "#/$defs/Divider" },
{ "$ref": "#/$defs/Card" },
{ "$ref": "#/$defs/Collapsible" },
{ "$ref": "#/$defs/ConditionalGroup" },
{ "$ref": "#/$defs/Columns" },
{ "$ref": "#/$defs/Tabs" },
{ "$ref": "#/$defs/SubmitButton" },
{ "$ref": "#/$defs/Accordion" },
{ "$ref": "#/$defs/RadioGroup" },
{ "$ref": "#/$defs/MoneyInput" },
{ "$ref": "#/$defs/Slider" },
{ "$ref": "#/$defs/Rating" },
{ "$ref": "#/$defs/Signature" },
{ "$ref": "#/$defs/Alert" },
{ "$ref": "#/$defs/Badge" },
{ "$ref": "#/$defs/ProgressBar" },
{ "$ref": "#/$defs/Summary" },
{ "$ref": "#/$defs/ValidationSummary" },
{ "$ref": "#/$defs/DataTable" },
{ "$ref": "#/$defs/Panel" },
{ "$ref": "#/$defs/Modal" },
{ "$ref": "#/$defs/Popover" },
{ "$ref": "#/$defs/CustomComponentRef" }
]
},
"Page": {
"$ref": "#/$defs/ComponentBase",
"description": "Top-level page/section container. In a multi-step form, each Page is one step. Pages MAY also be used standalone within a Stack for sectioned single-page forms.",
"x-lm": {
"category": "layout",
"level": "core",
"children": true,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Page" },
"title": {
"type": "string",
"description": "Page heading displayed at the top of the section."
},
"description": {
"type": "string",
"description": "Subtitle or description text rendered below the title."
},
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Page",
"title": "Project Information",
"description": "Enter basic details about your project.",
"children": [
{ "component": "TextInput", "bind": "projectName" }
]
}
]
},
"Stack": {
"$ref": "#/$defs/ComponentBase",
"description": "Flexbox stacking container arranging children vertically or horizontally. The most common layout primitive — typically used as the root component.",
"x-lm": {
"category": "layout",
"level": "core",
"children": true,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Stack" },
"direction": {
"type": "string",
"enum": ["vertical", "horizontal"],
"default": "vertical",
"description": "Stack axis."
},
"gap": {
"oneOf": [{ "type": "string" }, { "type": "number" }],
"description": "Spacing between children. String for CSS values or $token refs, number for pixels."
},
"align": {
"type": "string",
"enum": ["start", "center", "end", "stretch"],
"description": "Cross-axis alignment."
},
"wrap": {
"type": "boolean",
"description": "Whether children wrap to new lines when direction is horizontal."
},
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Stack", "direction": "vertical", "gap": "$token.spacing.md",
"children": [
{ "component": "TextInput", "bind": "firstName" },
{ "component": "TextInput", "bind": "lastName" }
]
}
]
},
"Grid": {
"$ref": "#/$defs/ComponentBase",
"description": "Multi-column grid layout distributing children across columns in source order, wrapping to new rows as needed.",
"x-lm": {
"category": "layout",
"level": "core",
"children": true,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Grid" },
"columns": {
"oneOf": [{ "type": "string" }, { "type": "integer", "minimum": 1 }],
"description": "Column count (integer) or CSS grid-template-columns value (string, e.g. '1fr 2fr 1fr')."
},
"gap": {
"oneOf": [{ "type": "string" }, { "type": "number" }],
"description": "Spacing between grid cells."
},
"rowGap": {
"oneOf": [{ "type": "string" }, { "type": "number" }],
"description": "Vertical spacing between rows. Inherits gap if absent."
},
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Grid", "columns": 3, "gap": "$token.spacing.md",
"children": [
{ "component": "TextInput", "bind": "firstName" },
{ "component": "TextInput", "bind": "middleName" },
{ "component": "TextInput", "bind": "lastName" }
]
}
]
},
"Spacer": {
"$ref": "#/$defs/ComponentBase",
"description": "Empty spacing element inserting visual space between siblings. Leaf component — no children, no binding.",
"x-lm": {
"category": "layout",
"level": "core",
"children": false,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Spacer" },
"size": {
"oneOf": [{ "type": "string" }, { "type": "number" }],
"description": "Space amount. String for CSS/$token values, number for pixels."
}
},
"unevaluatedProperties": false,
"examples": [
{ "component": "Spacer", "size": "$token.spacing.lg" }
]
},
"TextInput": {
"$ref": "#/$defs/ComponentBase",
"description": "Single-line or multi-line text input. Default input for string-type fields. When maxLines > 1, renders as textarea.",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["string"]
},
"properties": {
"component": { "const": "TextInput" },
"bind": {
"type": "string",
"description": "Item key from the target Definition. Renderer inherits label, required, readonly, relevant, and validation."
},
"placeholder": {
"type": "string",
"description": "Placeholder text displayed when the field is empty."
},
"maxLines": {
"type": "integer",
"minimum": 1,
"default": 1,
"description": "Maximum visible lines. 1 = single-line input, >1 = multi-line textarea."
},
"inputMode": {
"type": "string",
"enum": ["text", "email", "tel", "url", "search"],
"description": "Input mode hint for virtual keyboards."
},
"prefix": {
"type": "string",
"description": "Static text rendered before the input (e.g. 'https://')."
},
"suffix": {
"type": "string",
"description": "Static text rendered after the input (e.g. '.com')."
},
"variant": {
"type": "string",
"enum": ["plain", "richtext", "markdown", "latex"],
"default": "plain",
"description": "Content-type variant. `plain` (default) accepts unstyled text. `richtext` accepts formatted text with runtime-defined serialization. `markdown` accepts Markdown source — portable, diffable, degrades gracefully. `latex` accepts LaTeX source — authoritative for math and scientific documents; degrades to raw source. All formatted variants (`richtext`, `markdown`, `latex`) MUST bind to a field whose `dataType` is `string` or `text`."
}
},
"unevaluatedProperties": false,
"examples": [
{ "component": "TextInput", "bind": "email", "placeholder": "you@example.com", "inputMode": "email" },
{ "component": "TextInput", "bind": "notes", "variant": "richtext", "maxLines": 8 }
]
},
"NumberInput": {
"$ref": "#/$defs/ComponentBase",
"description": "Numeric input with optional step controls. Suitable for integers, decimals, and monetary values (when paired with prefix/suffix).",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["integer", "number"]
},
"properties": {
"component": { "const": "NumberInput" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"placeholder": { "type": "string", "description": "Placeholder text displayed when the field is empty." },
"step": { "type": "number", "description": "Increment/decrement step value." },
"min": { "type": "number", "description": "Minimum allowed value." },
"max": { "type": "number", "description": "Maximum allowed value." },
"showStepper": { "type": "boolean", "description": "Whether to show increment/decrement buttons." },
"locale": { "type": "string", "description": "Locale for number formatting (e.g. 'en-US')." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "NumberInput", "bind": "quantity", "min": 1, "max": 100, "step": 1, "showStepper": true, "placeholder": "0" }
]
},
"DatePicker": {
"$ref": "#/$defs/ComponentBase",
"description": "Date, datetime, or time picker. Mode is automatically determined by the bound item's dataType (date → date picker, dateTime → date+time, time → time picker).",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["date", "dateTime", "time"]
},
"properties": {
"component": { "const": "DatePicker" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"placeholder": { "type": "string", "description": "Placeholder text displayed when the field is empty, when the host platform exposes placeholders for date/time controls." },
"format": { "type": "string", "description": "Display format hint (e.g. 'MM/DD/YYYY'). Does not affect stored value (always ISO 8601)." },
"minDate": { "type": "string", "description": "Earliest selectable date (ISO 8601)." },
"maxDate": { "type": "string", "description": "Latest selectable date (ISO 8601)." },
"showTime": { "type": "boolean", "description": "Whether to include time selection (relevant for dateTime)." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "DatePicker", "bind": "startDate", "format": "MM/DD/YYYY", "placeholder": "YYYY-MM-DD", "minDate": "2025-01-01" }
]
},
"Select": {
"$ref": "#/$defs/ComponentBase",
"description": "Dropdown selection control. Options are read from the bound item's options array or optionSet reference in the Definition.",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["choice", "multiChoice"]
},
"properties": {
"component": { "const": "Select" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"searchable": { "type": "boolean", "description": "Use a combobox (text input + listbox) with optional type-ahead filtering. When false and multiple is false, a native <select> is used." },
"multiple": { "type": "boolean", "description": "Allow multiple values (array). Bind to a multiChoice field. Implies a combobox list with checkboxes; combine with searchable for filtering." },
"placeholder": { "type": "string", "description": "Placeholder text when no option is selected." },
"clearable": { "type": "boolean", "description": "Whether the user can clear the selection to null." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "Select", "bind": "department", "searchable": true, "placeholder": "Choose a department" },
{ "component": "Select", "bind": "tags", "multiple": true, "searchable": true }
]
},
"CheckboxGroup": {
"$ref": "#/$defs/ComponentBase",
"description": "Group of checkboxes for multi-select fields. Options are read from the bound item's options or optionSet.",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["multiChoice"]
},
"properties": {
"component": { "const": "CheckboxGroup" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"columns": { "type": "integer", "minimum": 1, "description": "Number of columns to arrange checkboxes in." },
"selectAll": { "type": "boolean", "description": "Whether to display a 'Select All' control." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "CheckboxGroup", "bind": "interests", "columns": 2, "selectAll": true }
]
},
"Toggle": {
"$ref": "#/$defs/ComponentBase",
"description": "Boolean switch/toggle control for yes/no, on/off, or true/false fields.",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["boolean"]
},
"properties": {
"component": { "const": "Toggle" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"onLabel": { "type": "string", "description": "Label displayed when toggle is true." },
"offLabel": { "type": "string", "description": "Label displayed when toggle is false." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "Toggle", "bind": "agreeToTerms", "onLabel": "I agree", "offLabel": "I do not agree" }
]
},
"FileUpload": {
"$ref": "#/$defs/ComponentBase",
"description": "File upload control for attachment-type fields. Supports single or multiple file selection with optional type and size constraints.",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "core",
"children": false,
"bind": "required",
"compatibleDataTypes": ["attachment"]
},
"properties": {
"component": { "const": "FileUpload" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"accept": { "type": "string", "description": "Accepted MIME types (comma-separated, e.g. 'image/*,application/pdf')." },
"maxSize": { "type": "integer", "description": "Maximum file size in bytes." },
"multiple": { "type": "boolean", "description": "Whether multiple files may be uploaded." },
"dragDrop": { "type": "boolean", "description": "Whether to display a drag-and-drop zone." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "FileUpload", "bind": "supportingDocs", "accept": "application/pdf,image/*", "maxSize": 10485760, "multiple": true }
]
},
"Heading": {
"$ref": "#/$defs/ComponentBase",
"description": "Section heading element for visual hierarchy. Purely presentational — does not bind to data.",
"required": ["component", "level", "text"],
"x-lm": {
"category": "display",
"level": "core",
"children": false,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Heading" },
"level": {
"type": "integer",
"minimum": 1,
"maximum": 6,
"description": "Heading level 1–6. Corresponds to HTML <h1>–<h6> semantics."
},
"text": {
"type": "string",
"description": "Heading text content."
}
},
"unevaluatedProperties": false,
"examples": [
{ "component": "Heading", "level": 2, "text": "Budget Details" }
]
},
"Text": {
"$ref": "#/$defs/ComponentBase",
"description": "Static or data-bound text block. When bind is present, displays the bound item's current value as read-only. When absent, displays the static text prop.",
"x-lm": {
"category": "display",
"level": "core",
"children": false,
"bind": "optional"
},
"properties": {
"component": { "const": "Text" },
"bind": { "type": "string", "description": "Item key. When present, displays the bound item's formatted value (read-only)." },
"text": { "type": "string", "description": "Static text content. Ignored when bind is present." },
"format": {
"type": "string",
"enum": ["plain", "markdown"],
"description": "Text format. 'markdown' enables basic Markdown rendering (bold, italic, links, lists). Renderers MUST sanitize to prevent script injection."
}
},
"unevaluatedProperties": false,
"examples": [
{ "component": "Text", "text": "Please review before submitting.", "format": "markdown" },
{ "component": "Text", "bind": "totalBudget" }
]
},
"Divider": {
"$ref": "#/$defs/ComponentBase",
"description": "Horizontal rule separating sections of the form.",
"x-lm": {
"category": "display",
"level": "core",
"children": false,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Divider" },
"label": { "type": "string", "description": "Optional label text centered on the divider line." }
},
"unevaluatedProperties": false,
"examples": [
{ "component": "Divider", "label": "Section Break" }
]
},
"Card": {
"$ref": "#/$defs/ComponentBase",
"description": "Bordered surface that visually groups related content with optional header.",
"x-lm": {
"category": "container",
"level": "core",
"children": true,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Card" },
"title": { "type": "string", "description": "Card header title." },
"subtitle": { "type": "string", "description": "Card header subtitle, rendered below the title." },
"elevation": { "type": "integer", "minimum": 0, "description": "Shadow depth level." },
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Card", "title": "Contact Information",
"children": [
{ "component": "TextInput", "bind": "email" },
{ "component": "TextInput", "bind": "phone" }
]
}
]
},
"Collapsible": {
"$ref": "#/$defs/ComponentBase",
"description": "Expandable/collapsible section. User toggles child visibility via clickable header. Collapsed children stay in DOM — bound data is preserved.",
"required": ["component", "title"],
"x-lm": {
"category": "container",
"level": "core",
"children": true,
"bind": "forbidden"
},
"properties": {
"component": { "const": "Collapsible" },
"title": { "type": "string", "description": "Collapsible section header. Visible regardless of open/closed state." },
"defaultOpen": { "type": "boolean", "description": "Whether the section is initially expanded." },
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Collapsible", "title": "Advanced Options", "defaultOpen": false,
"children": [
{ "component": "Toggle", "bind": "enableNotifications" }
]
}
]
},
"ConditionalGroup": {
"$ref": "#/$defs/ComponentBase",
"description": "Container whose visibility is controlled by a REQUIRED when expression. Exists solely to conditionally show/hide a group of children. Data-bound children retain values when hidden (unlike Bind relevant).",
"required": ["component", "when"],
"x-lm": {
"category": "container",
"level": "core",
"children": true,
"bind": "forbidden"
},
"properties": {
"component": { "const": "ConditionalGroup" },
"fallback": { "type": "string", "description": "Text displayed when the condition is false." },
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "ConditionalGroup",
"when": "$hasEmployer = true",
"fallback": "Employer details not required for this application type.",
"children": [
{ "component": "TextInput", "bind": "employerName" }
]
}
]
},
"Columns": {
"$ref": "#/$defs/ComponentBase",
"description": "Explicit multi-column layout with per-child column widths. Unlike Grid which auto-distributes into equal cells, Columns gives precise per-column sizing.",
"x-lm": {
"category": "layout",
"level": "progressive",
"children": true,
"bind": "forbidden",
"fallback": "Grid",
"fallbackNotes": "columns set to child count; gap preserved."
},
"properties": {
"component": { "const": "Columns" },
"widths": {
"type": "array",
"items": { "oneOf": [{ "type": "string" }, { "type": "number" }] },
"description": "Per-child column widths as CSS values (e.g. ['1fr', '2fr', '1fr']). Array length SHOULD match child count."
},
"gap": {
"oneOf": [{ "type": "string" }, { "type": "number" }],
"description": "Spacing between columns."
},
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Columns", "widths": ["2fr", "1fr"], "gap": "$token.spacing.md",
"children": [
{ "component": "TextInput", "bind": "address" },
{ "component": "TextInput", "bind": "zipCode" }
]
}
]
},
"Tabs": {
"$ref": "#/$defs/ComponentBase",
"description": "Tabbed navigation container. Each child is one tab's content. Tab labels from child Page titles or tabLabels array. All children stay mounted — switching changes visibility, not lifecycle.",
"x-lm": {
"category": "layout",
"level": "progressive",
"children": true,
"bind": "forbidden",
"fallback": "Stack",
"fallbackNotes": "Each child preceded by a Heading (level 3) with tab label. All children rendered visibly."
},
"properties": {
"component": { "const": "Tabs" },
"position": {
"type": "string",
"enum": ["top", "bottom", "left", "right"],
"default": "top",
"description": "Tab bar position."
},
"tabLabels": {
"type": "array",
"items": { "type": "string" },
"description": "Explicit tab labels. When absent, reads title from each child Page."
},
"defaultTab": {
"type": "integer",
"minimum": 0,
"description": "Zero-based index of the initially active tab."
},
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Tabs", "tabLabels": ["Personal", "Employment"],
"children": [
{ "component": "Stack", "children": [{ "component": "TextInput", "bind": "firstName" }] },
{ "component": "Stack", "children": [{ "component": "TextInput", "bind": "employer" }] }
]
}
]
},
"SubmitButton": {
"$ref": "#/$defs/ComponentBase",
"description": "Button that triggers renderer submission. Calls the host renderer's submit API and can optionally emit the formspec-submit event.",
"x-lm": {
"category": "display",
"level": "core",
"children": false,
"bind": "forbidden"
},
"properties": {
"component": { "const": "SubmitButton" },
"label": {
"type": "string",
"description": "Button label text."
},
"mode": {
"type": "string",
"enum": ["continuous", "submit"],
"description": "Validation mode used for response/report generation when clicked."
},
"emitEvent": {
"type": "boolean",
"description": "Whether clicking the button dispatches the formspec-submit CustomEvent."
},
"pendingLabel": {
"type": "string",
"description": "Label text shown while shared submit pending state is true."
},
"disableWhenPending": {
"type": "boolean",
"default": true,
"description": "Whether the button is disabled while shared submit pending state is true."
}
},
"unevaluatedProperties": false,
"examples": [
{ "component": "SubmitButton", "label": "Submit Application", "mode": "submit", "emitEvent": true, "pendingLabel": "Submitting…" }
]
},
"Accordion": {
"$ref": "#/$defs/ComponentBase",
"description": "Vertical list of collapsible sections. By default only one expanded at a time. Children SHOULD have title props (Page, Card, Collapsible) for section headers.",
"x-lm": {
"category": "layout",
"level": "progressive",
"children": true,
"bind": "optional",
"fallback": "Stack",
"fallbackNotes": "Each child wrapped in Collapsible. First defaults open; rest closed."
},
"properties": {
"component": { "const": "Accordion" },
"bind": {
"type": "string",
"description": "Optional bind path to a repeating group. When provided, each instance becomes one accordion section."
},
"allowMultiple": {
"type": "boolean",
"description": "Whether multiple sections may be expanded simultaneously. When false, expanding one collapses others."
},
"defaultOpen": {
"type": "integer",
"minimum": 0,
"description": "Zero-based index of the initially expanded section."
},
"labels": {
"type": "array",
"items": { "type": "string" },
"description": "Section header labels. labels[i] is the summary text for children[i]. Falls back to 'Section {i+1}' when absent."
},
"children": { "$ref": "#/$defs/ChildrenArray" }
},
"unevaluatedProperties": false,
"examples": [
{
"component": "Accordion", "allowMultiple": false,
"children": [
{ "component": "Page", "title": "Section A", "children": [{ "component": "TextInput", "bind": "fieldA" }] },
{ "component": "Page", "title": "Section B", "children": [{ "component": "TextInput", "bind": "fieldB" }] }
]
}
]
},
"RadioGroup": {
"$ref": "#/$defs/ComponentBase",
"description": "Radio buttons for single-select choice fields. All options visible simultaneously — suitable for short lists (typically ≤7 items).",
"required": ["component", "bind"],
"x-lm": {
"category": "input",
"level": "progressive",
"children": false,
"bind": "required",
"compatibleDataTypes": ["choice"],
"fallback": "Select",
"fallbackNotes": "columns discarded."
},
"properties": {
"component": { "const": "RadioGroup" },
"bind": { "type": "string", "description": "Item key from the target Definition." },
"columns": { "type": "integer", "minimum": 1, "description": "Number of columns to arrange radio buttons in." },
"orientation": {
"type": "string",