IDOM

A package for building highly interactive user interfaces in pure Python inspred by ReactJS.

At a Glance

Let’s use IDOM to create a simple slideshow which changes whenever a user clicks an image:

import idom


@idom.component
def Slideshow():
    index, set_index = idom.hooks.use_state(0)

    def next_image(event):
        set_index(index + 1)

    return idom.html.img(
        {
            "src": f"https://picsum.photos/id/{index}/800/300",
            "style": {"cursor": "pointer"},
            "onClick": next_image,
        }
    )


idom.run(Slideshow)

Try selecting the “Live Example” tab in the view above and enabling the widget.

Once activated try clicking the displayed image to make it change 🖱️