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.
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.
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.
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.
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.
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
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-splitterpackage? 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
TextArea with composition
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
| Property | Description | Type | Default |
|---|---|---|---|
| addonAfter | Addon after the input: text, a Semi icon or any JSX element. | JSX.Element | - |
| addonBefore | Addon before the input: text, a Semi icon or any JSX element. | JSX.Element | - |
| borderless | Borderless mode. | boolean | false |
| clearIcon | Custom icon of the clear button, effective when showClear is true. | JSX.Element | - |
| composition | Whether to enable IME mode; onChange does not fire during a composition and fires once after it ends. | boolean | false |
| defaultValue | Initial content when the input is uncontrolled. | string | number | - |
| disabled | Whether the input is disabled. When not set, the disabled of the InputGroup it is in applies. | boolean | - |
| getValueLength | Custom string length calculation, used with maxLength and minLength. | Type(value: string) => number | - |
| hideSuffix | Hides the suffix while the clear button is shown; by default the two sit side by side. | boolean | false |
| inputRef | Receives the native input element. | Type(element: HTMLInputElement) => void | - |
| inputStyle | Style of the native input element; object keys are kebab-case and numbers need a unit. | JSX.CSSProperties | string | - |
| insetLabel | Inset 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 | - |
| insetLabelId | The id of the element around insetLabel, for aria-labelledby to reference. | string | - |
| maxLength | Maximum length. With getValueLength the length is measured and truncated by it; otherwise the native attribute applies. | number | - |
| minLength | Minimum length. With getValueLength it is converted accordingly; otherwise the native attribute applies. | number | - |
| mode | Input mode; password shows a button that reveals or hides the text. | InputMode | - |
| onBlur | Called 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 | - |
| onChange | Called when the value changes, with the new value and the event. | Type(value: string, e: InputChangeEvent) => void | - |
| onClear | Called when the clear button is clicked. | Type(e: MouseEvent) => void | - |
| onEnterPress | Called on Enter keydown; the Enter that commits an IME composition does not fire it. | Type(e: InputElementEvent<KeyboardEvent>) => void | - |
| onFocus | Called 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 | - |
| onlyBorder | The border width of the wrapper, in px. | number | - |
| placeholder | Hint text shown while the input is empty. | string | number | - |
| prefix | Prefix: text, a Semi icon or any JSX element. | JSX.Element | - |
| preventScroll | Whether the browser should avoid scrolling the document to show the newly focused element, for focus calls inside the component. | boolean | - |
| readonly | Read-only: blocks typing and hides the clear button. The native readOnly only blocks typing. | boolean | false |
| ref | Receives the wrapper div element; its focus() and blur() act on the input. | TypeRef<HTMLDivElement> | - |
| showClear | Shows a clear button when the input has content and the pointer or focus is inside the component. | boolean | false |
| showClearIgnoreDisabled | Internal property used by DatePicker: the clear button stays available while disabled. | boolean | - |
| size | Input size: large, default or small. In an InputGroup, the size of the group replaces it. | InputSize | - |
| suffix | Suffix: text, a Semi icon or any JSX element. | JSX.Element | - |
| type | The type of the native input. | string | "text" |
| validateStatus | Validation status: default, error or warning; error outputs aria-invalid. | ValidateStatus | "default" |
| value | Content 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
| Property | Description | Type | Default |
|---|---|---|---|
| autosize | Whether the height follows the content; pass { minRows, maxRows } to limit the rows. | boolean | AutosizeRow | false |
| borderless | Borderless mode. | boolean | false |
| cols | Visible width in average character widths. | number | 20 |
| composition | Whether to enable IME mode; onChange does not fire during a composition and fires once after it ends. | boolean | false |
| defaultValue | Initial content when the text area is uncontrolled. | string | - |
| disabled | Whether the text area is disabled. | boolean | - |
| disabledEnterStartNewLine | Internal property used by Chat: Enter does not start a new line, Shift + Enter does. | boolean | - |
| getValueLength | Custom string length calculation, used with maxLength, minLength and maxCount. | Type(value: string) => number | - |
| lineNumberClassName | Class name of the line number area. | string | - |
| lineNumberStart | Starting line number. | number | 1 |
| lineNumberStyle | Style of the line number area; object keys are kebab-case and numbers need a unit. | JSX.CSSProperties | - |
| maxCount | Maximum number of characters; setting it shows a counter, which turns red when exceeded. The input is not truncated. | number | - |
| maxLength | Maximum length. With getValueLength the length is measured and truncated by it; otherwise the native attribute applies. | number | - |
| minLength | Minimum length. With getValueLength it is converted accordingly; otherwise the native attribute applies. | number | - |
| onBlur | Called 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 | - |
| onChange | Called when the text changes, with the new value and the event. | Type(value: string, e: TextAreaChangeEvent) => void | - |
| onClear | Called when the clear button is clicked. | Type(e: MouseEvent) => void | - |
| onEnterPress | Called on Enter keydown; the Enter that commits an IME composition does not fire it. | Type(e: TextAreaElementEvent<KeyboardEvent>) => void | - |
| onFocus | Called 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 | - |
| onResize | Called 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 | - |
| readonly | Read-only: blocks typing and hides the clear button. The native readOnly only blocks typing. | boolean | - |
| ref | Receives the wrapper div element; its focus() and blur() act on the textarea. | TypeRef<HTMLDivElement> | - |
| resize | Whether 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' | - |
| rows | Number of visible text lines. | number | 4 |
| showClear | Shows a clear button when the text area has content and the pointer or focus is inside the component. | boolean | false |
| showCounter | Whether to show the counter; it is always shown when maxCount is set. | boolean | false |
| showLineNumber | Whether to show line numbers. | boolean | false |
| textareaRef | Receives the native textarea element; showLineNumber remounts the textarea, so it is called again with the new element. | Type(element: HTMLTextAreaElement) => void | - |
| textareaStyle | Style of the inner textarea element, such as its height; object keys are kebab-case and numbers need a unit. | JSX.CSSProperties | - |
| validateStatus | Validation status: default, error or warning; error outputs aria-invalid. | ValidateStatus | - |
| value | Text 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
| Property | Description | Type | Default |
|---|---|---|---|
| disabled | Whether the group is disabled; it applies to the controls that set no disabled of their own. | boolean | - |
| label | Label of the group, as an object with the Form.Label props such as text, required and extra; text can be a JSX element. | LabelProps | - |
| labelPosition | Label position: top or left. | 'top' | 'left' | (string & {}) | - |
| onBlur | Called when any control in the group loses focus, including a move to another control in it. | Type(e: FocusEvent) => void | - |
| onFocus | Called when any control in the group gets focus, including a move from another control in it. | Type(e: FocusEvent) => void | - |
| size | Input 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
buttonnamed 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 nodisabled(or withshowClearIgnoreDisabled), the clear button is a nativebuttonnamed "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
| Sass variable | Value | Usage |
|---|---|---|
| $transition_duration-input-bg | var(--semi-transition_duration-none) | 输入框-背景色-动画持续时间 |
| $transition_function-input-bg | var(--semi-transition_function-easeIn) | 输入框-背景色-过渡曲线 |
| $transition_delay-input-bg | var(--semi-transition_delay-none) | 输入框-背景色-延迟时间 |
| $transition_duration-input-border | var(--semi-transition_duration-none) | 输入框-边框-动画持续时间 |
| $transition_function-input-border | var(--semi-transition_function-easeIn) | 输入框-边框-过渡曲线 |
| $transition_delay-input-border | var(--semi-transition_delay-none) | 输入框-边框-延迟时间 |
| $transform_scale-input | var(--semi-transform_scale-none) | 输入框-变大 |
| $color-input_default-border-default | transparent | 输入框描边颜色 - 默认 |
| $color-input_default-bg-default | var(--semi-color-fill-0) | 输入框背景颜色 - 默认 |
| $color-input_default-text-default | var(--semi-color-text-0) | 输入框文本颜色 - 默认 |
| $color-input_default-bg-hover | var(--semi-color-fill-1) | 输入框背景颜色 - 悬浮 |
| $color-input_default-border-hover | transparent | 输入框描边颜色 - 悬浮 |
| $color-input_default-bg-active | var(--semi-color-fill-2) | 输入框背景颜色 - 按下 |
| $color-input_default-bg-focus | var(--semi-color-fill-0) | 输入框背景颜色 - 选中 |
| $color-input_default-border-focus | var(--semi-color-focus-border) | 输入框描边颜色 - 选中 |
| $color-input_default-bg-focus-hover | $color-input_default-bg-focus | 输入框背景颜色 - 选中悬浮 |
| $color-input_danger-bg-default | var(--semi-color-danger-light-default) | 错误输入框背景颜色 - 默认 |
| $color-input_danger-border-default | var(--semi-color-danger-light-default) | 错误输入框描边颜色 - 默认 |
| $color-input_danger-bg-hover | var(--semi-color-danger-light-hover) | 错误输入框背景颜色 - 悬浮 |
| $color-input_danger-border-hover | var(--semi-color-danger-light-hover) | 错误输入框描边颜色 - 悬浮 |
| $color-input_danger-bg-focus | var(--semi-color-danger-light-default) | 错误输入框背景颜色 - 选中 |
| $color-input_danger-border-focus | var(--semi-color-danger) | 错误输入框描边颜色 - 选中 |
| $color-input_danger-bg-active | var(--semi-color-danger-light-active) | 错误输入框背景颜色 - 按下 |
| $color-input_warning-bg-default | var(--semi-color-warning-light-default) | 警告输入框背景颜色 - 默认 |
| $color-input_warning-border-default | var(--semi-color-warning-light-default) | 警告输入框文本颜色 - 默认 |
| $color-input_warning-bg-hover | var(--semi-color-warning-light-hover) | 警告输入框背景颜色 - 悬浮 |
| $color-input_warning-border-hover | var(--semi-color-warning-light-hover) | 警告输入框描边颜色 - 悬浮 |
| $color-input_warning-bg-focus | var(--semi-color-warning-light-default) | 警告输入框背景颜色 - 选中 |
| $color-input_warning-border-focus | var(--semi-color-warning) | 警告输入框描边颜色 - 选中 |
| $color-input_warning-bg-active | var(--semi-color-warning-light-active) | 警告输入框背景颜色 - 按下 |
| $color-input_disabled-bg-default | var(--semi-color-disabled-fill) | 禁用输入框背景颜色 |
| $color-input_disabled-text-default | var(--semi-color-disabled-text) | 禁用输入框文字颜色 |
| $color-input_placeholder-text-default | var(--semi-color-text-2) | 输入框占位文字颜色 |
| $color-input_prefix-text-default | var(--semi-color-text-2) | 输入框 prefix 文字颜色 |
| $color-input-icon-default | var(--semi-color-text-2) | 输入框图标颜色 |
| $color-input-icon-hover | var(--semi-color-primary-hover) | 输入框图标颜色 - 悬浮 |
| $color-input_counter-text-default | var(--semi-color-text-2) | 多行文本字数统计文字颜色 - 未超限 |
| $color-input_counter_danger-text-default | var(--semi-color-danger) | 多行文本字数统计文字颜色 - 未超限 |
| $color-input_group-border-default | var(--semi-color-border) | 输入框组合分割线颜色 |
| $color_input-default-border-only_border-default | var(--semi-color-border) | 只有描边的输入框描边颜色 - 默认 |
| $color_input-default-border-only_border-hover | var(--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-tight | suffix 之前的清除按钮宽度 |
| $width-input-icon_clear_before_modebtn | $width-icon-medium | 密码之前的清除按钮宽度 |
| $motion-scale_size-active | 0.97 | |
| $motion-scale_size-inactive | 1 | |
| $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_wrapper | var(--semi-border-radius-small) | 输入框圆角大小 |
| $spacing-input-paddingLeft | $spacing-base-tight | 输入光标距离容器的左侧内边距 |
| $spacing-input-paddingRight | $spacing-base-tight | 输入文字距离容器的右侧内边距 |
| $spacing-input_prefix_suffix-marginX | $spacing-base-tight | prefix/suffix 水平外边距 |
| $spacing-input_prefix_icon-marginY | 0 | prefix 图标垂直内边距 |
| $spacing-input_prefix_icon-marginX | $spacing-tight | prefix 图标水平内边距 |
| $spacing-input_prepend-paddingY | 0 | 前置标签垂直内边距 |
| $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-bold | prefix/suffix 文字字重 |
| $spacing-textarea-paddingY | 5px | 多行文本垂直内边距 |
| $spacing-textarea-paddingX | $spacing-base-tight | 多行文本水平内边距 |
| $spacing-textarea_counter-paddingTop | 3px | 多行文本字数统计顶部内边距 |
| $spacing-textarea_counter-paddingRight | 12px | 多行文本字数统计右侧内边距 |
| $spacing-textarea_counter-paddingBottom | 5px | 多行文本字数统计底部内边距 |
| $spacing-textarea_counter-paddingLeft | 12px | 多行文本字数统计左侧内边距 |
| $width-textarea-border | $border-thickness | 多行文本描边宽度 |
| $height-textarea_counter | 32px | 多行文本字数统计最小高度 |
| $color-textarea-border-default | transparent | 多行文本描边颜色 |
| $color-textarea-border-hover | $color-textarea-border-default | 多行文本描边颜色 - 悬浮 |
| $color-textarea-icon-default | var(--semi-color-text-2) | 多行文本 clear 图标颜色 |
| $color-textarea-icon-hover | var(--semi-color-primary-hover) | 多行文本 clear 图标颜色 - 悬浮 |
| $width-textarea-icon | $width-icon-medium + $spacing-tight | clear 图标最小宽度 |
| $height-textarea-default | 32px | 多行文本 clear 图标的高度 |
| $spacing-textarea_withShowClear-paddingRight | 36px | 多行文本设置 showClear 后的右内边距 |
| $spacing-textarea-icon-right | $spacing-extra-tight | 多行文本 clear 图标的右边距 |