Docs
API Reference
Number

Number

Render a number input. Extends Base.

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

Params

ParamExampleTypeStatus
typetype: "number""number"Required
minmin: 0number-
maxmax: 10number-

Required params

type

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

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

Optional params

min

Set the minimum numeric value to accept for the input field.

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

max

Set the maximum numeric value to accept for the input field.

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