Input

A basic field where users can type text or numbers.

PropTypeDescription
namestringHTML name attribute
onChange(event: ChangeEvent<HTMLTextAreaElement>) => voidonChane property
type?"tel" | "email"Phone number or email type
placeholder?stringPlaceholder text in the input
label?stringLabel assosiated with the input
value?"string" | "number"Actual value of the input
className?stringSets class attribute
error?stringError message
maxLength?numberLimits the max input length
style?CSSPropertiesSets CSS styles
list?stringSets list attribute
min?numberMin characters required
max?numberMax characters allowed
disabled?booleanDisabled the input
pattern?stringSets the pattern attribute
language icon
copy icon
import { Input } from "@brick-uikit/input";

Usage input

Basic usage

Basic usage covers the default Input, with optional label, placeholder, and error message.

Invalid input

language icon

example.tsx

copy icon
<Input 
	type="email" 
	label="Email" 
	placeholder="Enter your email" 
/>
<Spacer top={1}/>
<Input 
	name="phone" 
	type="tel" 
	placeholder="Enter your phone" 
/>
<Spacer top={1}/>
<Input error="Invalid input" />

Size / Width

Adjust input width using `style` or CSS, and enforce character limits using `min` and `max` props.

language icon

example.tsx

copy icon
<Input min={5} placeholder="Min 5 chars" />
<Spacer top={1}/>
<Input max={10} placeholder="Max 10 chars" />

Customization

Use `className` or `style` to customize appearance. Apply custom borders, background colors, or other CSS adjustments.

language icon

example.tsx

copy icon
<Input 
	style={{border: "1px solid #931a04", background: "#fff8f5", color: "#931a04" }}
	placeholder="Custom style" 
/>
<Spacer top={1}/>
<Input 
	className={styles.customInput}
	placeholder="Custom class" 
/>

Logic patterns

Controlled inputs, disabled state, validation, and type variations for email and phone.

Must be 3-10 letters

language icon

example.tsx

copy icon
<Input 
	name="email" 
	onChange={handleChange}
	label="Email"
	type="email"
	placeholder="Enter email"
/>
<Spacer top={1}/>
<Input 
	name="phone"
	onChange={handleChange}
	label="Phone"
	type="tel"
	placeholder="Enter phone"
/>
<Spacer top={1}/>
<Input 
	name="disabled"
	onChange={handleChange}
	disabled
	placeholder="Disabled input"
/>
<Spacer top={1}/>
<Input 
	name="validated"
	onChange={handleChange}
	pattern="[A-Za-z]{3,10}"
	maxLength={10}
	error="Must be 3-10 letters"
	placeholder="Validation example"
/>