Skip to main content

Input

A reusable input component is a pure and predictable component that can be used across multiple applications. Here are some features of a reusable input component:

  1. Type: Specifies the type of input, such as "text", "number", "email", or "password"
  2. Label: The text for the input label
  3. Value: The current value of the input
  4. Error: An optional error message that is shown based on a condition

Variants

Props

PropsDatatypeExampleDefault value
valuestring"any value"""
labelTextstring"label"""
labelDescriptionstring"description"""
inputIdstring"123"""
inputPlaceholderstring"Enter name"""
isRequiredboolean"true" | "false"false
errorTextstring"Invalid Value"""
typestring"text""input"
invalidValueboolean"true" | "false"false
maxCharacternumber100100
onChangefunctionfunction from parent component
inputStylePropObjectfont-size: var(--base-text)""
inputClassPropObjectfont-size: var(--base-text)""
labelDescriptionClassPropObjectfont-size: var(--base-text)""
labelDescriptionStylePropObjectfont-size: var(--base-text)""
labelTextClassPropObjectfont-size: var(--base-text)""
labelTextStylePropObjectfont-size: var(--base-text)""