Scroll Area
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.
ScrollArea
import { ScrollArea } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
type | ScrollType | undefined | — | Describes the nature of scrollbar visibility, similar to how the scrollbar preferences in MacOS control visibility of native scrollbars. auto - means that scrollbars are visible when content is overflowing on the corresponding orientation. <br> always - means that scrollbars are always visible regardless of whether the content is overflowing.<br> scroll - means that scrollbars are visible when the user is scrolling along its corresponding orientation.<br> hover - when the user is scrolling along its corresponding orientation and when the user is hovering over the scroll area.<br> glimpse - a hybrid approach that briefly shows scrollbars when the user enters the scroll area, then hides them until further interaction. |
dir | Direction$2 | undefined | — | The reading direction of the combobox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode. |
scrollHideDelay | number | undefined | — | If type is set to either scroll or hover, this prop determines the length of time, in milliseconds, <br> before the scrollbars are hidden after the user stops interacting with scrollbars. |
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 { ScrollArea, ScrollBar } from '.'
{
render: () => ({
components: { ScrollArea },
setup() {
const tags = Array.from({ length: 50 }, (_, i) => `v1.${i}.0-beta`)
return { tags }
},
template: `
<ScrollArea class="h-72 w-48 rounded-md border">
<div class="p-4">
<h4 class="mb-4 text-sm font-medium leading-none">Tags</h4>
<div v-for="tag in tags" :key="tag" class="text-sm py-1">
{{ tag }}
</div>
</div>
</ScrollArea>
`,
}),
}
Horizontal
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ScrollArea, ScrollBar } from '.'
{
name: 'Horizontal',
render: () => ({
components: { ScrollArea, ScrollBar },
setup() {
const items = Array.from({ length: 20 }, (_, i) => ({
title: `Item ${i + 1}`,
artist: `Artist ${i + 1}`,
}))
return { items }
},
template: `
<ScrollArea class="w-96 whitespace-nowrap rounded-md border">
<div class="flex w-max space-x-4 p-4">
<div v-for="item in items" :key="item.title" class="w-[150px] shrink-0">
<div class="h-[150px] rounded-md bg-muted flex items-center justify-center">
<span class="text-sm text-muted-foreground">{{ item.title }}</span>
</div>
<div class="mt-2">
<p class="text-sm font-medium">{{ item.title }}</p>
<p class="text-xs text-muted-foreground">{{ item.artist }}</p>
</div>
</div>
</div>
<ScrollBar orientation="horizontal" />
</ScrollArea>
`,
}),
}
ScrollBar
import { ScrollBar } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
orientation | "horizontal" | "vertical" | undefined | "vertical" | The orientation of the scrollbar |
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
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. |
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.
Horizontal
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ScrollArea, ScrollBar } from '.'
{
name: 'Horizontal',
render: () => ({
components: { ScrollArea, ScrollBar },
setup() {
const items = Array.from({ length: 20 }, (_, i) => ({
title: `Item ${i + 1}`,
artist: `Artist ${i + 1}`,
}))
return { items }
},
template: `
<ScrollArea class="w-96 whitespace-nowrap rounded-md border">
<div class="flex w-max space-x-4 p-4">
<div v-for="item in items" :key="item.title" class="w-[150px] shrink-0">
<div class="h-[150px] rounded-md bg-muted flex items-center justify-center">
<span class="text-sm text-muted-foreground">{{ item.title }}</span>
</div>
<div class="mt-2">
<p class="text-sm font-medium">{{ item.title }}</p>
<p class="text-xs text-muted-foreground">{{ item.artist }}</p>
</div>
</div>
</div>
<ScrollBar orientation="horizontal" />
</ScrollArea>
`,
}),
}