Materialish

Input

An input is a standalone text input that allows a user to provide or edit a text value.

🙌 Heads up! This code is editable. The preview above will update to reflect your changes.

Usage

import { Input } from 'materialish';
import 'materialish/materialish.css';

Props

Prop NameDefault ValueDescription
classNameAdditional class name(s) to add to the input
errorfalseWhether or not the input is in an invalid state
clearablefalsePass true to display a button to clear the input when there is text
onClearA function that is called when the user clicks the clear button (see the clearable prop)
iconAn optional Icon to display on the left side of the input
nodeRefPass a ref to get access to the input element
...restOther props are placed on the root input element

CSS Variables

VariableDefault ValueDescription
--mt-baseFontSize1remThe text size and dimensions of the input are based off of this value
--mt-fontFamily'Roboto'The font family to use for the input text
--mt-input-focusBorderColor--mt-mainColor, #4a8fe2The border color to use when the input is focused

Useful Links