Widget View Node
Widget view node data structures.
Widget render functions return plain JavaScript objects called Widget view nodes.
Unsupported view types show a localized error message instead of rendering a blank widget.
Text
{
type: "text",
props: {
text: "Hello Widget",
padding: 12
}
}| Prop | Type | Description |
|---|---|---|
text | string | Text content. |
padding | number or edge object | Optional padding. |
Image
{
type: "image",
props: {
image: "image-token",
resizable: true,
scaledToFit: true,
padding: {
top: 12,
left: 12,
bottom: 12,
right: 12
}
}
}| Prop | Type | Description |
|---|---|---|
image | string | Internal image token. |
resizable | boolean | Allows the image to resize. |
scaledToFit | boolean | Scales the image to fit its bounds. |
scaledToFill | boolean | Scales the image to fill its bounds. |
padding | number or edge object | Optional padding. |
Padding
Padding can be a number or an edge object.
12{
top: 12,
left: 12,
bottom: 12,
right: 12
}How is this guide?
Last updated on