file_download class
Allows downloading of a file content.
Methods¶
__init__() ¶
__init__(
content=None,
label=None,
on_action=None,
auto=False,
render=True,
bypass_preview=True,
name=None,
width=None,
active=True,
id=None,
properties=None,
class_name=None,
hover_text=None,
) -> None
Create a new file_download element.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content
|
dynamic(Union[path, file, URL, ReadableBuffer, None])
|
The content to transfer.
|
None
|
label
|
dynamic(str)
|
The label of the button. |
None
|
on_action
|
Union[str, Callable]
|
A function or the name of a function that is triggered when the download is terminated (or on user action if content is None).
|
None
|
auto
|
bool
|
If True, the download starts as soon as the page is loaded. |
False
|
render
|
dynamic(bool)
|
If True, the control is displayed. |
True
|
bypass_preview
|
bool
|
If False, allows the browser to try to show the content in a different tab. |
True
|
name
|
str
|
A name proposition for the file to save, that the user can change. |
None
|
width
|
Union[str, int]
|
The width of the element. |
None
|
active
|
dynamic(bool)
|
Indicates if this element is active. |
True
|
id
|
str
|
The identifier assigned to the rendered HTML component. |
None
|
properties
|
dict[str, Any]
|
A dictionary of additional properties that can be set to the element. |
None
|
class_name
|
dynamic(str)
|
A space-separated list of CSS class names to be applied to the generated HTML element. |
None
|
hover_text
|
dynamic(str)
|
The text that is displayed when the user hovers over the element. |
None
|