StaticText#

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


import panel as pn
pn.extension()

The StaticText widget displays a text value but does not allow editing it.

Discover more on using widgets to add interactivity to your applications in the how-to guides on interactivity. Alternatively, learn how to set up callbacks and (JS-)links between parameters or how to use them as part of declarative UIs with Param.

Parameters:#

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

  • name (str): The title of the widget

  • value (str): Parsed datetime value


static_text = pn.widgets.StaticText(name='Static Text', value='A string')

static_text

StaticText.value returns a string that can be read out but cannot be set like other widgets:

static_text.value
A string

Controls#

The StaticText widget exposes a number of options which can be changed from both Python and Javascript. Try out the effect of these parameters interactively:

pn.Row(static_text.controls(jslink=True), static_text)

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