Matterway
    Preparing search index...

    Function phoneField

    • Phone input field component for phone number input with validation.

      Parameters

      • props: UiPhoneFieldProps

        Configuration object

        • name

          Name of the component

        • label

          Label text

        • placeholder

          Placeholder text

        • defaultValue

          Default value for the phone field

        • required

          If true, the field is required

        • disabled

          If true, the field is disabled

        • invalid

          If false/undefined the field is valid. If a string is provided, it will be used as the validation message

      Returns Element

      Basic usage with required props

      phoneField({
      name: 'phone',
      label: 'Phone Number'
      });

      Usage with placeholder and validation

      phoneField({
      name: 'contactNumber',
      label: 'Contact Number',
      placeholder: '+1 555 123 4567',
      required: true,
      invalid: 'Please enter a valid phone number'
      });

      Usage with default value

      phoneField({
      name: 'mobile',
      label: 'Mobile Phone',
      defaultValue: '+1234567890',
      placeholder: 'Enter your mobile number',
      required: true,
      disabled: false
      });