ChoiceRow
ChoiceRow makes a whole row the click target for a checkbox or radio choice. The nested Checkbox or RadioGroupItem stays the real control. For a simple inline label use Label, and for a roomier card use ChoiceCard.
This example also needs: Checkbox.
Installation
Run npx nxds-cli@latest init first if nxds isn’t set up in your app yet. See Install.
Usage
Composition
Examples
With radio group
Pick one delivery speed from a RadioGroup of rows.
This example also needs: Field, RadioGroup.
Disabled
Disable the nested control to lock the choice.
With description
Add helper text with ChoiceRowDescription, wired through aria-describedby.
Props
ChoiceRow
ChoiceRow adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRowContent
ChoiceRowContent adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRowDescription
ChoiceRowDescription adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRowTitle
ChoiceRowTitle adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRow makes a whole row the click target for a checkbox or radio choice. The nested Checkbox or RadioGroupItem stays the real control. For a simple inline label use Label, and for a roomier card use ChoiceCard.
This example also needs: Checkbox.
Installation
Install these components first:
Copy and paste the following code into your project.
components/choice-row/ChoiceRow.vue components/choice-row/ChoiceRowContent.vue components/choice-row/ChoiceRowDescription.vue components/choice-row/ChoiceRowTitle.vue components/choice-row/index.ts Keep each file at the path shown above it.
Paths are relative to
packages/vue/src/. Keep the same folders under your@/root, and the imports between files work without edits.
Usage
Examples
With radio group
Pick one delivery speed from a RadioGroup of rows.
This example also needs: Field, RadioGroup.
Disabled
Disable the nested control to lock the choice.
With description
Add helper text with ChoiceRowDescription, wired through aria-describedby.
Props
ChoiceRow
ChoiceRow adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRowContent
ChoiceRowContent adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRowDescription
ChoiceRowDescription adds no props of its own; it accepts the props of the element or primitive it wraps.
ChoiceRowTitle
ChoiceRowTitle adds no props of its own; it accepts the props of the element or primitive it wraps.