Label
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.
Label
import { Label } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
for | string | undefined | — | The id of the element the label is associated with. |
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. |
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 { Label } from '.'
{
render: (args) => ({
components: { Label },
setup() {
return { args }
},
template: '<Label v-bind="args">Email Address</Label>',
}),
}
WithInput
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Label } from '.'
{
name: 'With Input (Peer Disabled)',
render: () => ({
components: { Label },
template: `
<div class="space-y-4">
<div class="flex items-center gap-2">
<input id="enabled" type="text" class="peer border rounded px-2 py-1" placeholder="Enabled input" />
<Label for="enabled">Enabled Label</Label>
</div>
<div class="flex items-center gap-2">
<input id="disabled" type="text" class="peer border rounded px-2 py-1" placeholder="Disabled input" disabled />
<Label for="disabled">Disabled Label (peer-disabled styles applied)</Label>
</div>
</div>
`,
}),
}