Skip to main content
Version: v1 (Current)

Checkbox

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.

Checkbox​

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

Repository source

Props​

NameTypeRequired / defaultDescription
defaultValueboolean | "indeterminate" | undefined—The value of the checkbox when it is initially rendered. Use when you do not need to control its value.
modelValueboolean | "indeterminate" | null | undefined—The controlled value of the checkbox. Can be binded with v-model.
disabledboolean | undefined—When true, prevents the user from interacting with the checkbox
valueAcceptableValue | undefined—The value given as data when submitted with a name.
idstring | undefined—Id of the element
trueValueboolean | undefined—The value used when the checkbox is checked. Defaults to true.
falseValueboolean | undefined—The value used when the checkbox is unchecked. Defaults to false.
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[value: boolean | "indeterminate"]——

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 { Checkbox } from '.'
import { Label } from '../label'
{
render: (args) => ({
components: { Checkbox },
setup() {
return { args }
},
template: '<Checkbox v-bind="args" />',
}),
}

WithLabel​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Checkbox } from '.'
import { Label } from '../label'
{
name: 'With Label',
render: () => ({
components: { Checkbox, Label },
template: `
<div class="flex items-center gap-2">
<Checkbox id="terms" />
<Label for="terms">Accept terms and conditions</Label>
</div>
`,
}),
}

Checked​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Checkbox } from '.'
import { Label } from '../label'
{
name: 'Checked',
render: () => ({
components: { Checkbox },
template: '<Checkbox :default-value="true" />',
}),
}