Callout¶
marimo.callout
¶
Bases: ContainerHtml
Build a callout output.
| PARAMETER | DESCRIPTION |
|---|---|
value
|
A value to render in the callout
TYPE:
|
kind
|
The kind of callout (affects styling).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Html
|
An HTML object.
TYPE:
|
batch
¶
batch(**elements: UIElement[Any, Any]) -> batch
Convert an HTML object with templated text into a UI element.
This method lets you create custom UI elements that are represented by arbitrary HTML.
Example
user_info = mo.md(
'''
- What's your name?: {name}
- When were you born?: {birthday}
'''
).batch(name=mo.ui.text(), birthday=mo.ui.date())
In this example, user_info is a UI Element whose output is markdown
and whose value is a dict with keys 'name' and 'birthday'
(and values equal to the values of their corresponding elements).
| PARAMETER | DESCRIPTION |
|---|---|
elements
|
the UI elements to interpolate into the HTML template.
TYPE:
|
callout
¶
callout(
kind: Literal[
"neutral", "danger", "warn", "success", "info"
] = "neutral",
) -> Html
Create a callout containing this HTML element.
A callout wraps your HTML element in a raised box, emphasizing its
importance. You can style the callout for different situations with the
kind argument.
Examples:
style
¶
style(
style: dict[str, Any] | None = None, **kwargs: Any
) -> Html
Wrap an object in a styled container.
Example
| PARAMETER | DESCRIPTION |
|---|---|
style
|
an optional dict of CSS styles, keyed by property name
TYPE:
|
**kwargs
|
CSS styles as keyword arguments
TYPE:
|