Input properties

When you create inputs, these properties are injected for your convenience. You can access and use, but cannot modified properties that are locked . You can only modified unlocked ones .

Properties list

  • props use this to spread all input props including onChange . Check PROPS PROPERTIES to know more of it
  • data input data. Use it to store any useful extra data. This property is never reset
  • id input id
  • key a unique key
  • name input name
  • type html input type
  • label input label
  • value input value
  • files input upload files . Check FILES PROPERTIES to know more of it
  • accept input type file accept property string
  • checked input checked state boolean
  • multiple input property for multiple selection boolean
  • merge merge uploaded files instead of override boolean
  • valid input valid state boolean
  • touched input touched state boolean
  • placeholder input placeholder. Can be used to clear a select input.
  • errorMessage input general errorMessage
  • validating input asynchronous validation state boolean
  • validationFailed boolean
  • validation input validations Check VALIDATIONS PROPERTIES to know more of it.
  • onChange() a method to change input value. Accept InputEvent or customValue
  • afterChange() a method that run after a change. It receives an object with current value and current input
  • set() a method to set or update an input type, value or data. Use with caution
  • // Set some data
    input.set("data", My_Data)
    // Show some password
    input.set("type", "text")
    // Hide some password
    input.set("type", "password")
    // Set some value
    input.set("value", MY_VALUE)
    // Set blob or file while setting file input value
    input.set("value", MY_URL_OR_MY_ARRAY_OF_URL,async(url) => your file)
    Copied

Hit next to know more about spreadable input props PROPERTIES