Skip to Content
Nextra 4.0 is released 🎉

TextInput

The TextInput component provides a pixel-art styled single-line input for entering text, numbers, emails, and other form values.
It supports labels, error states, helper text, custom colors, and multiple styling variations to match the retro visual language of PixelartUI.
Perfect for forms, search bars, and data entry fields, the TextInput delivers a clean and nostalgic user experience with full flexibility.


Basic Example


<TextInput inputName="name" textLabel="Name" type="main" />

Text area types


<TextInput inputName="name" textLabel="Name" type="main" /> <TextInput inputName="name" textLabel="Name" type="inline" />

Text area custom size


<TextInput inputName="name" textLabel="Name" type="main" width="400px" height="200px" />

Text area fullwidth


<TextInput inputName="name" textLabel="Name" type="main" fullwidth />

Text area placeholder


<TextInput inputName="name" textLabel="Name" type="main" placeholder="The placeholder" />

Text area no label


<TextInput inputName="name" textLabel="Name" type="main" noLabel />

Text area error


<TextInput inputName="name" textLabel="Name" type="main" error />

Text area helper text


help
<TextInput inputName="name" textLabel="Name" type="main" helperText="help" />

Text area disabled


<TextInput inputName="name" textLabel="Name" type="main" disabled />

Text area custom color


<TextInput inputName="name" textLabel="Name" type="main" backgroundColor="#b13737" />

Text area styles


help
help
<TextInput inputName="name" textLabel="Name" type="main" textAreaStyle="dark" /> <TextInput inputName="name" textLabel="Name" type="inline" textAreaStyle="light" />

đź”§ Props

PropTypeDefaultDescription
inputNamestring—A unique name identifier for the TextInput field.
typeInputType—Defines the input type (e.g., text, number, password).
textLabelstringundefinedLabel text displayed above the input.
placeholderstringundefinedPlaceholder text shown when the input is empty.
backgroundColorstringundefinedSets a custom background color for the input.
noLabelbooleanfalseHides the label when set to true.
errorbooleanfalseDisplays the input in an error state.
helperTextstringundefinedDisplays helper or validation text beneath the input.
disabledbooleanfalseDisables the input and visually indicates inactivity.
valuestringundefinedControlled value of the input.
classNamestringundefinedAdds additional CSS classes for custom styling.
inputStyleInputStyleundefinedApplies a predefined PixelartUI style to the TextInput.
widthstringundefinedSets a custom width (e.g., "250px", "100%").
heightstringundefinedSets a custom height for the input.
fullwidthbooleanfalseExpands the input to fill the width of its container.
onChange(event: React.ChangeEvent<HTMLInputElement>) => voidundefinedCallback fired when the input value changes.
Last updated on