Skip to main content

paragraph

Paragraph

from dara.components.common.paragraph import Paragraph

class Paragraph(LayoutComponent)

Paragraph

A Paragraph component allows multiple bits of text to be concatenated together easily into a single paragraph. It only accepts Text or Anchor components as children.

A Paragraph component is created via:


from dara.components.common import Paragraph, Text

Paragraph(Text("This is some paragraph text"))

The Text components provided are concatenated:


from dara.components.common import Paragraph, Text

Paragraph(Text("This is a long sentence"), Text("which is concatenated into a single paragraph"))

The Paragraph can also be created with a mix of Text or Anchor components:


from dara.components.common import Anchor, Paragraph, Text

Paragraph(
Text('Some initial text'),
Anchor('an anchor', href='https://www.example.com'),
Text('More text'),
)