Skip to main content

TextBox()

function TextBox(props: TextBoxProps): Element;

Text input field component with React Hook Form integration. Wraps the Dimsum TextBox component with form state management and validation.

Parameters

props

TextBoxProps

TextBox component props

Returns

Element

Example

<Form onSubmit={handleSubmit}>
<TextBox
name="firstName"
label="First Name"
placeholder="Enter your first name"
rules={{
required: 'First name is required',
minLength: { value: 2, message: 'Minimum 2 characters' }
}}
/>
</Form>