Products · Components

RadioGroup

A set of options where the person picks one.

Put a Radio inside it for each option.

Children: Components

Example

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
valuestringThe chosen radio's value.
labelstring
disabledbooleanDims it, and the person can't use it. Default: false.

Events

EventSendsNotes
onChange{ value } in detailThe chosen radio's value.

Keep reading

On this page