Popover
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.
Popover
import { Popover } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
defaultOpen | boolean | undefined | — | The open state of the popover when it is initially rendered. Use when you do not need to control its open state. |
open | boolean | undefined | — | The controlled open state of the popover. |
modal | boolean | undefined | — | The modality of the popover. When set to true, interaction with outside elements will be disabled and only popover content will be visible to screen readers. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:open | [value: boolean] | — | — |
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 { Popover, PopoverContent, PopoverTrigger } from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: { Popover, PopoverContent, PopoverTrigger, Button, Input, Label },
template: `
<Popover>
<PopoverTrigger as-child>
<Button variant="outline">Open popover</Button>
</PopoverTrigger>
<PopoverContent class="w-80">
<div class="grid gap-4">
<div class="space-y-2">
<h4 class="font-medium leading-none text-foreground">Dimensions</h4>
<p class="text-sm text-muted-foreground">
Set the dimensions for the layer.
</p>
</div>
<div class="grid gap-2">
<div class="grid grid-cols-3 items-center gap-4">
<Label for="width">Width</Label>
<Input id="width" default-value="100%" class="col-span-2 h-8" />
</div>
<div class="grid grid-cols-3 items-center gap-4">
<Label for="height">Height</Label>
<Input id="height" default-value="25px" class="col-span-2 h-8" />
</div>
</div>
</div>
</PopoverContent>
</Popover>
`,
}),
}
PopoverContent
import { PopoverContent } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
memoDependencies | unknown[] | undefined | — | Reactive dependencies that should invalidate the memoized content subtree. |
side | "top" | "right" | "bottom" | "left" | undefined | — | The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. |
sideOffset | number | undefined | 4 | The distance in pixels from the trigger. |
sideFlip | boolean | undefined | — | Flip to the opposite side when colliding with boundary. |
align | "start" | "center" | "end" | undefined | "center" | The preferred alignment against the trigger. May change when collisions occur. |
alignOffset | number | undefined | — | An offset in pixels from the start or end alignment options. |
alignFlip | boolean | undefined | — | Flip alignment when colliding with boundary. May only occur when prioritizePosition is true. |
avoidCollisions | boolean | undefined | — | When true, overrides the side and align preferences to prevent collisions with boundary edges. |
collisionBoundary | Element | (Element | null)[] | null | undefined | — | The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check. |
collisionPadding | number | Partial<Record<"top" | "right" | "bottom" | "left", number>> | undefined | — | The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { top: 20, left: 20 }. |
arrowPadding | number | undefined | — | The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. |
hideShiftedArrow | boolean | undefined | — | When true, hides the arrow when it cannot be centered to the reference element. |
sticky | "partial" | "always" | undefined | — | The sticky behavior on the align axis. partial will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless. |
hideWhenDetached | boolean | undefined | — | Whether to hide the content when the trigger becomes fully occluded. |
positionStrategy | "absolute" | "fixed" | undefined | — | The type of CSS position property to use. |
updatePositionStrategy | "always" | "optimized" | undefined | — | Strategy to update the position of the floating element on every animation frame. |
disableUpdateOnLayoutShift | boolean | undefined | — | Whether to disable the update position for the content when the layout shifted. |
prioritizePosition | boolean | undefined | — | Force content to be position within the viewport. Might overlap the reference element, which may not be desired. |
reference | ReferenceElement | undefined | — | The custom element or virtual element that will be set as the reference to position the floating element. If provided, it will replace the default anchor element. |
dir | Direction | undefined | — | The reading direction of the popper content when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode. |
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. |
disableOutsidePointerEvents | boolean | undefined | — | When true, hover/focus/click interactions will be disabled on elements outside the DismissableLayer. Users will need to click twice on outside elements to interact with them: once to close the DismissableLayer, and again to trigger the element. |
portalTo | string | HTMLElement | undefined | — | — |
disablePortal | boolean | undefined | — | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
escapeKeyDown | [event: KeyboardEvent] | — | — |
pointerDownOutside | [event: PointerDownOutsideEvent] | — | — |
focusOutside | [event: FocusOutsideEvent] | — | — |
interactOutside | [event: PointerDownOutsideEvent | FocusOutsideEvent] | — | — |
openAutoFocus | [event: Event] | — | — |
closeAutoFocus | [event: Event] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
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 { Popover, PopoverContent, PopoverTrigger } from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: { Popover, PopoverContent, PopoverTrigger, Button, Input, Label },
template: `
<Popover>
<PopoverTrigger as-child>
<Button variant="outline">Open popover</Button>
</PopoverTrigger>
<PopoverContent class="w-80">
<div class="grid gap-4">
<div class="space-y-2">
<h4 class="font-medium leading-none text-foreground">Dimensions</h4>
<p class="text-sm text-muted-foreground">
Set the dimensions for the layer.
</p>
</div>
<div class="grid gap-2">
<div class="grid grid-cols-3 items-center gap-4">
<Label for="width">Width</Label>
<Input id="width" default-value="100%" class="col-span-2 h-8" />
</div>
<div class="grid grid-cols-3 items-center gap-4">
<Label for="height">Height</Label>
<Input id="height" default-value="25px" class="col-span-2 h-8" />
</div>
</div>
</div>
</PopoverContent>
</Popover>
`,
}),
}
PopoverTrigger
import { PopoverTrigger } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
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 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 { Popover, PopoverContent, PopoverTrigger } from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: { Popover, PopoverContent, PopoverTrigger, Button, Input, Label },
template: `
<Popover>
<PopoverTrigger as-child>
<Button variant="outline">Open popover</Button>
</PopoverTrigger>
<PopoverContent class="w-80">
<div class="grid gap-4">
<div class="space-y-2">
<h4 class="font-medium leading-none text-foreground">Dimensions</h4>
<p class="text-sm text-muted-foreground">
Set the dimensions for the layer.
</p>
</div>
<div class="grid gap-2">
<div class="grid grid-cols-3 items-center gap-4">
<Label for="width">Width</Label>
<Input id="width" default-value="100%" class="col-span-2 h-8" />
</div>
<div class="grid grid-cols-3 items-center gap-4">
<Label for="height">Height</Label>
<Input id="height" default-value="25px" class="col-span-2 h-8" />
</div>
</div>
</div>
</PopoverContent>
</Popover>
`,
}),
}