Skip to content Skip to sidebar Skip to footer

How Can I Set 'min' Attribute For A Textfield Type Date In Material Ui?

It seems it is possible to set the min attribution for Input type date. Is it also possible to set the min attribution for the Textfield type date in Material UI? Seems like the co

Solution 1:

You can pass min and max values using inputProps parameter:

      <TextField
        id="date"
        label="Date"
        type="date"
        defaultValue="2020-08-15"
        InputLabelProps={{
          shrink: true,
        }}
        inputProps={{
          min: "2020-08-10",
          max: "2020-08-20"
        }}
      />

Post a Comment for "How Can I Set 'min' Attribute For A Textfield Type Date In Material Ui?"