JsonObject
Create a JSON Object. An object can be created by providing a JS object value which will be serialized to JSON. Else, you can provide children that comprise the object’s JSON representation.
Overload 1
Create a JSON object by providing children that define the object’s contents. The children should use the JsonObjectProperty component to define individual object properties.
import { JsonObject } from "@alloy-js/json";
<JsonObject refkey={Refkey | Refkey[]} style={{ concise?: boolean; }}> {children}</JsonObject>
import { JsonObject } from "@alloy-js/json/stc";
JsonObject({ refkey: Refkey | Refkey[], style: { concise?: boolean; },}).children(children)
Props
children | Children The contents of the JSON object. Likely to contain JsonObjectProperty components. |
refkey | optionalRefkey | Refkey[] The refkey or array of refkeys for the JSON object. When provided, this value can be referenced elsewhere via this refkey. |
style | optional{
concise?: boolean;
} |
Overload 2
Create a JSON object by providing a JS value that will be serialized to JSON.
import { JsonObject } from "@alloy-js/json";
<JsonObject jsValue={[string, unknown][] | Map<string, unknown> | Record<string, unknown>} refkey={Refkey | Refkey[]} style={{ concise?: boolean; }} />
import { JsonObject } from "@alloy-js/json/stc";
JsonObject({ jsValue: [string, unknown][] | Map<string, unknown> | Record<string, unknown>, refkey: Refkey | Refkey[], style: { concise?: boolean; },}).children(children)
Props
jsValue | [string, unknown][] | Map<string, unknown> | Record<string, unknown> The JS value to serialize to JSON. This can be an array of key-value pairs, a map, or a vanilla JS object. |
refkey | optionalRefkey | Refkey[] The refkey or array of refkeys for the JSON object. When provided, this value can be referenced elsewhere via this refkey. |
style | optional{
concise?: boolean;
} |
See also
- [unresolved link]