Input · Input

Input

Input is a basic component for users to enter and edit text.

Demos

How to import

import { Input, TextArea, InputGroup } from '@fibrous/semi-ui-solid';

Basic Usage

Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return <Input aria-label="Basic input" defaultValue="hi" />;
}

Size

Support three sizes: large, default, and small.





Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <>
            <Input placeholder="large" size="large" />
            <br />
            <br />
            <Input placeholder="default" />
            <br />
            <br />
            <Input placeholder="small" size="small" />
        </>
    );
}

Disabled



Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <>
            <Input aria-label="可用的输入框" defaultValue="enabled input" />
            <br />
            <br />
            <Input aria-label="禁用的输入框" disabled defaultValue="disabled input" />
        </>
    );
}

Prefix/Suffix

Add a prefix or suffix to the input; the content can be text, an icon, or any JSX element.

When the content of prefix and suffix is text or Semi Icon, the left and right margin will be automatically added. If it is a custom JSX element, the left and right margin will be 0.



Prefix




Suffix
Code
import { IconSearch } from '@fibrous/semi-icons-solid';
import { Input, Typography } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <>
            <Input aria-label="Search" prefix={<IconSearch />} showClear />
            <br />
            <br />
            <Input aria-label="Input with text prefix" prefix="Prefix" showClear />
            <br />
            <br />
            <Input aria-label="Search" suffix={<IconSearch />} showClear />
            <br />
            <br />
            <Input
                aria-label="Input with text suffix"
                suffix={
                    <Typography.Text strong type="secondary" style={{ 'margin-right': '8px' }}>
                        Suffix
                    </Typography.Text>
                }
                showClear
            />
        </>
    );
}

Addon

Add an addon before or after the input; the content can be text, an icon, or any JSX element.

When the content of addonBefore and addonAfter is text or Semi Icon, the left and right margin will be automatically added. If it is a custom JSX element, the left and right margin will be 0.

http://
.com
Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return <Input aria-label="域名" addonBefore="http://" addonAfter=".com" />;
}

Clear Icon

Use showClear to allow clear current value when clicking on clear icon.

Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return <Input aria-label="Clearable input" showClear defaultValue="click to clear" />;
}

Password Mode

Hide the content of input

Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return <Input aria-label="Password" mode="password" defaultValue="123456" />;
}

Validation

You can set different validateStatus to provide style feedback to the user.





Code
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <>
            <Input aria-label="警告状态" defaultValue="ies" validateStatus="warning" />
            <br />
            <br />
            <Input aria-label="错误状态" defaultValue="ies" validateStatus="error" />
            <br />
            <br />
            <Input aria-label="默认状态" defaultValue="ies" />
        </>
    );
}

Controlled Component

The value of Input is entirely determined by the value prop. Use it together with the onChange callback.

Code
import { createSignal } from 'solid-js';
import { Input } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    const [value, setValue] = createSignal('controlInput');

    const onChange = (val: string) => {
        console.log(val);
        setValue(val);
    };

    return (
        <>
            <Input aria-label="Controlled input" value={value()} onChange={onChange} />
        </>
    );
}

InputGroup

You could put multiple text field input into <InputGroup> and set size, disabled to the entire group. Supported fields include: Input, InputNumber, Select, AutoComplete、TreeSelect、Cascader、DatePicker










Code
import { AutoComplete, DatePicker, Input, InputGroup, InputNumber, Select } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <div>
            <InputGroup>
                <Input placeholder="Name" style={{ width: '100px' }} />
                <InputNumber placeholder="Score" style={{ width: '140px' }} />
            </InputGroup>
            <br />
            <br />
            <br />
            <InputGroup size="small">
                <Select aria-label="Address type" style={{ width: '100px' }} defaultValue="home">
                    <Select.Option value="home">Home</Select.Option>
                    <Select.Option value="work">Work</Select.Option>
                </Select>
                <AutoComplete data={['Beijing Haidian']} placeholder="Address: " style={{ width: '180px' }} />
            </InputGroup>
            <br />
            <br />
            <br />
            <InputGroup size="small">
                <Select aria-label="Account action" style={{ width: '100px' }} defaultValue="signup">
                    <Select.Option value="signup">Sign Up</Select.Option>
                    <Select.Option value="signin">Sign In</Select.Option>
                </Select>
                <Input placeholder="Email" style={{ width: '180px' }} />
            </InputGroup>
            <br />
            <br />
            <br />
            <InputGroup size="small">
                <Input placeholder="Name" style={{ width: '100px' }} />
                <DatePicker placeholder="Birthday" />
            </InputGroup>
        </div>
    );
}


Code
import { Cascader, InputGroup, Select, TreeSelect } from '@fibrous/semi-ui-solid';

const treeData = [
    {
        label: 'Asia',
        value: 'Asia',
        key: '0',
        children: [
            {
                label: 'China',
                value: 'China',
                key: '0-0',
                children: [
                    { label: 'Beijing', value: 'Beijing', key: '0-0-0' },
                    { label: 'Shanghai', value: 'Shanghai', key: '0-0-1' },
                ],
            },
        ],
    },
    { label: 'North America', value: 'North America', key: '1' },
];

export default function InputDemo() {
    return (
        <>
            <InputGroup>
                <Select aria-label="From or to" style={{ width: '100px' }} defaultValue="from">
                    <Select.Option value="from">From: </Select.Option>
                    <Select.Option value="to">To: </Select.Option>
                </Select>
                <TreeSelect style={{ width: '220px' }} treeData={treeData} placeholder="Please select" />
            </InputGroup>
            <br />
            <br />
            <InputGroup>
                <Select aria-label="From or to" style={{ width: '100px' }} defaultValue="from">
                    <Select.Option value="from">From: </Select.Option>
                    <Select.Option value="to">To: </Select.Option>
                </Select>
                <Cascader style={{ width: '220px' }} treeData={treeData} placeholder="Please select" />
            </InputGroup>
        </>
    );
}

TextArea

Used for multi-line text. You can set maxCount to restrict text entering and display text count. showClear is supported.



0/100
Code
import { TextArea } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <div>
            <TextArea aria-label="Text area" />
            <br />
            <br />
            <TextArea aria-label="Text area with character limit" maxCount={100} showClear />
        </div>
    );
}

Setting TextArea Height

You can set the style of the internal textarea element through textareaStyle, such as height, background color, etc.





Code
import { TextArea } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <div>
            <TextArea textareaStyle={{ height: '120px' }} placeholder="高度 120px" />
            <br />
            <br />
            <TextArea textareaStyle={{ height: '200px', 'background-color': '#f9f9f9' }} placeholder="高度 200px,灰色背景" />
            <br />
            <br />
            <TextArea style={{ border: '2px solid var(--semi-color-primary)' }} textareaStyle={{ height: '150px' }} placeholder="style 控制外层容器,textareaStyle 控制 textarea" />
        </div>
    );
}

Line Numbers

Set showLineNumber to display line numbers. You can use lineNumberStart to set the starting line number, and customize the line number area via lineNumberStyle/lineNumberClassName.

Code
import { TextArea } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return <TextArea aria-label="带行号的文本" showLineNumber lineNumberStart={1} defaultValue={'Line 1\nLine 2\n这是一行较长的文本,用来演示软换行时的行号对齐效果。\nLine 4\nLine 5'} rows={12} style={{ width: '420px' }} lineNumberStyle={{ color: 'var(--semi-color-text-2)' }} />;
}

Line break by Shift + Enter

By default, in a TextArea, both Enter and Shift + Enter can achieve line breaks. Through appropriate event listening and disabling the default behavior, you can achieve disabling line breaks with Enter and only allowing line breaks with Shift + Enter.

使用
shift+enter
换行的 TextArea
Code
import { createSignal } from 'solid-js';
import { HotKeys, TextArea } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    const [text, setText] = createSignal('');

    const handleKeyDown = (event: KeyboardEvent) => {
        if (event.key === 'Enter' && !event.shiftKey) {
            event.preventDefault();
        }
    };

    return (
        <>
            <div id="input-shift-enter-hint" style={{ display: 'flex' }}>
                使用
                <HotKeys hotKeys={['shift', 'enter']} style={{ 'margin-bottom': '12px', 'margin-left': '4px', 'margin-right': '4px' }} />
                换行的 TextArea
            </div>
            <TextArea aria-labelledby="input-shift-enter-hint" value={text()} onChange={(value) => setText(value)} onKeyDown={handleKeyDown} />
        </>
    );
}

Autosize TextArea

You can set autosize to allow TextArea resizing height with content.





0/100
Code
import { TextArea } from '@fibrous/semi-ui-solid';

export default function InputDemo() {
    return (
        <div>
            <TextArea aria-label="单行自适应高度" autosize rows={1} />
            <br />
            <br />
            <TextArea aria-label="限制行数的自适应高度" autosize={{ minRows: 1, maxRows: 3 }} />
            <br />
            <br />
            <TextArea aria-label="限制字数的自适应高度" autosize maxCount={100} />
        </div>
    );
}

Custom calculated character string length

By setting the getValueLength property, you can customize the length of the character string. With maxLength and minLength (maxlength and minlength in Vue), you can support emoji length to calculate according to the visible length.

What is done inside Semi when getValueLength is passed in:

  • maxLength: maxLength is not passed directly to the native input. If the input length exceeds the maximum limit, the legal length character entered last time is used.
  • minLength: dynamically switch the length of minLength, emoji is calculated according to a length.
  • maxCount: compare the values obtained using getValueLength with maxCount

maxLength=10

尝试输入以下字符
💖
👨‍👩‍👧‍👦


Form.Input + minLength=4

maxCount=10

10/10
Code
import { createSignal, Show } from 'solid-js';
import { Button, Form, FormInput, Input, TextArea, Typography } from '@fibrous/semi-ui-solid';

// Counts grapheme clusters, so an emoji sequence counts as one character
function getValueLength(str: string) {
    return [...new Intl.Segmenter().segment(str)].length;
}

function getTextAreaStrLength(str: string) {
    return str.replace(/\s/g, '').length;
}

export default function InputDemo() {
    const [value, setValue] = createSignal('');

    return (
        <div>
            <h4 id="input-value-length-max-length">maxLength=10</h4>
            <div>
                <Typography.Text>尝试输入以下字符</Typography.Text>
                <div>
                    <Typography.Text copyable>💖</Typography.Text>
                </div>
                <div>
                    <Typography.Text copyable>👨‍👩‍👧‍👦</Typography.Text>
                </div>
            </div>
            <Input aria-labelledby="input-value-length-max-length" maxLength={10} getValueLength={getValueLength} onChange={(next) => setValue(next)} style={{ width: '200px', 'margin-top': '12px', 'margin-bottom': '12px' }} />
            <Show when={value()}>
                <div>
                    <div>
                        <Typography.Text type="tertiary">{`getValueLength=${getValueLength(value())}`}</Typography.Text>
                    </div>
                    <div>
                        <Typography.Text type="tertiary">{`length=${value().length}`}</Typography.Text>
                    </div>
                </div>
            </Show>
            <br />
            <br />
            <h4 id="input-value-length-min-length">Form.Input + minLength=4</h4>
            <Form layout="horizontal">
                <FormInput noLabel aria-labelledby="input-value-length-min-length" field="username" minLength={4} getValueLength={getValueLength} style={{ width: '200px' }} />
                <Button type="primary" htmlType="submit">
                    提交
                </Button>
            </Form>
            <h4 id="input-value-length-max-count">maxCount=10</h4>
            <TextArea aria-labelledby="input-value-length-max-count" defaultValue="semi design" rows={2} maxCount={10} getValueLength={getTextAreaStrLength} style={{ width: '200px' }} />
        </div>
    );
}

Answers to some questions:

Why not just import the grapheme-splitter package? The uncompressed size of this package is 200+ kB, which is a bit too large for users who do not need to calculate emoji according to the visible length. Therefore, Semi chose to use the length calculation function as an argument for users to pass in

Why not modify maxLength (maxlength in Vue) dynamically? Modify maxLength dynamically after the input operation is completed, calculate the remaining character length that can be entered. If the maxLength is set to 1, you want to enter a '💖' with a length of 2, but due to the limitation of input maxLength, you can't enter it at all here, and you can't update maxLength.

IME Input Mode

By setting the composition property to true, you can enable IME input mode. In this mode, when using an IME (e.g., Chinese pinyin input), onChange will not be triggered during IME confirmation (e.g., while pinyin is being typed), and will only be triggered once after the IME confirms the input. This is useful for real-time search scenarios to avoid unnecessary requests during pinyin input.

Both Input and TextArea support this property.

Input with composition

onChange 触发次数: 0


TextArea with composition

onChange 触发次数: 0
Code
import { createSignal } from 'solid-js';
import { Input, TextArea } from '@fibrous/semi-ui-solid';

const style = { width: '300px' };
const counterStyle = { 'margin-top': '8px', color: 'var(--semi-color-text-2)', 'font-size': '12px' };

export default function InputDemo() {
    const [inputValue, setInputValue] = createSignal('');
    const [textAreaValue, setTextAreaValue] = createSignal('');
    const [inputCount, setInputCount] = createSignal(0);
    const [textAreaCount, setTextAreaCount] = createSignal(0);

    const handleInputChange = (value: string) => {
        setInputValue(value);
        setInputCount((count) => count + 1);
    };

    const handleTextAreaChange = (value: string) => {
        setTextAreaValue(value);
        setTextAreaCount((count) => count + 1);
    };

    return (
        <div>
            <h4>Input with composition</h4>
            <Input composition value={inputValue()} onChange={handleInputChange} placeholder="开启 composition,拼音输入时不会触发 onChange" style={style} />
            <div style={counterStyle}>onChange 触发次数: {inputCount()}</div>
            <br />
            <br />
            <h4>TextArea with composition</h4>
            <TextArea composition value={textAreaValue()} onChange={handleTextAreaChange} placeholder="开启 composition,拼音输入时不会触发 onChange" style={style} />
            <div style={counterStyle}>onChange 触发次数: {textAreaCount()}</div>
        </div>
    );
}

API Reference

Input

Props

PropertyDescriptionTypeDefault
addonAfterAddon after the input: text, a Semi icon or any JSX element.JSX.Element-
addonBeforeAddon before the input: text, a Semi icon or any JSX element.JSX.Element-
borderlessBorderless mode.booleanfalse
clearIconCustom icon of the clear button, effective when showClear is true.JSX.Element-
compositionWhether to enable IME mode; onChange does not fire during a composition and fires once after it ends.booleanfalse
defaultValueInitial content when the input is uncontrolled.string | number-
disabledWhether the input is disabled. When not set, the disabled of the InputGroup it is in applies.boolean-
getValueLengthCustom string length calculation, used with maxLength and minLength.Type(value: string) => number-
hideSuffixHides the suffix while the clear button is shown; by default the two sit side by side.booleanfalse
inputRefReceives the native input element.Type(element: HTMLInputElement) => void-
inputStyleStyle of the native input element; object keys are kebab-case and numbers need a unit.JSX.CSSProperties | string-
insetLabelInset label rendered in the prefix position when no prefix is set; then, if neither aria-label nor aria-labelledby is set, the input is named by it through aria-labelledby.JSX.Element-
insetLabelIdThe id of the element around insetLabel, for aria-labelledby to reference.string-
maxLengthMaximum length. With getValueLength the length is measured and truncated by it; otherwise the native attribute applies.number-
minLengthMinimum length. With getValueLength it is converted accordingly; otherwise the native attribute applies.number-
modeInput mode; password shows a button that reveals or hides the text.InputMode-
onBlurCalled when focus leaves the input. It listens on the wrapper, so focus moving between the input and the buttons inside the component does not fire it.Type(e: FocusEvent) => void-
onChangeCalled when the value changes, with the new value and the event.Type(value: string, e: InputChangeEvent) => void-
onClearCalled when the clear button is clicked.Type(e: MouseEvent) => void-
onEnterPressCalled on Enter keydown; the Enter that commits an IME composition does not fire it.Type(e: InputElementEvent<KeyboardEvent>) => void-
onFocusCalled when the input gets focus. It listens on the wrapper, so focus moving inside the component does not fire it again.Type(e: FocusEvent) => void-
onlyBorderThe border width of the wrapper, in px.number-
placeholderHint text shown while the input is empty.string | number-
prefixPrefix: text, a Semi icon or any JSX element.JSX.Element-
preventScrollWhether the browser should avoid scrolling the document to show the newly focused element, for focus calls inside the component.boolean-
readonlyRead-only: blocks typing and hides the clear button. The native readOnly only blocks typing.booleanfalse
refReceives the wrapper div element; its focus() and blur() act on the input.TypeRef<HTMLDivElement>-
showClearShows a clear button when the input has content and the pointer or focus is inside the component.booleanfalse
showClearIgnoreDisabledInternal property used by DatePicker: the clear button stays available while disabled.boolean-
sizeInput size: large, default or small. In an InputGroup, the size of the group replaces it.InputSize-
suffixSuffix: text, a Semi icon or any JSX element.JSX.Element-
typeThe type of the native input.string"text"
validateStatusValidation status: default, error or warning; error outputs aria-invalid.ValidateStatus"default"
valueContent of the input, used as a controlled value together with onChange.string | number-

class, style and ref land on the outer wrapper div; other native attributes and events (such as aria-*, id and name) land on the native input. onFocus and onBlur are listened for on the wrapper, so moving focus between the input and the buttons inside the component does not fire them.

TextArea

Props

PropertyDescriptionTypeDefault
autosizeWhether the height follows the content; pass { minRows, maxRows } to limit the rows.boolean | AutosizeRowfalse
borderlessBorderless mode.booleanfalse
colsVisible width in average character widths.number20
compositionWhether to enable IME mode; onChange does not fire during a composition and fires once after it ends.booleanfalse
defaultValueInitial content when the text area is uncontrolled.string-
disabledWhether the text area is disabled.boolean-
disabledEnterStartNewLineInternal property used by Chat: Enter does not start a new line, Shift + Enter does.boolean-
getValueLengthCustom string length calculation, used with maxLength, minLength and maxCount.Type(value: string) => number-
lineNumberClassNameClass name of the line number area.string-
lineNumberStartStarting line number.number1
lineNumberStyleStyle of the line number area; object keys are kebab-case and numbers need a unit.JSX.CSSProperties-
maxCountMaximum number of characters; setting it shows a counter, which turns red when exceeded. The input is not truncated.number-
maxLengthMaximum length. With getValueLength the length is measured and truncated by it; otherwise the native attribute applies.number-
minLengthMinimum length. With getValueLength it is converted accordingly; otherwise the native attribute applies.number-
onBlurCalled when focus leaves the text area. It listens on the wrapper, so focus moving between the text area and the clear button does not fire it.Type(e: FocusEvent) => void-
onChangeCalled when the text changes, with the new value and the event.Type(value: string, e: TextAreaChangeEvent) => void-
onClearCalled when the clear button is clicked.Type(e: MouseEvent) => void-
onEnterPressCalled on Enter keydown; the Enter that commits an IME composition does not fire it.Type(e: TextAreaElementEvent<KeyboardEvent>) => void-
onFocusCalled when the text area gets focus. It listens on the wrapper, so focus moving inside the component does not fire it again.Type(e: FocusEvent) => void-
onResizeCalled when the size changes: when autosize changes the height, and when the user drags the resize handle, which also provides width.Type(data: { height: number; width?: number }) => void-
readonlyRead-only: blocks typing and hides the clear button. The native readOnly only blocks typing.boolean-
refReceives the wrapper div element; its focus() and blur() act on the textarea.TypeRef<HTMLDivElement>-
resizeWhether and in which direction the user may resize: none, both, horizontal, vertical, block or inline. It only takes effect when given and is ignored with autosize.'none' | 'both' | 'horizontal' | 'vertical' | 'block' | 'inline'-
rowsNumber of visible text lines.number4
showClearShows a clear button when the text area has content and the pointer or focus is inside the component.booleanfalse
showCounterWhether to show the counter; it is always shown when maxCount is set.booleanfalse
showLineNumberWhether to show line numbers.booleanfalse
textareaRefReceives the native textarea element; showLineNumber remounts the textarea, so it is called again with the new element.Type(element: HTMLTextAreaElement) => void-
textareaStyleStyle of the inner textarea element, such as its height; object keys are kebab-case and numbers need a unit.JSX.CSSProperties-
validateStatusValidation status: default, error or warning; error outputs aria-invalid.ValidateStatus-
valueText content, used as a controlled value together with onChange.string-

class, style and ref land on the outer wrapper div; other native attributes and events (such as aria-*, id and name) land on the native textarea. onFocus and onBlur are listened for on the wrapper, so moving focus between the textarea and the clear button does not fire them.

InputGroup

Props

PropertyDescriptionTypeDefault
disabledWhether the group is disabled; it applies to the controls that set no disabled of their own.boolean-
labelLabel of the group, as an object with the Form.Label props such as text, required and extra; text can be a JSX element.LabelProps-
labelPositionLabel position: top or left.'top' | 'left' | (string & {})-
onBlurCalled when any control in the group loses focus, including a move to another control in it.Type(e: FocusEvent) => void-
onFocusCalled when any control in the group gets focus, including a move from another control in it.Type(e: FocusEvent) => void-
sizeInput size: large, default or small; it is passed to every control in the group and replaces their own size.InputSize"default"

size and disabled are passed to every control in the group: a control's own disabled takes precedence, while size always comes from the group. Other undeclared attributes (such as data-* and aria-*) are passed down the same way, with the control's own attributes taking precedence. class, style and ref land on the span with role="group". onFocus and onBlur are listened for on the group's root element, so when a control gains or loses focus, the handlers of the group and of the control both fire and neither overrides the other.

Methods

The ref of Input and TextArea is the outer wrapper div, not an imperative handle. focus() and blur() act on the inner input or textarea. For select(), setSelectionRange() and other native methods, get the native element through inputRef or textareaRef, then call the method on it.

Accessibility

ARIA

  • When validateStatus is error, the aria-invalid of the input box is true
  • When used in Form, the input is associated with the Field label through aria-labelledby

Keyboard and focus

  • Input can be focused, keyboard users can use Tab and Shift + Tab to switch focus
  • The password visibility toggle is a native button named by the locale's "Show password" or "Hidden password" for its state; it can be focused and toggled with Enter or Space, after which the focus goes back to the input
  • With showClear, a value, and no disabled (or with showClearIgnoreDisabled), the clear button is a native button named "Clear input" from the locale. Input shows it on hover or while focus is inside; TextArea does the same unless it is not editable. From the input, Tab moves to the clear button; Enter or Space clears and the focus goes back to the input. A mouse click on the clear button leaves the focus where it is

Design Tokens

These are the component's internal Sass variables and cannot be overridden. To customize styles, override the --semi-* CSS variables (see the Design Token page) or write unlayered CSS rules.
Sass variableValueUsage
$transition_duration-input-bgvar(--semi-transition_duration-none)输入框-背景色-动画持续时间
$transition_function-input-bgvar(--semi-transition_function-easeIn)输入框-背景色-过渡曲线
$transition_delay-input-bgvar(--semi-transition_delay-none)输入框-背景色-延迟时间
$transition_duration-input-bordervar(--semi-transition_duration-none)输入框-边框-动画持续时间
$transition_function-input-bordervar(--semi-transition_function-easeIn)输入框-边框-过渡曲线
$transition_delay-input-bordervar(--semi-transition_delay-none)输入框-边框-延迟时间
$transform_scale-inputvar(--semi-transform_scale-none)输入框-变大
$color-input_default-border-defaulttransparent输入框描边颜色 - 默认
$color-input_default-bg-defaultvar(--semi-color-fill-0)输入框背景颜色 - 默认
$color-input_default-text-defaultvar(--semi-color-text-0)输入框文本颜色 - 默认
$color-input_default-bg-hovervar(--semi-color-fill-1)输入框背景颜色 - 悬浮
$color-input_default-border-hovertransparent输入框描边颜色 - 悬浮
$color-input_default-bg-activevar(--semi-color-fill-2)输入框背景颜色 - 按下
$color-input_default-bg-focusvar(--semi-color-fill-0)输入框背景颜色 - 选中
$color-input_default-border-focusvar(--semi-color-focus-border)输入框描边颜色 - 选中
$color-input_default-bg-focus-hover$color-input_default-bg-focus输入框背景颜色 - 选中悬浮
$color-input_danger-bg-defaultvar(--semi-color-danger-light-default)错误输入框背景颜色 - 默认
$color-input_danger-border-defaultvar(--semi-color-danger-light-default)错误输入框描边颜色 - 默认
$color-input_danger-bg-hovervar(--semi-color-danger-light-hover)错误输入框背景颜色 - 悬浮
$color-input_danger-border-hovervar(--semi-color-danger-light-hover)错误输入框描边颜色 - 悬浮
$color-input_danger-bg-focusvar(--semi-color-danger-light-default)错误输入框背景颜色 - 选中
$color-input_danger-border-focusvar(--semi-color-danger)错误输入框描边颜色 - 选中
$color-input_danger-bg-activevar(--semi-color-danger-light-active)错误输入框背景颜色 - 按下
$color-input_warning-bg-defaultvar(--semi-color-warning-light-default)警告输入框背景颜色 - 默认
$color-input_warning-border-defaultvar(--semi-color-warning-light-default)警告输入框文本颜色 - 默认
$color-input_warning-bg-hovervar(--semi-color-warning-light-hover)警告输入框背景颜色 - 悬浮
$color-input_warning-border-hovervar(--semi-color-warning-light-hover)警告输入框描边颜色 - 悬浮
$color-input_warning-bg-focusvar(--semi-color-warning-light-default)警告输入框背景颜色 - 选中
$color-input_warning-border-focusvar(--semi-color-warning)警告输入框描边颜色 - 选中
$color-input_warning-bg-activevar(--semi-color-warning-light-active)警告输入框背景颜色 - 按下
$color-input_disabled-bg-defaultvar(--semi-color-disabled-fill)禁用输入框背景颜色
$color-input_disabled-text-defaultvar(--semi-color-disabled-text)禁用输入框文字颜色
$color-input_placeholder-text-defaultvar(--semi-color-text-2)输入框占位文字颜色
$color-input_prefix-text-defaultvar(--semi-color-text-2)输入框 prefix 文字颜色
$color-input-icon-defaultvar(--semi-color-text-2)输入框图标颜色
$color-input-icon-hovervar(--semi-color-primary-hover)输入框图标颜色 - 悬浮
$color-input_counter-text-defaultvar(--semi-color-text-2)多行文本字数统计文字颜色 - 未超限
$color-input_counter_danger-text-defaultvar(--semi-color-danger)多行文本字数统计文字颜色 - 未超限
$color-input_group-border-defaultvar(--semi-color-border)输入框组合分割线颜色
$color_input-default-border-only_border-defaultvar(--semi-color-border)只有描边的输入框描边颜色 - 默认
$color_input-default-border-only_border-hovervar(--semi-color-border)只有描边的输入框描边颜色 - 默认
$height-input_large$height-control-large - 2px输入框高度 & 行高 - 大尺寸
$height-input_small$height-control-small - 2px输入框高度 & 行高 - 小尺寸
$height-input_default$height-control-default - 2px输入框高度 & 行高 - 默认尺寸
$height-input_wrapper_large$height-control-large
$height-input_wrapper_small$height-control-small
$height-input_wrapper_default$height-control-default
$width-input-icon$width-icon-medium + $spacing-tight * 2密码图标最小宽度
$width-input-icon_clear_before_suffix$width-icon-medium + $spacing-tightsuffix 之前的清除按钮宽度
$width-input-icon_clear_before_modebtn$width-icon-medium密码之前的清除按钮宽度
$motion-scale_size-active0.97
$motion-scale_size-inactive1
$width-input_append-border$border-thickness-control后置标签描边宽度
$width-input_prepend-border$border-thickness-control前置标签描边宽度
$width-input_group_pseudo-border$border-thickness-control
$width-input_wrapper-border$border-thickness-control-focus输入框描边宽度
$width-input_wrapper_focus-border$border-thickness-control-focus输入框描边宽度 - 选中态
$width-input_icon-outlineOffset-1px输入框 icon outline-offset 宽度
$radius-input_wrappervar(--semi-border-radius-small)输入框圆角大小
$spacing-input-paddingLeft$spacing-base-tight输入光标距离容器的左侧内边距
$spacing-input-paddingRight$spacing-base-tight输入文字距离容器的右侧内边距
$spacing-input_prefix_suffix-marginX$spacing-base-tightprefix/suffix 水平外边距
$spacing-input_prefix_icon-marginY0prefix 图标垂直内边距
$spacing-input_prefix_icon-marginX$spacing-tightprefix 图标水平内边距
$spacing-input_prepend-paddingY0前置标签垂直内边距
$spacing-input_prepend-paddingX$spacing-base-tight前置标签水平内边距
$spacing-input_group_withTopLabel-marginTop$spacing-base
$spacing-input_group_withTopLabel-marginBottom$spacing-base
$font-input_prefix_suffix-fontWeight$font-weight-boldprefix/suffix 文字字重
$spacing-textarea-paddingY5px多行文本垂直内边距
$spacing-textarea-paddingX$spacing-base-tight多行文本水平内边距
$spacing-textarea_counter-paddingTop3px多行文本字数统计顶部内边距
$spacing-textarea_counter-paddingRight12px多行文本字数统计右侧内边距
$spacing-textarea_counter-paddingBottom5px多行文本字数统计底部内边距
$spacing-textarea_counter-paddingLeft12px多行文本字数统计左侧内边距
$width-textarea-border$border-thickness多行文本描边宽度
$height-textarea_counter32px多行文本字数统计最小高度
$color-textarea-border-defaulttransparent多行文本描边颜色
$color-textarea-border-hover$color-textarea-border-default多行文本描边颜色 - 悬浮
$color-textarea-icon-defaultvar(--semi-color-text-2)多行文本 clear 图标颜色
$color-textarea-icon-hovervar(--semi-color-primary-hover)多行文本 clear 图标颜色 - 悬浮
$width-textarea-icon$width-icon-medium + $spacing-tightclear 图标最小宽度
$height-textarea-default32px多行文本 clear 图标的高度
$spacing-textarea_withShowClear-paddingRight36px多行文本设置 showClear 后的右内边距
$spacing-textarea-icon-right$spacing-extra-tight多行文本 clear 图标的右边距