A carousel layout layouts panels so only one of the panel contents is visible at a time, and you can navigate through them using keyboard button, swipe, ….

  • Fluent
  • Declarative

        CarouselLayout.builder()
                      .content(List.of(
                              buildPanel(),
                              buildPanel()
                      ))
                      .nav(true)
                      .dots(true)
                      .loop(true)
                      .style("--skeleton-carousel-min-height: 9rem;")
                      .build()

    @CarouselLayout
    List panels = List.of(
        new Text("Panel 1"),
        new Text("Panel 2"),
        new Text("Panel 3")
      );

or


    @CarouselLayout
    class Container {
        
      Object panel1 = new Text("Panel 1");
      Object panel2 = new Text("Panel 2");
      Object panel3 = new Text("Panel 3");
      
    }

Available properties

This is the list of available properties for an accordion layout:

PropertyDescriptionNotes
idid for this component
cssClasseslist of css classescontent of the css attribute
styleinline style attributescontent of the style attribute
fullWidthshortcut to set width:100%true/false
altFlips the position of the navigation. Puts the navigation at the top of the carousel for the horizontal layout and to the left for the vertical layout.true/false
animatingRead-only value that indicates if the carousel is been animated (Transition).true/false
autoChange slides automatically.true/false
directionCarousel direction (horizontal or vertical).horizontal/vertical
disabledDisables component.true/false
disable-swipeDisables swipe functionality.true/false
disable-keysDisables keyboard navigation.number
durationAutoplay interval time in milliseconds (Default: 4000)true/false
dotsShow navigation dots.true/false
endDetail returns true when the carousel has reached the last slide.true/false
loopDetermines if the carousel should be looped. This affects the controls and the drag and drop functionality. Set to true if you need to loop the slides.true/false
navShow navigation next/prev buttons.true/false
selectedSelected slide (Starts at 0)number

You can see a full explanation of those properties at https://github.com/FabricElements/skeleton-carousel