Skip to content

Model Control

Model control allow user add object value

Usage

import { Model, Numeric, registerChaiBlock } from "@chaibuilder/blocks";
import GoogleMaps from "./GoogleMaps";
const YourBlock = ({ position }) => {
return <GoogleMaps position={position} />
}
registerChaiBlock(YourBlock, {
type: 'YourBlock',
label: 'Your Block',
category: 'Basic',
props: {
position: Model({
title: "Position",
default: { lat: 36.234, lng: 70.234 },
properties: {
lat: Numeric({ title: "Latitude" }),
lng: Numeric({ title: "Longitude" })
}
})
}
})

Arguments

  • default - Default value for control.
  • title - Title of control visible in Chai Builder block settings panel
  • binding - Binding flag for control. Default value is true. If false then control will not be visible in binding panel.