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
| Enum | Description |
|---|---|
TextInput.Sizes | Input sizes DEFAULT | MINI |
Props
info
The props of this component extend the attributes of the input element.
| Name | Type | Default | Description |
|---|---|---|---|
editable | boolean | true | Whether the input is editable |
error | string | Error message displayed if length exceeds limits | |
focusProps | Record<string, unknown> | Props for the FocusRing component | |
inputClassName | string | Input element class name | |
inputPrefix | string | Text prefix | |
inputRef | Ref<HTMLInputElement> | Input ref | |
onChange | (value: string) => void | Function ran on value change | |
prefixElement | ReactNode | Element for the prefix | |
size | TextInput.Sizes | TextInput.Sizes.DEFAULT | Define the input size |