Forms

Text Input

Text inputs enable seamless data entry and editing, offering clear, interactive fields for a more efficient and user-friendly experience.

AA

WCAG 2.1 accessibility compliant

Default

Label

Supplementary information

Label

Supplementary information

Populated

Label

Placeholder text

Supplementary information

Active

Label

Supplementary information

Active / User typing

Label

User typing

Supplementary information

Error

Label

User has entered text

Supplementary information

Disabled

Label

Supplementary information

React Native

<View style={{ width: '100%', maxWidth: 393 }}>
  <Label
    style={{
      fontFamily: 'Inter-SemiBold',
      paddingBottom: 8,
      paddingLeft: 2,
    }}
    nativeID='inputLabel'
    onPress={handleOnLabelPress}
    accessibilityRole="text"
  >
    Enter email
  </Label>
  <Input
    ref={inputRef}
    placeholder='Enter your email'
    value={value}
    onChangeText={onChangeText}
    onSubmitEditing={onSubmitEditing}
    onFocus={() => setIsFocused(true)}
    onBlur={() => setIsFocused(false)}
    aria-labelledby='inputLabel'
    aria-errormessage='inputError'
    accessibilityRole="textbox"
    accessibilityLabel="Email input field"
    accessibilityHint="Enter your email address here"
    accessibilityState={{
      disabled: false,
      required: true, // Assuming this field is required
      invalid: inputState === 'error'
    }}
    style={{ fontFamily: 'Inter' }}
    className={cn(
      inputState === 'error' &&
        'border-sys-border-error border-2 bg-sys-fn-error text-sys-text-body placeholder:text-sys-error',
      inputState === 'active' &&
        'border-sys-border-6 border-2 bg-sys-surface-secondary-pressed text-sys-text-body placeholder:text-sys-text-secondary'
    )}
  />
  {err && (
    <View 
      nativeID='inputError'
      accessibilityRole="alert"
      accessibilityLiveRegion="assertive"
    >
      <ErrorMessage msg={err} />
    </View>
  )}
  <View style={{ height: 80 }} />
</View>

WCAG 2.1 accessibility checks

1.3.1 Info and Relationships (Level A)

1.4.3 Contrast (Minimum) (Level AA)

2.4.6 Headings and Labels (Level AA)

4.1.2 Name, Role, Value (Level A)

4.1.3 Status Messages (Level AA)

Mobile App Starter Kit

·

©

2025

All rights reserved, Studio Hola.

Mobile App Starter Kit

·

©

2025

All rights reserved, Studio Hola.

Mobile App Starter Kit

·

©

2025

All rights reserved, Studio Hola.