Skip to main content

Flet simple carousel sliders

This project is a carousel sliders pack with different types for the Flet framework. This project is under development, so in the future, different types of sliders will be added to the project.

Installation

pip install fletcarousel

or

git clone https://github.com/naderidev/flet-carousel

How to use

There are some types of sliders, so in the following, we will explain each type of them.

BasicHorizontalCarousel

This type of slider is the basic one. This type is horizontal and there are two buttons to control slides.

Screenshot of the app

for example:

BasicHorizontalCarousel(
    page=page,
    items_count=3,
    # auto_cycle=AutoCycle(duration=1),
    items=[
        Container(
            content=Text(value=str(i), size=20),
            height=200,
            width=300,
            bgcolor='red',
            border_radius=15,
            alignment=alignment.center,
        ) for i in range(10)
    ],
    buttons=[
        FloatingActionButton(
            icon=icons.NAVIGATE_BEFORE,
            bgcolor='#1f2127'
        ),
        FloatingActionButton(
            icon=icons.NAVIGATE_NEXT,
            bgcolor='#1f2127'
        )
    ],
    vertical_alignment=CrossAxisAlignment.CENTER,
    items_alignment=MainAxisAlignment.CENTER
)

Properties

page

the main page

Container properties

  1. width : slider width

  2. height :slider height

  3. expand : filling available space

  4. tooltip : tooltip

  5. disabled : disabled

  6. padding : padding

  7. margin : margin

  8. alignment : alignment

  9. bgcolor : background color

  10. gradient : gradient

  11. border : border

  12. border_radius : border_radius

Slider properties

  1. items : the items that you want to be in slide show

  2. items_count : the count of controls in each slide

  3. vertical_alignment : items vertical_alignment

  4. items_alignment : items alignment

  5. spacing : spacing between items

  6. auto_cycle : auto cycleing (Auto changing slides)

  7. buttons : the list of Slider's buttons that must be two buttons! the first one is the "previous" button and the second is the "next" button

Methods

  1. next : next slide

  2. prev : previous slide

  3. update_items : updating items

  4. reset_items_index : reseting items index

check out the file examples/flet_carousel_basic.py

BasicAnimatedHorizontalCarousel

This type of slider works with AnimatedSwitcher and unlike "BasicHorizontalCarousel" has no next and prev button but has hint lines.

Screenshot of the app

for example:

BasicAnimatedHorizontalCarousel(
    page=page,
    auto_cycle=AutoCycle(duration=2),
    expand=True,
    padding=50,
    hint_lines=HintLine(
        active_color='red',
        inactive_color='white',
        alignment=MainAxisAlignment.CENTER,
        max_list_size=400
    ),
    items=[
        Container(
            content=Text(value=str(i), size=30),
            height=400,
            expand=True,
            bgcolor='red',
            border_radius=15,
            alignment=alignment.center,
        ) for i in range(10)
    ],
)

Properties

page

the main page

Container properties

  1. width : slider width

  2. height :slider height

  3. expand : filling available space

  4. tooltip : tooltip

  5. disabled : disabled

  6. padding : padding

  7. margin : margin

  8. alignment : alignment

  9. bgcolor : background color

  10. gradient : gradient

  11. border : border

  12. border_radius : border_radius

Slider properties

  1. items : the items that you want to be in slider

  2. hint_lines : hint lines settings

  3. animated_switcher : The AnimatedSwitcher settings

  4. auto_cycle : auto cycleing (Auto changing slides)

Methods

  1. next : next slide

  2. prev : previous slide

  3. update_items : updating items

  4. go : go to a specific slide

check out the file examples/animated_horizontal_basic.py

Hope to enjoy :)

Donating

Metadata

Release files for fletcarousel 0.0.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fletcarousel 0.0.14
File Size Uploaded
fletcarousel-0.0.14.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fletcarousel 0.0.14
File Interpreter ABI Platform
fletcarousel-0.0.14-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / fletcarousel-0.0.14.tar.gz

Download URL fletcarousel-0.0.14.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
cc3a97b803e8fb41d652c9cdfc247ee69c1670e9bbdf6dd20a9a2c3a2192c0c9
BLAKE2b-256 checksum
How to use checksums
cc9bebcb8d72f1dc224f60b4e6ad645e1d28028fa8601b16371b48125f3886ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release files / fletcarousel-0.0.14-py3-none-any.whl

Download URL fletcarousel-0.0.14-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66bcecc1423d34263cffbe364866be5dfa21ed83606930cdc5ffdd1fb9303a56
BLAKE2b-256 checksum
How to use checksums
07e1130c98a494f802ed1e6e94aa39327c4712e6ca9d05c746592f5bc36dcc40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.0.14 This release

2 release files

0.0.13

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page