@hmiproject/helio-sdk
    Preparing search index...

    Function Object

    Declares a prop that groups a set of nested props into a single object value.

    In the IDE the object is rendered as its own top-level group next to the other groups; an optional object also gets a checkbox to enable or disable it as a whole. Objects can also serve as structured list items.

    For purely visual grouping of independent props, use propsGroups (see createElement) instead.

    Declaring an object property

    {
    position: props.Object({
    label: 'Position',
    optional: false,
    shape: {
    x: props.Number({ label: 'X', optional: false, defaultValue: 0 }),
    y: props.Number({ label: 'Y', optional: false, defaultValue: 0 }),
    },
    }),
    }
    • Optional Object Property

      Type Parameters

      Parameters

      • options: Omit<ConditionalTypeOptions, "enabledIf"> & {
            description?: string;
            label: string;
            shape: Shape;
        } & { defaultValue?: Values<Shape>; optional: true }
        • Optionaldescription?: string

          An optional description that will be displayed below the property in the editor to help users understand the purpose of this property.

        • label: string

          Human-readable label for this property. Will be used to represent this property in the UI.

        • shape: Shape

          The schema of the properties nested inside this object. Declare it just like a top-level schema, using the same props.* helpers.

          {
          x: props.Number({
          label: 'X', optional: false, defaultValue: 0
          }),
          y: props.Number({
          label: 'Y', optional: false, defaultValue: 0
          }),
          }
        • OptionaldefaultValue?: Values<Shape>

          The default value for this property. When omitted, the property defaults to undefined and the object is disabled in the editor until it is enabled explicitly.

        • optional: true

          Mark this as an optional value that can also take the value undefined.

      Returns ObjectDef<Shape> & {
          defaultValue: Values<Shape> | undefined;
          optional: true;
          type: Values<Shape> | undefined;
      }

    • Non-Optional Object Property

      Type Parameters

      Parameters

      • options: Omit<ConditionalTypeOptions, "enabledIf"> & {
            description?: string;
            label: string;
            shape: Shape;
        } & { defaultValue?: Values<Shape>; optional: false }
        • Optionaldescription?: string

          An optional description that will be displayed below the property in the editor to help users understand the purpose of this property.

        • label: string

          Human-readable label for this property. Will be used to represent this property in the UI.

        • shape: Shape

          The schema of the properties nested inside this object. Declare it just like a top-level schema, using the same props.* helpers.

          {
          x: props.Number({
          label: 'X', optional: false, defaultValue: 0
          }),
          y: props.Number({
          label: 'Y', optional: false, defaultValue: 0
          }),
          }
        • OptionaldefaultValue?: Values<Shape>

          The default value for this property. When omitted, it is composed from the defaults of the nested props.

        • optional: false

          Mark this as an optional value that can also take the value undefined.

      Returns ObjectDef<Shape> & {
          defaultValue: Values<Shape>;
          optional: false;
          type: Values<Shape>;
      }