Skip to main content

InputBase

Simple building block for creating an input which comes with basic default styles (colors, rounded borders).

InputBase Example

Importโ€‹

import { InputBase } from "~~/components/scaffold-stark";

Usageโ€‹

const [url, setUrl] = useState<string>();

<InputBase name="url" placeholder="url" value={url} onChange={setUrl} />;

Propsโ€‹

PropTypeDefault ValueDescription
valuestringundefinedThe data that your input will show.
onChangefunctionundefinedA callback invoked when the data in the input changes.
placeholder (optional)stringundefinedThe string that will be rendered before input data has been entered.
name (optional)stringundefinedHelps identify the data being sent if InputBase is submitted into a form.
error (optional)booleanfalseWhen set to true, changes input border to have error styling.
disabled (optional)booleanfalseWhen set to true, changes input background color and border to have disabled styling.
prefix (optional)ReactNodefalseElement to be rendered at the start of the input, typically an icon or label.
suffix (optional)ReactNodefalseElement to be rendered at the end of the input, typically an icon or button.
reFocus (optional)booleanfalseWhen set to true, focuses the input and sets the cursor at the end of the input text on each render.