Skip to content

Inputs

Text entry components for forms — covering text, email, password, amount, phone, pin, and number inputs.

Open in Storybook

TextInput — Interactive Demo

Email Address

Input Variants

The design system provides specialized input components:

ComponentPurpose
TextInputGeneral text, email, password entry
AmountInputCurrency amount entry with formatting
PhoneInputPhone number with country code
PinInputMulti-digit code entry
NumberInputNumeric-only input with increment/decrement

TextInput Usage

vue
<script setup>
import { ref } from 'vue';
import { TextInput } from '@yellowcard/b2b-design-system';

const email = ref('');
</script>

<template>
  <TextInput
    v-model="email"
    variant="email"
    label="Email"
    placeholder="you@example.com"
    :required="true"
  />
</template>

States

Input states

Default
With Value
With Error
This field is required
Disabled
Readonly

API Reference — TextInput

Props

PropTypeDefaultDescription
modelValuestring''Input value (v-model)
variant'text' | 'password' | 'email''text'Input type
size'large' | 'small''large'Input size
labelstring''Label text above the input
placeholderstring'Your text here'Placeholder text
helperTextstring''Help text below the input
errorMessagestring''Error message (shows error state when set)
disabledbooleanfalseDisabled state
readonlybooleanfalseRead-only state
requiredbooleanfalseShows required indicator
skeletonbooleanfalseSkeleton loading state
showTrailingIconbooleanfalseShow icon on the right
showLeadingIconbooleanfalseShow icon on the left

Events

EventPayloadDescription
update:modelValuestringEmitted when value changes
focusFocusEventEmitted on input focus
blurFocusEventEmitted on input blur
inputstringEmitted on every keystroke
keydownKeyboardEventEmitted on keydown
trailing-icon-clickEmitted when trailing icon is clicked
leading-icon-clickEmitted when leading icon is clicked