Skip to main content

Text

Render the content of a string into the data App layout.

dp.text(text, code=False, delete=False, disabled=False, italic=False, 
keyboard=False, mark=False, strong=False, role=None, underline=False)

Parameters

ParameterDescription
text (str)Markdown text
code (bool)Code style
delete (bool)Deleted line style
disabled (bool)Disabled content
italic (bool)Italic style
keyboard (bool)Keyboard style
mark (bool)Marked style
role (Optional[TextRole])Content type. Can be either secondary, success, warning or danger
underline (bool)Underlined type

Example

The example below shows how to create a text component.

import shapelets.datapanel as dp

# Set up a dataApp
app = dp.dataApp()
app.title(text='Simple demo')

# Define and place the text component
my_text = app.text(text='Hello World!')
app.place(my_text)

# Publish dataApp
dp.serve(app)
Shapelets Basic Text

Among other features, this component admits Markdown Syntax and allows to directly modify visual properties such as the font size and font style.

import shapelets.datapanel as dp

# Set up a dataApp
app = dp.dataApp()
app.title(text='Simple demo')

# Define and place the text component
my_text = app.text(text='Hello World!', mark=True)
app.place(my_text)

# Publish dataApp
dp.serve(app)
Shapelets Basic Text
import shapelets.datapanel as dp

# Set up a dataApp
app = dp.dataApp()
app.title(text='Simple demo')

# Define and place the text component
my_text = app.text(text='Hello World!', italic=True)
app.place(my_text)

# Publish dataApp
dp.serve(app)
Shapelets Basic Text
import shapelets.datapanel as dp

# Set up a dataApp
app = dp.dataApp()
app.title(text='Simple demo')

# Define and place the text component
my_text = app.text(text='Hello World!', role='success')
app.place(my_text)

# Publish dataApp
dp.serve(app)
Shapelets Basic Text