Skip to content

textual.renderables

A collection of Rich renderables which may be returned from a widget's render() method.

Bar

Bar(
    highlight_range=(0, 0),
    highlight_style="magenta",
    background_style="grey37",
    clickable_ranges=None,
    width=None,
    gradient=None,
)

Thin horizontal bar with a portion highlighted.

Parameters:

Name Type Description Default

highlight_range

tuple[float, float]

The range to highlight.

(0, 0)

highlight_style

StyleType

The style of the highlighted range of the bar.

'magenta'

background_style

StyleType

The style of the non-highlighted range(s) of the bar.

'grey37'

width

int | None

The width of the bar, or None to fill available width.

None

gradient

Gradient | None

Optional gradient object.

None

Blank

Blank(color='transparent')

Bases: Visual

Draw solid background color.

render_strips

render_strips(width, height, style, options)

Render the Visual into an iterable of strips. Part of the Visual protocol.

Parameters:

Name Type Description Default

width

int

Width of desired render.

required

height

int | None

Height of desired render or None for any height.

required

style

Style

The base style to render on top of.

required

options

RenderOptions

Additional render options.

required

Returns:

Type Description
list[