Skip to content

Input

Input components are used to collect user input, such as text, numbers, and other data. They are commonly used in forms, search bars, and other interactive elements.

This is an input field.
Loading Code Block...

To get started, install Butterfly DS via aqua:

Loading Code Block...
Loading Code Block...
default
This is an input field.
Loading Code Block...
default
This is an input field.
Loading Code Block...
default
input error
Loading Code Block...
info
This is an input field.
Loading Code Block...

PropsDefaultTypeDescription
variant-'default' | 'currency' | 'mobile-number' | 'select' | 'counter | 'search' | 'otp' | 'date' | 'rich-text-input'The variant of the input component.
label-stringLabel for the input component.
placeholder-stringPlaceholder text for the input field.
disabledfalsebooleanDisables the input component.
helperText-stringHelper text displayed below the input field.
helperTextIconTypeinfo'info' | 'warning'Icon type for the helper text.
errorfalsebooleanIndicates if the input has an error state.
requiredfalsebooleanIndicates if the input is required.
PropsDefaultTypeDescription
min100numberLowest number on the counter .
max1000numberHighest number on the counter.
value0numberCurrent value of the counter.
controlsPositioncenter'center' | 'right'Position of the character counter.
step1numberStep value for the counter.
PropsDefaultTypeDescription
currencyGHSstringCurrency code for the input.
endsWithZerosfalsebooleanIndicates if the currency input should end with zeros.
hint-stringHint text for the currency input tooltip.
PropsDefaultTypeDescription
countryCodeDisplayTypecountry-code'code' | 'flagType of mobile number input, either 'country-code' or 'flag'.
intlfalsebooleanIndicates if the mobile number input should support international formats.
PropsDefaultTypeDescription
modesingle'sigle' | 'range'Mode of the date input, either 'single' or 'range'.
placeholder-stringPlaceholder text for the date input.
allowPastDatefalsebooleanAllows selection of past dates.
minDate-stringMinimum date allowed for the input.
maxDate-stringMaximum date allowed for the input.
maxSelectableMonths3numberMaximum number of months that can be selected in the date input.
PropsDefaultTypeDescription
inputLength3numberLength of the OTP input.
hint-stringHint text for the OTP tooltip.
PropsDefaultTypeDescription
editorHeight100pxstringHeight of the rich text input editor.
PropsDefaultTypeDescription
rightIcon-ReactNodeShow right icon for the search input.
leftIcon-ReactNodeShow left icon for the search input.
PropsDefaultTypeDescription
options-Array<{ label: string, value: string }>Array of options for the select input.
multiplefalsebooleanAllows multiple selections.
showSearchfalsebooleanShows a search input within the select dropdown.
searchablefalsebooleanAllows searching within the select options.
clearablefalsebooleanAllows clearing the selected option.
icon
icon icon icon icon