Slideshow


The package slideshow from Tiny slider is available in the framework by using the following component:

ss = page.ui.slideshow([page.ui.text("Great results %s" % i) for i in range(20)])

The above will display a slide object with simple text elements.

Each of the functions and properties, when they are wrapping an core API function, will point from the doc string in the framework to its external documentation. Do not hesitate to have a look at it and either to challenge the library to get new features or to check with us if something does not seem correct.

Options

Then exactly in the same way it is mentioned in the slideshow documentation it is possible to add options to this component. All the options are available from the component.options property:

ss.options.autoplay = False
ss.options.items = 4

The above will disable the autoplay and change the number of items per page. More information in the package documentation available from there Github repository.

Events

All the component events are available from the component .js property. Basically by adding the below it will go to the next element when a button is clicked:

btn = page.ui.button("Click")
btn.click([
    ss.js.next()
])

Note

The js property must be added to a JavaScript event to be rendered as string to the page during the transpiling. Any functions called directly from Python will rendered string which will not be captured in the page object.

Style

This component will have some predefined CSS class in order to change the nav bar and the button but it is possible as any other component to change the style by using the style.css property.