Angular directive for <ons-search-input>
component.
A search input element. The component will automatically render as a Material Design search input on Android devices.
Most attributes that can be used for a normal <input>
element can also be used on the <ons-search-input>
element.
Even though ons-input
supports type="search"
, Onsen UI provides an extra element ons-search-input
that styles the input as a real search bar:
<ons-search-input placeholder="Search something"></ons-search-input>
As usual, any attribute for <input>
element works for the search input (except type
which is fixed to search
).
For normal input elements is possible to define a <label>
tab with the for
attribute to link it to an input element.
Unfortunately this does not work with custom elements like <ons-label>
so in order to do it we need to set the id
attribute of the inner input element. This is done using the input-id
attribute.
<label for="username">Username</label>
<ons-input input-id="username"></ons-input>
This work with any input in Onsen UI such as checkboxes, radios, etc.
modifier
attribute<ons-input>
element is used to display a text input.<ons-range>
element is used to display a range slider.<ons-switch>
element is used to display a draggable toggle switch.<ons-select>
element is used to display a select box.<ons-checkbox>
element is used to display a checkbox.<ons-radio>
element is used to display a radio button.Name | Type | Description |
---|---|---|
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 search input. |
Signature | Description |
---|---|
focus() | Focuses the input. |
blur() | Removes focus from the input. |
Focuses the input.
Removes focus from the input.
Name | Type | Description |
---|---|---|
value |
Input value for the internal <input> element.
|
Name | Type | Description |
---|---|---|
valueChange | Triggers when the value is changed. |
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.