Advanced

Register your own brick

A star-rating brick registered at runtime with registerBrick, validated and rendered like any built-in.

Loading the builder…

View the spec
{
  "type": "panel",
  "id": "column",
  "name": "Form",
  "configs": {
    "key": "rating"
  },
  "children": [
    {
      "type": "input",
      "dataType": "string",
      "id": "text",
      "name": "Name",
      "configs": {
        "key": "name",
        "label": "Your name"
      }
    },
    {
      "type": "input",
      "dataType": "number",
      "id": "rating",
      "name": "Rating",
      "configs": {
        "key": "rating",
        "label": "How was it?"
      },
      "validations": [
        {
          "validator": "required"
        },
        {
          "validator": "min",
          "value": 3,
          "message": "We aim for at least 3 stars 😉"
        }
      ]
    }
  ]
}