You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`boundaryOffset`|`{ x: number; y: number } \| ((root: HTMLElement) => { x: number; y: number })`|`defaultBoundaryOffset`| Inset in pixels from the leading and trailing edges of the viewport used when scrolling items into view with prev/next buttons. The default implementation reads the content fade size from the viewport so items are never scrolled behind the fade. Pass a plain object or a function receiving the root element and returning `{ x, y }` to override. |
63
63
|`ref`|`Ref<HTMLDivElement>`| — | Forwarded ref to the root `<div>`. |
64
64
|`...props`|`ComponentPropsWithoutRef<"div">`| — | All standard `<div>` props (`className`, `style`, `children`, etc.). |
|`scrollSnapType`|`CSSProperties["scrollSnapType"]`| — | CSS `scroll-snap-type` value applied to the container (e.g. `"x mandatory"`). Snapping is coordinated with the momentum animation so the carousel always lands on a snap point. |
76
76
|`contentFade`|`boolean`|`true`| When `true`, a mask-image fade is applied to both edges of the viewport. The fade appears only when there is scrollable content in that direction. |
77
77
|`contentFadeSize`|`string \| number`|`"clamp(16px, 10vw, 64px)"`| Width of the content fade. Accepts any CSS length string or a `number` (interpreted as `px`). Only valid when `contentFade` is `true` (or omitted). |
@@ -81,7 +81,7 @@ scrolling. Renders a `<div>` with `overflow: scroll` and hidden scrollbars.
|`data-carousel-viewport`|`""`| Always present. Used internally for boundary offset calculation. |
86
86
|`data-can-scroll`|`"forwards"`\|`"backwards"`\|`"both"`\|`"none"`| Reflects the current scrollability. Useful for styling buttons or indicators with CSS attribute selectors. |
87
87
@@ -92,7 +92,7 @@ scrolling. Renders a `<div>` with `overflow: scroll` and hidden scrollbars.
92
92
A thin wrapper that sets `width: fit-content` so items lay out in a single row. Renders a `<div>`.
|`asChild`|`boolean`|`false`| When `true`, merges all props (including `data-carousel-item` and `style`) onto the single child element via `cloneElement` instead of rendering a wrapping `<div>`. The child must be a single valid React element. |
109
109
|`ref`|`Ref<HTMLElement>`| — | Forwarded ref. When `asChild` is `true`, forwarded to the child element. |
110
110
|`...props`|`ComponentPropsWithoutRef<"div">`| — | All standard `<div>` props. `style` is merged with `will-change: transform`. |
@@ -117,7 +117,7 @@ A button that scrolls the carousel forwards by one page or to the next partially
117
117
when there is no more content to scroll forwards. Renders a `<button>`.
|`disabled`|`boolean`|`!scrollsForwards`| Overrides the automatic disabled state. Pass `false` to always keep the button enabled regardless of scroll position. |
122
122
|`onClick`|`MouseEventHandler<HTMLButtonElement>`| — | Called after the scroll action is triggered. |
123
123
|`ref`|`Ref<HTMLButtonElement>`| — | Forwarded ref to the `<button>`. |
@@ -131,7 +131,7 @@ A button that scrolls the carousel backwards by one page or to the previous part
131
131
disabled when the carousel is at the start. Renders a `<button>`.
0 commit comments