Carousel
import { TgCarouselComponent, TgCarouselItemDirective } from '@trademe/tangram';
Carousels allow customers to horizontally swipe or click through content. They’re visually the same as a content slider, but built using css instead of js. We would recommend using the carousel over content slider to improve performance.
Example
Behaviour
- Carousel will extend to full-width of the screen between
andsm breakpoints.ll - Next and back controls are visible from the
breakpoint. Belowmd , the controls will become visible if a cursor is hovered over the content slider.md - Above the
breakpoint, the next and back controls sit outside of the carousel page area. If your layout requires contained buttons at large breakpoints you can add thell option.inset - Scrolling can snap to the desired part of a carousel items by adding
and a position to the items.scroll-snap-align: - Add the attribute
to each item in the carousel, this allows the buttons to accurately be disabled/enabled when items are added/removed from the carousel.tgCarouselItem - Use
to decide the width of your items. Remember to include any margin size.flex