RSCJS - React Spring Carousel JS

Shared utilities

Despite the diferences between the two carousels, there're some shared utilities that you could use while building your UI. Here's a list of utilities you could use:

Fullscreen mode

Name: enterFullscreen()
Type: (elemRef?: HTMLElement): void
Description: To enter in the fullscreen mode, just call this method. By default, carouselFragment will enter in fullscreen mode, but probably this is not what you'll want. If that's the case, you can pass a reference of the element you want to enter in fullscreen.
Name: exitFullscreen()
Type: (): void
Description: If you want to programatically exit from the fullscreen mode just call this method.

prepareThumbsData

Name: prepareThumbsData()
Type: (items: T[]): T[]
Description: If you want to hook in the process where the thumb list of items are rendered - maybe to add an extra item that is not related to the carousel items but that is needed for some particular reason - use this callback. It will receive the list of items and it should return a list of items as well.

getIsActiveItem

Name: getIsActiveItem()
Type: (id: string): boolean
Description: Get if a particular item is the current active one. You need to pass the id of the item you want to know if is the active one.

getIsAnimating

Name: getIsAnimating()
Type: (): boolean
Description: Get if the carousel is animating.

getIsDragging

Name: getIsDragging()
Type: (): boolean
Description: Get if the carousel is being dragged.

getIsFullscreen

Name: getIsFullscreen()
Type: (): boolean
Description: Get if the carousel is in fullscreen mode.

getIsNextItem

Name: getIsNextItem()
Type: (id: string): boolean
Description: Get if the item comes after the current active one. It accepts the id of the item you want to check.

getIsPrevItem

Name: getIsPrevItem()
Type: (id: string): boolean
Description: Get if the item comes before the current active one. It accepts the id of the item you want to check.