JGuang / JGuang UI
Components组件Radix UIRadix UI 组件

输入框

接收单行文本内容的基础输入控件。

中文模式已适配导航、标题、简介、目录与常用章节名称。翻译状态:部分完成;技术正文目前仍为英文。
Loading JGuang UI example…

安装

Command

Manual

Use the JGuang UI Registry URL provided on /systems/jguang-ui#install.

将以下代码复制到你的项目中。

View complete source: components/ui/input.tsx

根据项目配置更新导入路径。

用法

import { Input } from "@/components/ui/input"
<Input />

Basic

Loading JGuang UI example…

Field

Use Field, FieldLabel, and FieldDescription to create an input with a label and description.

Loading JGuang UI example…

Field Group

Use FieldGroup to show multiple Field blocks and to build forms.

Loading JGuang UI example…

Disabled

Use the disabled prop to disable the input. To style the disabled state, add the data-disabled attribute to the Field component.

Loading JGuang UI example…

Invalid

Use the aria-invalid prop to mark the input as invalid. To style the invalid state, add the data-invalid attribute to the Field component.

Loading JGuang UI example…

File

Use the type="file" prop to create a file input.

Loading JGuang UI example…

Inline

Use Field with orientation="horizontal" to create an inline input. Pair with Button to create a search input with a button.

Loading JGuang UI example…

Grid

Use a grid layout to place multiple inputs side by side.

Loading JGuang UI example…

Required

Use the required attribute to indicate required inputs.

Loading JGuang UI example…

Badge

Use Badge in the label to highlight a recommended field.

Loading JGuang UI example…

Input Group

To add icons, text, or buttons inside an input, use the InputGroup component. See the Input Group component for more examples.

Loading JGuang UI example…

按钮组

To add buttons to an input, use the ButtonGroup component. See the Button Group component for more examples.

Loading JGuang UI example…

Form

A full form example with multiple inputs, a select, and a button.

Loading JGuang UI example…

从右到左布局

To enable RTL support in JGuang UI, see the RTL configuration guide.

Loading JGuang UI example…

来源: components/radix/input.mdx

JGuang UI 技术文档。

On this page