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:
Styling Customisations
These customisations can be applied through the setPostListStyles
method on the STYLES
class
Property | Type | Description |
---|---|---|
post | post | A single post object fetched from feed |
attachments | attachment | Array of attachments present in the post |
carouselStyle | ViewStyle | Style for the carousel container. |
paginationBoxStyle | ViewStyle | Style for the pagination box (where page indicators are shown). |
activeIndicatorStyle | ViewStyle | Style for the active page indicator (e.g., active dot in pagination). |
inactiveIndicatorStyle | ViewStyle | Style for the inactive page indicator (e.g., inactive dots in pagination). |
showCancel | boolean | Whether to show the cancel button for the carousel. |
onCancel | Function | Function to execute when the cancel button is pressed. |
cancelButton | CancelButton | Object to customize the cancel button's properties (see table below). |
CancelButton
Object
Property | Type | Description |
---|---|---|
text | LMTextProps | Customization for the text in the cancel button. |
icon | LMIconProps | Customization for the icon in the cancel button. |
onTap | Function | Function triggered when the cancel button is tapped. |
placement | start or end | Position of the icon or text in the cancel button. |
buttonStyle | ViewStyle | Style for the cancel button container. |
isClickable | boolean | Determines 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
}
}
}
})