Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Input

A native input with labels, feedback, clear actions and visual variants.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sizes

From xs to xxl, like the Button.

Open preview

Variants

The semantic tone of the field.

Open preview

Appearances

Outline, soft, filled and glass.

Open preview

Usage

Use the appropriate HTML type and name. value with onValueChange controls the text and keeps the clear action synchronized.

errorMessage replaces helperText and marks the control invalid. className styles the input; containerClassName styles the field wrapper.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluInputProps

Type source
PimoluInputProps public API
NameTypeDefaultDescription
size"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined"md"Component size.
variant"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined"neutral"Variant exposed by this component.
appearance"soft" | "outline" | "glass" | "filled" | undefined"outline"Visual treatment of the control or surface.
labelstring | undefined—Visible label associated with the control.
helperTextstring | undefined—Supporting text below the field.
errorMessagestring | undefined—Error feedback replacing helper text and marking the field invalid.
invalidboolean | undefinedfalseExplicit invalid state.
startIconReactNode—Decorative content before the label or input.
endIconReactNode—Decorative content after the label or input.
fullWidthboolean | undefinedfalseUse the available width of the parent.
containerClassNamestring | undefined—Public Pimolu prop; see the source declaration for details.
clearableboolean | undefinedfalseShow an accessible clear button when the input is not empty.
clearLabelstring | undefined—Accessible label for the clear button.
onValueChange((value: string) => void) | undefined—Called whenever the input value changes, including clearing.
onClear(() => void) | undefined—Called after the clear action.
passwordToggleboolean | undefinedfalseEnables the password visibility button.
showPasswordLabelstring | undefined"Show password"Accessible label when password is hidden.
hidePasswordLabelstring | undefined"Hide password"Accessible label when password is visible.
startActionPimoluInputAction | undefined—Interactive button before the input control.
endActionPimoluInputAction | undefined—Interactive button after the input control.
onChangeChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLInputElement> | undefined—Standard React/HTML attribute.
disabledboolean | undefined—Standard React/HTML attribute.
namestring | undefined—Standard React/HTML attribute.
typeHTMLInputTypeAttribute | undefined"text"Standard React/HTML attribute.
valuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
requiredboolean | undefined—Standard React/HTML attribute.
size

"xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined

Default: "md"

Component size.

variant

"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined

Default: "neutral"

Variant exposed by this component.

appearance

"soft" | "outline" | "glass" | "filled" | undefined

Default: "outline"

Visual treatment of the control or surface.

label

string | undefined

No default extracted.

Visible label associated with the control.

helperText

string | undefined

No default extracted.

Supporting text below the field.

errorMessage

string | undefined

No default extracted.

Error feedback replacing helper text and marking the field invalid.

invalid

boolean | undefined

Default: false

Explicit invalid state.

startIcon

ReactNode

No default extracted.

Decorative content before the label or input.

endIcon

ReactNode

No default extracted.

Decorative content after the label or input.

fullWidth

boolean | undefined

Default: false

Use the available width of the parent.

containerClassName

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

clearable

boolean | undefined

Default: false

Show an accessible clear button when the input is not empty.

clearLabel

string | undefined

No default extracted.

Accessible label for the clear button.

onValueChange

((value: string) => void) | undefined

No default extracted.

Called whenever the input value changes, including clearing.

onClear

(() => void) | undefined

No default extracted.

Called after the clear action.

passwordToggle

boolean | undefined

Default: false

Enables the password visibility button.

showPasswordLabel

string | undefined

Default: "Show password"

Accessible label when password is hidden.

hidePasswordLabel

string | undefined

Default: "Hide password"

Accessible label when password is visible.

startAction

PimoluInputAction | undefined

No default extracted.

Interactive button before the input control.

endAction

PimoluInputAction | undefined

No default extracted.

Interactive button after the input control.

onChange

ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLInputElement> | undefined

No default extracted.

Standard React/HTML attribute.

disabled

boolean | undefined

No default extracted.

Standard React/HTML attribute.

name

string | undefined

No default extracted.

Standard React/HTML attribute.

type

HTMLInputTypeAttribute | undefined

Default: "text"

Standard React/HTML attribute.

value

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

required

boolean | undefined

No default extracted.

Standard React/HTML attribute.

PimoluInputAction

Type source
PimoluInputAction public API
NameTypeDefaultDescription
iconRequiredReactNode—Decorative icon displayed inside the button.
labelRequiredstring—Required accessible name.
onClickRequiredMouseEventHandler<HTMLButtonElement>—Called when the action is activated.
disabledboolean | undefined—Disables the action independently.
iconRequired

ReactNode

No default extracted.

Decorative icon displayed inside the button.

labelRequired

string

No default extracted.

Required accessible name.

onClickRequired

MouseEventHandler<HTMLButtonElement>

No default extracted.

Called when the action is activated.

disabled

boolean | undefined

No default extracted.

Disables the action independently.

Accessibility

  • A visible label is associated with the input automatically.
  • Helper/error text is connected through aria-describedby. Keep required and invalid feedback understandable without color.
Read the accessibility guide →