OnsInput Directive (ons-input)

Angular directive for <ons-input> component.

An input element. The type attribute can be used to change the input type. All text input types are supported. The component will automatically render as a Material Design input on Android devices. Most attributes that can be used for a normal <input> element can also be used on the <ons-input> element.

Tutorial

Tutorial will be added soon.

See also

Name Type Description
placeholder String Placeholder text. In Material Design, this placeholder will be a floating label. Optional.
float If this attribute is present, the placeholder will be animated in Material Design. Optional.
type String

Specify the input type. This is the same as the “type” attribute for normal inputs. It expects strict text types such as text, password, etc. For checkbox, radio button, select or range, please have a look at the corresponding elements. Please take a look at MDN for an exhaustive list of possible values. Depending on the platform and browser version some of these might not work.

Optional.
input-id String Specify the “id” attribute of the inner <input> element. This is useful when using <label for="..."> elements. Optional.
Name Description
value The current value of the input.
disabled Whether the input is disabled or not.
Name Description
material Displays a Material Design input.
underbar Displays a horizontal line underneath a text input.
transparent Displays a transparent input. Works for Material Design.
Signature Description
focus() Focuses the input.
blur() Removes focus from the input.
focus()

Focuses the input.

blur()

Removes focus from the input.

Inputs

Name Type Description
value {string} Input value for the internal <input> element.

Outputs

Name Type Description
valueChange {string} Triggers when the value is changed.

Need Help?

If you have any questions, use our Community Forum or talk to us on Discord chat. The Onsen UI team and your peers in the community will work together to help solve your issues.

For bug reports and feature requests use our GitHub Issues page.