Number

Render a number input. Extends Base.

Interactive Demo
Example

Debug: Data

{"root":{"props":{}},"content":[{"type":"Example","props":{"myNumber":5,"id":"example"}}],"zones":{}}

Debug: UI

{"leftSideBarVisible":true,"rightSideBarVisible":true,"arrayState":{},"itemSelector":{"index":0},"componentList":{},"isDragging":false,"previewMode":"edit","viewports":{"current":{"width":360,"height":"auto"},"options":[],"controlsVisible":true},"field":{"focus":null}}

Debug: Other

  • Selected Item:
5
const config = {
  components: {
    Example: {
      fields: {
        myNumber: {
          type: "number",
        },
      },
      render: ({ myNumber }) => {
        return <div>{myNumber}</div>;
      },
    },
  },
};

Params

ParamExampleTypeStatus
typetype: "number"”number”Required
maxmax: 10number-
minmin: 0number-
placeholderplaceholder: "Lorem ipsum..."String-

Required params

type

The type of the field. Must be "number" for Number fields.

const config = {
  components: {
    Example: {
      fields: {
        myNumber: {
          type: "number",
        },
      },
      // ...
    },
  },
};

Optional params

max

The maximum numeric value allowed.

const config = {
  components: {
    Example: {
      fields: {
        myNumber: {
          type: "number",
          max: 10,
        },
      },
      // ...
    },
  },
};
Interactive Demo
Example

Debug: Data

{"root":{"props":{}},"content":[{"type":"Example","props":{"myNumber":5,"id":"example"}}],"zones":{}}

Debug: UI

{"leftSideBarVisible":true,"rightSideBarVisible":true,"arrayState":{},"itemSelector":{"index":0},"componentList":{},"isDragging":false,"previewMode":"edit","viewports":{"current":{"width":360,"height":"auto"},"options":[],"controlsVisible":true},"field":{"focus":null}}

Debug: Other

  • Selected Item:
5

min

The minimum numeric value allowed.

const config = {
  components: {
    Example: {
      fields: {
        myNumber: {
          type: "number",
          min: 0,
        },
      },
      // ...
    },
  },
};
Interactive Demo
Example

Debug: Data

{"root":{"props":{}},"content":[{"type":"Example","props":{"myNumber":5,"id":"example"}}],"zones":{}}

Debug: UI

{"leftSideBarVisible":true,"rightSideBarVisible":true,"arrayState":{},"itemSelector":{"index":0},"componentList":{},"isDragging":false,"previewMode":"edit","viewports":{"current":{"width":360,"height":"auto"},"options":[],"controlsVisible":true},"field":{"focus":null}}

Debug: Other

  • Selected Item:
5

Placeholder

The placeholder text to display when the field is empty.

const config = {
  components: {
    Example: {
      fields: {
        myNumber: {
          type: "number",
          placeholder: "Lorem ipsum...",
        },
      },
      // ...
    },
  },
};
Interactive Demo
Example

Debug: Data

{"root":{"props":{}},"content":[{"type":"Example","props":{"id":"example"}}],"zones":{}}

Debug: UI

{"leftSideBarVisible":true,"rightSideBarVisible":true,"arrayState":{},"itemSelector":{"index":0},"componentList":{},"isDragging":false,"previewMode":"edit","viewports":{"current":{"width":360,"height":"auto"},"options":[],"controlsVisible":true},"field":{"focus":null}}

Debug: Other

  • Selected Item:

step

The stepping interval when interacting with the field.

const config = {
  components: {
    Example: {
      fields: {
        myNumber: {
          type: "number",
          step: 0.1,
        },
      },
      // ...
    },
  },
};
Interactive Demo
Example

Debug: Data

{"root":{"props":{}},"content":[{"type":"Example","props":{"myNumber":5,"id":"example"}}],"zones":{}}

Debug: UI

{"leftSideBarVisible":true,"rightSideBarVisible":true,"arrayState":{},"itemSelector":{"index":0},"componentList":{},"isDragging":false,"previewMode":"edit","viewports":{"current":{"width":360,"height":"auto"},"options":[],"controlsVisible":true},"field":{"focus":null}}

Debug: Other

  • Selected Item:
5