一键导入
groww-text-input
Text input component with validation, icons, error states, and multiple variants. Use when building forms, search inputs, or text entry fields.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Text input component with validation, icons, error states, and multiple variants. Use when building forms, search inputs, or text entry fields.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Accordion component with collapsible sections. Use for FAQs, nested content, or expandable details sections.
Button component with variants, sizes, loading states, and icon support. Use when creating clickable actions, forms, or navigation buttons.
Calendar component for date and month selection. Use when building date pickers, scheduling interfaces, or date range selectors.
Carousel component for image/content sliders with navigation controls. Use for image galleries, hero sections, or content that scrolls horizontally.
Checkbox component for boolean or multi-select inputs. Use when building forms with boolean toggles or multiple selection lists.
Dropdown menu component with trigger and content pattern. Use when building selectable menus, action menus, or nested navigation.
| name | groww-text-input |
| description | Text input component with validation, icons, error states, and multiple variants. Use when building forms, search inputs, or text entry fields. |
import TextInput from '@groww-tech/ui-toolkit/dist/esm/components/atoms/TextInput';
import TextInputV1 from '@groww-tech/ui-toolkit/dist/esm/components/atoms/TextInputV1';
// or
import { TextInput, TextInputV1 } from '@groww-tech/ui-toolkit';
interface TextInputProps {
value?: string; // Controlled value
onChange?: (value: string) => void; // Change handler
placeholder?: string; // Placeholder text
label?: string; // Input label
helperText?: string; // Helper text below input
error?: string; // Error message (shows error state)
warning?: string; // Warning message
disabled?: boolean; // Disabled state
required?: boolean; // Required field indicator
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
size?: 'small' | 'medium' | 'large';
leftIcon?: React.ReactNode; // Icon on left
rightIcon?: React.ReactNode; // Icon on right
showClearIcon?: boolean; // Show clear button
onClear?: () => void; // Clear handler
maxLength?: number; // Character limit
autoFocus?: boolean; // Auto focus on mount
dataTestId?: string;
id?: string;
name?: string;
className?: string;
inputClassName?: string;
}
interface TextInputV1Props {
value?: string;
onChange?: (value: string) => void;
placeholder?: string;
type?: 'text' | 'password' | 'email' | 'number';
isError?: boolean; // Error state
errorMessage?: string;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
shouldValidate?: boolean; // Show validation
onEnterPress?: () => void; // Enter key handler
maxLength?: number;
disabled?: boolean;
autoFocus?: boolean;
}
<TextInput
value={value}
onChange={setValue}
placeholder="Enter your name"
/>
<TextInput
label="Email"
value={email}
onChange={setEmail}
type="email"
helperText="We'll never share your email"
required={true}
/>
<TextInput
label="Username"
value={username}
onChange={setUsername}
error={usernameError || undefined}
/>
import { SearchIcon, CloseIcon } from '@groww-tech/icon-store';
<TextInput
leftIcon={<SearchIcon />}
rightIcon={value && <CloseIcon onClick={() => setValue('')} />}
placeholder="Search..."
showClearIcon={true}
onClear={() => setValue('')}
/>
<TextInput
type="password"
value={password}
onChange={setPassword}
label="Password"
required={true}
/>
undefined vs '' in controlled inputslabel prop for accessibilitytype for appropriate keyboardhtmlFor/idaria-required