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 commitfc6bfb108634735f1657e533206c3f8702ad357d; 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'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
defaultValue | boolean | "indeterminate" | undefined | — | The value of the checkbox when it is initially rendered. Use when you do not need to control its value. |
modelValue | boolean | "indeterminate" | null | undefined | — | The controlled value of the checkbox. Can be binded with v-model. |
disabled | boolean | undefined | — | When true, prevents the user from interacting with the checkbox |
value | AcceptableValue | undefined | — | The value given as data when submitted with a name. |
id | string | undefined | — | Id of the element |
trueValue | boolean | undefined | — | The value used when the checkbox is checked. Defaults to true. |
falseValue | boolean | undefined | — | The value used when the checkbox is unchecked. Defaults to false. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
name | string | undefined | — | The name of the field. Submitted with its owning form as part of a name/value pair. |
required | boolean | undefined | — | When true, indicates that the user must set the value before the owning form can be submitted. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:modelValue | [value: boolean | "indeterminate"] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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" />',
}),
}