Feed#

Open this notebook in Jupyterlite | Download this notebook from GitHub (right-click to download).


import panel as pn
pn.extension()

The Feed inherits from the Column layout, thus allows arranging multiple panel objects in a vertical container, but limits the number of objects rendered at any given moment.

Like Column, it has a list-like API with methods to append, extend, clear, insert, pop, remove and __setitem__, which make it possible to interactively update and modify the layout.

Parameters:#

For details on other options for customizing the component see the layout and styling how-to guides.

  • objects (list): The list of objects to display in the Feed, should not generally be modified directly except when replaced in its entirety.

  • load_buffer (int): The number of objects loaded on each side of the visible objects. When scrolled halfway into the buffer, the Feed will automatically load additional objects while unloading objects on the opposite side.

  • scroll (boolean): Enable scrollbars if the content overflows the size of the container.

  • scroll_position (int): Current scroll position of the Feed. Setting this value will update the scroll position of the Column. Setting to 0 will scroll to the top.

  • auto_scroll_limit (int): Max pixel distance from the latest object in the Feed to activate automatic scrolling upon update. Setting to 0 disables auto-scrolling

  • scroll_button_threshold (int): Min pixel distance from the latest object in the Feed to display the scroll button. Setting to 0 disables the scroll button.

  • view_latest (bool): Whether to scroll to the latest object on init. If not enabled the view will be on the first object.

  • visible_range (list): Read-only upper and lower bounds of the currently visible Feed objects. This list is automatically updated based on scrolling.


Feed is a Column-like layout that displays a Feed of objects. It is useful for displaying long outputs with many rows because of its ability to limit the number of entries loaded at once.

When scrolled halfway into the load_buffer, the Feed will automatically load additional entries while unloading entries on the opposite side.

Feed = pn.Feed(*list(range(1000)), load_buffer=20)
Feed

To have the Feeds immediately initialized at the latest entry, set view_latest=True.

Feed = pn.Feed(*list(range(1000)), view_latest=True)
Feed

Additionally, to allow users to scroll to the bottom interactively, set a scroll_button_threshold which will make the Feed display a clickable scroll button.

Feed = pn.Feed(*list(range(1000)), scroll_button_threshold=20, width=300)
Feed

Open this notebook in Jupyterlite | Download this notebook from GitHub (right-click to download).