Skip to main content

Simple carousel sliders for flet framework

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fletcarousel-0.0.14.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

fletcarousel-0.0.14-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file fletcarousel-0.0.14.tar.gz.

File metadata

  • Download URL: fletcarousel-0.0.14.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for fletcarousel-0.0.14.tar.gz
Algorithm Hash digest
SHA256 cc3a97b803e8fb41d652c9cdfc247ee69c1670e9bbdf6dd20a9a2c3a2192c0c9
MD5 b6a305c59b18d88dae0432b01bab4d2d
BLAKE2b-256 cc9bebcb8d72f1dc224f60b4e6ad645e1d28028fa8601b16371b48125f3886ca

See more details on using hashes here.

File details

Details for the file fletcarousel-0.0.14-py3-none-any.whl.

File metadata

File hashes

Hashes for fletcarousel-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 66bcecc1423d34263cffbe364866be5dfa21ed83606930cdc5ffdd1fb9303a56
MD5 8071a37d4aa65e80696d795303eb0561
BLAKE2b-256 07e1130c98a494f802ed1e6e94aa39327c4712e6ca9d05c746592f5bc36dcc40

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page