Skip to content

TextInput

The TextInput component renders a Bulma input field with optional field/label/control wrappers, icons, and help text.

<TextInput name="username" label="Username" placeholder="Enter your username" />
<TextInput name="email" label="Email" type="email" placeholder="you@example.com" />
<TextInput name="password" label="Password" type="password" />
<TextInput name="birthday" label="Birthday" type="date" />
<TextInput name="amount" label="Amount" type="number" min="0" max="100" />
<TextInput name="ok" label="Success" color="success" value="Looks good" />
<TextInput name="err" label="Danger" color="danger" value="Invalid input" />
<TextInput name="warn" label="Warning" color="warning" />
<TextInput
name="email"
label="Email"
type="email"
iconLeft="fa-envelope"
placeholder="you@example.com"
/>
<TextInput
name="search"
label="Search"
iconLeft="fa-search"
iconRight="fa-times"
placeholder="Search…"
/>

Only letters and numbers.

This address is already taken.

<TextInput name="username" label="Username" help="Only letters and numbers." />
<TextInput
name="email"
label="Email"
type="email"
help="This address is already taken."
helpColor="danger"
/>
<TextInput name="sm" label="Small" size="small" />
<TextInput name="nm" label="Normal" />
<TextInput name="md" label="Medium" size="medium" />
<TextInput name="lg" label="Large" size="large" />
<TextInput name="search" label="Search" rounded placeholder="Search…" iconLeft="fa-search" />
<TextInput name="locked" label="Disabled" disabled value="Can't change this" />
<TextInput name="ro" label="Read-only" readonly value="Read only" />

Use standalone when composing inputs inside a Bulma has-addons or is-grouped layout:

<div class="field has-addons">
<div class="control is-expanded">
<TextInput name="url" type="url" standalone placeholder="https://…" />
</div>
<div class="control">
<button class="button is-info">Go</button>
</div>
</div>
PropTypeDefaultDescription
namestringRequired. name attribute.
idstringnameid attribute; defaults to name.
type"text" | "email" | "password" | "tel" | "url" | "number" | "search" | "date" | "time""text"Input type.
labelstringLabel text; renders field/label/control wrappers.
placeholderstringPlaceholder text.
valuestring | numberInitial value.
requiredbooleanRequired field.
disabledbooleanDisabled state.
readonlybooleanRead-only state.
color"primary" | "link" | "info" | "success" | "warning" | "danger"Bulma color modifier.
size"small" | "normal" | "medium" | "large"Size modifier.
roundedbooleanRounded input style.
staticbooleanStatic style (.is-static).
iconLeftstringFA icon name for left icon.
iconLeftVariant"fas" | "far" | "fab""fas"Variant for left icon.
iconRightstringFA icon name for right icon.
iconRightVariant"fas" | "far" | "fab""fas"Variant for right icon.
helpstringHelp text below the control.
helpColor"primary" | "link" | "info" | "success" | "warning" | "danger"Color for help text.
standalonebooleanRender only <input>, no field/label/control wrappers.
classstringExtra classes on the <input>.
controlClassstringExtra classes on the control div.
formstringAssociates input with a <form> by id.
...*Other native input attributes (min, max, pattern, etc.).