Skip to main content

TextInput

Example

import { components } from "replugged";
const { FormItem, TextInput } = components;

export function Settings(): React.ReactElement {
return (
<FormItem title="Foo">
<TextInput {...util.useSetting(cfg, "foo", "bar")} />
</FormItem>
);
}

Enums

EnumDescription
TextInput.SizesInput sizes
DEFAULT | MINI

Props

info

The props of this component extend the attributes of the input element.

NameTypeDefaultDescription
editablebooleantrueWhether the input is editable
errorstringError message displayed if length exceeds limits
focusPropsRecord<string, unknown>Props for the FocusRing component
inputClassNamestringInput element class name
inputPrefixstringText prefix
inputRefRef<HTMLInputElement>Input ref
onChange(value: string) => voidFunction ran on value change
prefixElementReactNodeElement for the prefix
sizeTextInput.SizesTextInput.Sizes.DEFAULTDefine the input size