Đi tới nội dung tài liệu
Underverse UI Logo
ComponentForm Input

Input (with i18n)

Input (with i18n) thuộc nhóm Form Input. Xem demo trực tiếp, cách tích hợp và các lưu ý triển khai.

Bắt đầu nhanh

Import Input (with i18n) từ entry công khai. Các ví dụ bên dưới thể hiện những kiểu tương tác và cấu hình được hỗ trợ.

component.tsxtsx
import { Input, SearchInput, PasswordInput, NumberInput } from '@underverse-ui/underverse';

Ví dụ tương tác

Dùng thử Input (with i18n) thật, xem mã ví dụ và tra cứu các prop đã được mô tả.

Đang tải ví dụ tương tác…
Tham chiếu

Tham chiếu API

Tra cứu các thuộc tính, kiểu dữ liệu được chấp nhận, giá trị mặc định và lưu ý về hành vi.

Dữ liệu được sinh từ API TypeScript công khai của thư viện. Kiểu dữ liệu, thuộc tính bắt buộc và giá trị mặc định luôn đồng bộ với mã nguồn.

Input

Component
Thuộc tínhMô tảKiểuMặc định
labelNhãn hiển thị phía trên ô nhập.string
labelClassNameCustom class for labelstring
errorThông báo lỗi hiển thị bên dưới.string
descriptionMô tả/hỗ trợ hiển thị bên dưới.string
variantKiểu hiển thị (default, filled, outlined, minimal)."default" | "filled" | "outlined" | "minimal""default"
sizeKích thước (sm, md, lg).FormControlSize"md"
borderModeMã nguồn chưa cung cấp mô tả bổ sung.BorderMode
leftIconIcon bên trái trong ô.React.ComponentType<{ className?: string }>
rightIconIcon bên phải trong ô.React.ComponentType<{ className?: string }>
clearableHiện nút xóa (X) khi có giá trị.booleanfalse
loadingHiển thị trạng thái đang tải.booleanfalse
successHiển thị trạng thái thành công.booleanfalse
onClearCallback khi bấm nút xóa.() => void
hintGợi ý nhỏ bên dưới.string
counterHiển thị bộ đếm ký tự khi có maxLength.booleanfalse
maxLengthSố lượng ký tự tối đa.number
rightAddonCustom content rendered inside the input container (positioned absolutely)React.ReactNode
rightSectionCustom content attached to the end of the input, after built-in controlsReact.ReactNode

SearchInput

Component
Thuộc tínhMô tảKiểuMặc định
modeSearch interaction style. `default` searches as the value changes; `button` searches on Enter or button click."default" | "button""default"
onSearchMã nguồn chưa cung cấp mô tả bổ sung.(value: string) => void
searchDelayDebounce duration for `default` mode. Ignored in `button` mode.number300
searchButtonLabelAccessible label for the search action in `button` mode.string"Search"
variantKiểu hiển thị (default, filled, outlined, minimal)."default" | "filled" | "outlined" | "minimal"
sizeKích thước (sm, md, lg).FormControlSize"md"
loadingHiển thị trạng thái đang tải.booleanfalse
borderModeMã nguồn chưa cung cấp mô tả bổ sung.BorderMode
successHiển thị trạng thái thành công.boolean
descriptionMô tả/hỗ trợ hiển thị bên dưới.string
errorThông báo lỗi hiển thị bên dưới.string
maxLengthSố lượng ký tự tối đa.number
labelNhãn hiển thị phía trên ô nhập.string
labelClassNameCustom class for labelstring
rightIconIcon bên phải trong ô.React.ComponentType<{ className?: string }>
clearableHiện nút xóa (X) khi có giá trị.booleantrue
onClearCallback khi bấm nút xóa.() => void
hintGợi ý nhỏ bên dưới.string
counterHiển thị bộ đếm ký tự khi có maxLength.boolean
rightAddonCustom content rendered inside the input container (positioned absolutely)React.ReactNode
rightSectionCustom content attached to the end of the input, after built-in controlsReact.ReactNode

PasswordInput

Component
Thuộc tínhMô tảKiểuMặc định
showStrengthHiển thị thanh đánh giá độ mạnh mật khẩu.booleanfalse
strengthLabelsNhãn cho các mức độ (Yếu, Trung bình, Tốt, Mạnh).string[]["Weak", "Fair", "Good", "Strong"]
variantKiểu hiển thị (default, filled, outlined, minimal)."default" | "filled" | "outlined" | "minimal"
sizeKích thước (sm, md, lg).FormControlSize
loadingHiển thị trạng thái đang tải.boolean
borderModeMã nguồn chưa cung cấp mô tả bổ sung.BorderMode
successHiển thị trạng thái thành công.boolean
descriptionMô tả/hỗ trợ hiển thị bên dưới.string
errorThông báo lỗi hiển thị bên dưới.string
maxLengthSố lượng ký tự tối đa.number
labelNhãn hiển thị phía trên ô nhập.string
labelClassNameCustom class for labelstring
leftIconIcon bên trái trong ô.React.ComponentType<{ className?: string }>
rightIconIcon bên phải trong ô.React.ComponentType<{ className?: string }>
clearableHiện nút xóa (X) khi có giá trị.boolean
onClearCallback khi bấm nút xóa.() => void
hintGợi ý nhỏ bên dưới.string
counterHiển thị bộ đếm ký tự khi có maxLength.boolean
rightAddonCustom content rendered inside the input container (positioned absolutely)React.ReactNode
rightSectionCustom content attached to the end of the input, after built-in controlsReact.ReactNode

NumberInput

Component
Thuộc tínhMô tảKiểuMặc định
minGiá trị nhỏ nhất.number
maxGiá trị lớn nhất.number
stepBước tăng/giảm.number1
showSteppersHiển thị nút tăng/giảm +/–.booleantrue
onIncrementTrình xử lý tăng tùy chỉnh (tùy chọn).() => void
onDecrementTrình xử lý giảm tùy chỉnh (tùy chọn).() => void
formatThousandsĐịnh dạng phân tách hàng nghìn để hiển thị.booleanfalse
localeLocale để định dạng số.string"vi-VN"
valueGiá trị số/chuỗi điều khiển.number | string
onChangeHàm xử lý thay đổi nhận sự kiện input.React.ChangeEventHandler<HTMLInputElement>
variantKiểu hiển thị (default, filled, outlined, minimal)."default" | "filled" | "outlined" | "minimal"
sizeKích thước (sm, md, lg).FormControlSize
loadingHiển thị trạng thái đang tải.boolean
borderModeMã nguồn chưa cung cấp mô tả bổ sung.BorderMode
successHiển thị trạng thái thành công.boolean
descriptionMô tả/hỗ trợ hiển thị bên dưới.string
errorThông báo lỗi hiển thị bên dưới.string
maxLengthSố lượng ký tự tối đa.number
labelNhãn hiển thị phía trên ô nhập.string
labelClassNameCustom class for labelstring
leftIconIcon bên trái trong ô.React.ComponentType<{ className?: string }>
rightIconIcon bên phải trong ô.React.ComponentType<{ className?: string }>
clearableHiện nút xóa (X) khi có giá trị.boolean
onClearCallback khi bấm nút xóa.() => void
hintGợi ý nhỏ bên dưới.string
counterHiển thị bộ đếm ký tự khi có maxLength.boolean
rightAddonCustom content rendered inside the input container (positioned absolutely)React.ReactNode
rightSectionCustom content attached to the end of the input, after built-in controlsReact.ReactNode

Textarea

Component
Thuộc tínhMô tảKiểuMặc định
labelNhãn textarea.string
labelClassNameCustom class for labelstring
errorThông báo lỗi.string
descriptionMô tả ngắn bên dưới.string
variantKiểu hiển thị."default" | "filled" | "outlined" | "minimal""default"
sizeKích thước."sm" | "md" | "lg""md"
borderModeMã nguồn chưa cung cấp mô tả bổ sung.BorderMode
resizeMã nguồn chưa cung cấp mô tả bổ sung."none" | "vertical" | "horizontal" | "both""vertical"
counterHiển thị bộ đếm ký tự khi có maxLength.booleanfalse
useOverlayScrollbarEnable OverlayScrollbars on textarea viewport. Default: falsebooleanfalse

Hướng dẫn sử dụng

Kết nối Input (with i18n) với nhãn hiển thị, thông báo xác thực và trạng thái form rõ ràng. Không dùng placeholder làm nhãn duy nhất.

Trợ năng

Khi dùng Input (with i18n), hãy giữ trạng thái focus dễ nhận biết, cung cấp tên truy cập khi cần và kiểm tra bàn phím cùng trình đọc màn hình trong ngữ cảnh thực tế.