Scroll Area
Consistent scroll area across platforms.
Structure
API Reference
The container of all scroll area components. Overflow is hidden on this element to prevent double scrollbars.
Property | Type | Description |
---|---|---|
type | enum | The type of scroll area. Default:
undefined |
hideDelay | number | The delay in milliseconds before the scroll area hides itself when using Default:
600 |
dir | enum | The reading direction of the scroll area. Default:
undefined |
asChild | boolean | Whether to use render delegation with this component or not. Default:
false |
el | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to programatically interact with the element. Default:
undefined |
Slot Property | Type | Description |
---|---|---|
builder | object | The builder attributes and actions to apply to the element if using the |
Data Attribute | Value | Description |
---|---|---|
data-scroll-area-root | —— | Present on the root element. |
The component which wraps the content and is responsible for computing the scroll area size.
Property | Type | Description |
---|---|---|
asChild | boolean | Whether to use render delegation with this component or not. Default:
false |
el | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to programatically interact with the element. Default:
undefined |
Slot Property | Type | Description |
---|---|---|
builder | object | The builder attributes and actions to apply to the element if using the |
Data Attribute | Value | Description |
---|---|---|
data-scroll-area-viewport | —— | Present on the viewport element. |
The scrollable content of the scroll area.
Property | Type | Description |
---|---|---|
asChild | boolean | Whether to use render delegation with this component or not. Default:
false |
el | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to programatically interact with the element. Default:
undefined |
Slot Property | Type | Description |
---|---|---|
builder | object | The builder attributes and actions to apply to the element if using the |
Data Attribute | Value | Description |
---|---|---|
data-scroll-area-content | —— | Present on the content element. |
A scrollbar of the scroll area.
Property | Type | Description |
---|---|---|
orientation * Required | enum | The orientation of the scrollbar. Default:
undefined |
asChild | boolean | Whether to use render delegation with this component or not. Default:
false |
el | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to programatically interact with the element. Default:
undefined |
Slot Property | Type | Description |
---|---|---|
builder | object | The builder attributes and actions to apply to the element if using the |
Data Attribute | Value | Description |
---|---|---|
data-state | enum | The visibility state of the scrollbar |
data-scroll-area-scrollbar-x | —— | Present on |
data-scroll-area-scrollbar-y | —— | Present on the |
A thumb of a scrollbar in the scroll area.
Property | Type | Description |
---|---|---|
asChild | boolean | Whether to use render delegation with this component or not. Default:
false |
el | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to programatically interact with the element. Default:
undefined |
Slot Property | Type | Description |
---|---|---|
builder | object | The builder attributes and actions to apply to the element if using the |
Data Attribute | Value | Description |
---|---|---|
data-state | enum | The visibility state of the scrollbar |
data-scroll-area-thumb-x | —— | Present on |
data-scroll-area-thumb-y | —— | Present on the |
The corner element between the X and Y scrollbars.
Property | Type | Description |
---|---|---|
asChild | boolean | Whether to use render delegation with this component or not. Default:
false |
el | HTMLDivElement | The underlying DOM element being rendered. You can bind to this to programatically interact with the element. Default:
undefined |
Slot Property | Type | Description |
---|---|---|
builder | object | The builder attributes and actions to apply to the element if using the |
Data Attribute | Value | Description |
---|---|---|
data-scroll-area-corner | —— | Present on the corner element. |