Skip to main content
Version: v1 (Current)

Radio Group

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

RadioGroup​

import { RadioGroup } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValueAcceptableValue | undefined—The controlled value of the radio item to check. Can be binded as v-model.
defaultValueAcceptableValue | undefined—The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items.
disabledboolean | undefined—When true, prevents the user from interacting with radio items.
orientationDataOrientation | undefined—The orientation of the component.
dirDirection | undefined—The reading direction of the combobox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
loopboolean | undefined—When true, keyboard navigation will loop from last item to first, and vice versa.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
namestring | undefined—The name of the field. Submitted with its owning form as part of a name/value pair.
requiredboolean | undefined—When true, indicates that the user must set the value before the owning form can be submitted.

Events​

NameTypeRequired / defaultDescription
update:modelValue[payload: AcceptableValue]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { RadioGroup, RadioGroupItem } from '.'
import { Label } from '../label'
{
render: () => ({
components: { RadioGroup, RadioGroupItem },
template: `
<RadioGroup default-value="option-one">
<RadioGroupItem value="option-one" />
<RadioGroupItem value="option-two" />
<RadioGroupItem value="option-three" />
</RadioGroup>
`,
}),
}

WithLabels​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { RadioGroup, RadioGroupItem } from '.'
import { Label } from '../label'
{
name: 'With Labels',
render: () => ({
components: { RadioGroup, RadioGroupItem, Label },
template: `
<RadioGroup default-value="comfortable">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="r1" value="default" />
<Label for="r1">Default</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="r2" value="comfortable" />
<Label for="r2">Comfortable</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="r3" value="compact" />
<Label for="r3">Compact</Label>
</div>
</RadioGroup>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { RadioGroup, RadioGroupItem } from '.'
import { Label } from '../label'
{
name: 'Showcase',
render: () => ({
components: { RadioGroup, RadioGroupItem, Label },
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Basic Radio Group</h3>
<RadioGroup default-value="option-one">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="s1" value="option-one" />
<Label for="s1">Option One</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="s2" value="option-two" />
<Label for="s2">Option Two</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="s3" value="option-three" />
<Label for="s3">Option Three</Label>
</div>
</RadioGroup>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Notification Preferences</h3>
<RadioGroup default-value="all">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="n1" value="all" />
<Label for="n1">All new messages</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="n2" value="mentions" />
<Label for="n2">Direct messages and mentions</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="n3" value="none" />
<Label for="n3">Nothing</Label>
</div>
</RadioGroup>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">With Disabled Option</h3>
<RadioGroup default-value="standard">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="d1" value="standard" />
<Label for="d1">Standard</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="d2" value="express" />
<Label for="d2">Express</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="d3" value="overnight" disabled />
<Label for="d3" class="opacity-50">Overnight (unavailable)</Label>
</div>
</RadioGroup>
</div>
</div>
`,
}),
}

RadioGroupItem​

import { RadioGroupItem } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
disabledboolean | undefined—When true, prevents the user from interacting with the radio item.
valueAcceptableValue | undefined—The value given as data when submitted with a name.
idstring | undefined——
namestring | undefined—The name of the field. Submitted with its owning form as part of a name/value pair.
requiredboolean | undefined—When true, indicates that the user must set the value before the owning form can be submitted.

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { RadioGroup, RadioGroupItem } from '.'
import { Label } from '../label'
{
render: () => ({
components: { RadioGroup, RadioGroupItem },
template: `
<RadioGroup default-value="option-one">
<RadioGroupItem value="option-one" />
<RadioGroupItem value="option-two" />
<RadioGroupItem value="option-three" />
</RadioGroup>
`,
}),
}

WithLabels​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { RadioGroup, RadioGroupItem } from '.'
import { Label } from '../label'
{
name: 'With Labels',
render: () => ({
components: { RadioGroup, RadioGroupItem, Label },
template: `
<RadioGroup default-value="comfortable">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="r1" value="default" />
<Label for="r1">Default</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="r2" value="comfortable" />
<Label for="r2">Comfortable</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="r3" value="compact" />
<Label for="r3">Compact</Label>
</div>
</RadioGroup>
`,
}),
}

Showcase​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { RadioGroup, RadioGroupItem } from '.'
import { Label } from '../label'
{
name: 'Showcase',
render: () => ({
components: { RadioGroup, RadioGroupItem, Label },
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Basic Radio Group</h3>
<RadioGroup default-value="option-one">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="s1" value="option-one" />
<Label for="s1">Option One</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="s2" value="option-two" />
<Label for="s2">Option Two</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="s3" value="option-three" />
<Label for="s3">Option Three</Label>
</div>
</RadioGroup>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">Notification Preferences</h3>
<RadioGroup default-value="all">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="n1" value="all" />
<Label for="n1">All new messages</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="n2" value="mentions" />
<Label for="n2">Direct messages and mentions</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="n3" value="none" />
<Label for="n3">Nothing</Label>
</div>
</RadioGroup>
</div>

<div>
<h3 class="text-lg font-semibold mb-4 text-white">With Disabled Option</h3>
<RadioGroup default-value="standard">
<div class="flex items-center gap-x-2">
<RadioGroupItem id="d1" value="standard" />
<Label for="d1">Standard</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="d2" value="express" />
<Label for="d2">Express</Label>
</div>
<div class="flex items-center gap-x-2">
<RadioGroupItem id="d3" value="overnight" disabled />
<Label for="d3" class="opacity-50">Overnight (unavailable)</Label>
</div>
</RadioGroup>
</div>
</div>
`,
}),
}