v-ons-radio

A radio button element. The component will automatically render as a Material Design radio button on Android devices. Most attributes that can be used for a normal <input type="radio"> element can also be used on the <ons-radio> element.

Tutorial

Radio buttons

Radio button elements are created using the VOnsRadio component. It works almost exactly the same as a normal <input type="radio"> tag.

An attribute input-id is provided to set the ID of the inner native element. This is useful for HTMLLabel elements: <label for="some-inner-input">.

Using v-model

Every input is compatible with v-model directive. Checkboxes can be bound to arrays or booleans normally. The only exception are modifiers. There is, however, a workaround for lazy modifier:

<v-ons-input v-model="something" model-event="change"></v-ons-input>

This will use change event instead of input when updating v-model.

See also

Name Type Description
inputId String Specify the “id” attribute of the inner <input> element. This is useful when using <label for="..."> elements. Optional.
modelEvent Boolean The native event which should trigger the update:modelValue event. Optional.
modelValue Boolean Whether the radio button is checked or not. Optional.
Name Description
material Displays a Material Design radio button.
Name Description
update:modelValue Fired right after the event set in the modelEvent prop.
update:modelValue

Fired right after the event set in the modelEvent prop.

Parameters
Name Type Description

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.