Skip to main content

Carousel

Overview

The LMCarousel component is designed to display a horizontal carousel of media items. It allows users to swipe through images or videos effortlessly. The component supports various media formats and provides customization options for pagination, autoplay, and item styling, enhancing the user experience in applications that showcase multimedia content.

GitHub File:

LMFeedPostContent

Styling Customisations

These customisations can be applied through the setPostListStyles method on the STYLES class

PropertyTypeDescription
postpostA single post object fetched from feed
attachmentsattachmentArray of attachments present in the post
carouselStyleViewStyleStyle for the carousel container.
paginationBoxStyleViewStyleStyle for the pagination box (where page indicators are shown).
activeIndicatorStyleViewStyleStyle for the active page indicator (e.g., active dot in pagination).
inactiveIndicatorStyleViewStyleStyle for the inactive page indicator (e.g., inactive dots in pagination).
showCancelbooleanWhether to show the cancel button for the carousel.
onCancelFunctionFunction to execute when the cancel button is pressed.
cancelButtonCancelButtonObject to customize the cancel button's properties (see table below).

CancelButton Object

PropertyTypeDescription
textLMTextPropsCustomization for the text in the cancel button.
iconLMIconPropsCustomization for the icon in the cancel button.
onTapFunctionFunction triggered when the cancel button is tapped.
placementstart or endPosition of the icon or text in the cancel button.
buttonStyleViewStyleStyle for the cancel button container.
isClickablebooleanDetermines if the cancel button is clickable.

Usage Example

import {STYLES} from "@likeminds.community/feed-rn-core"

STYLES.setPostListStyles({
media: {
carousel: {
carouselStyle: {
backgroundColor: 'black',
showCancel: false
}
}
}
})