Skip to content

Static

Static

Bases: Widget

A widget to display simple static content, or use as a base class for more complex widgets.

Parameters:

Name Type Description Default
renderable RenderableType

A Rich renderable, or string containing console markup. Defaults to "".

''
expand bool

Expand content if required to fill container. Defaults to False.

False
shrink bool

Shrink content if required to fill container. Defaults to False.

False
markup bool

True if markup should be parsed and rendered. Defaults to True.

True
name str | None

Name of widget. Defaults to None.

None
id str | None

ID of Widget. Defaults to None.

None
classes str | None

Space separated list of class names. Defaults to None.

None
disabled bool

Whether the static is disabled or not.

False

render()

Get a rich renderable for the widget's content.

Returns:

Type Description
RenderableType

A rich renderable.

update(renderable='')

Update the widget's content area with new text or Rich renderable.

Parameters:

Name Type Description Default
renderable RenderableType

A new rich renderable. Defaults to empty renderable;

''