Products · Components

Radio

One option in a RadioGroup, with its value and the label people see.

Goes inside a RadioGroup.

Children: Nothing

Example

Radio is used inside RadioGroup:

The RadioGroup component
view.dml
<RadioGroup label="Pay with" value="{{ method }}" onChange="setMethod">
  <Radio value="mobile-money" label="Mobile money" />
  <Radio value="bank" label="Bank account" />
</RadioGroup>
controller.ts
export default definePage({
  initialState: { method: 'mobile-money' },
  mutations: {
    setMethod: (_state, event: ValueEvent) => ({ method: event.detail.value }),
  },
});

Props

PropTypeWhat it is
valuestringWhat the group's onChange sends when the person chooses this radio.
labelstring
disabledbooleanDims it, and the person can't use it.

Events

None.

Keep reading

On this page