Skip to content

DataFrame

A component to display Pandas DataFrames.

Fields

NameTypeDescriptionOptions
DataTextMust be a state reference to a Pandas dataframe or PyArrow table. Alternatively, a URL for an Arrow IPC file.
Show indexTextShows the dataframe's index. If an Arrow table is used, shows the zero-based integer index.
  • yes
  • no
Enable searchText
  • yes
  • no
Enable downloadTextAllows the user to download the data as CSV.
  • yes
  • no
Display row countNumberSpecifies how many rows to show simultaneously.
Wrap textTextNot wrapping text allows for an uniform grid, but may be inconvenient if your data contains longer text fields.
  • yes
  • no
Primary textColor
Secondary textColor
SeparatorColor
BackgroundColor
Header row backgroundColor
Font styleText
  • normal
  • monospace
Custom CSS classesTextCSS classes, separated by spaces. You can define classes in custom stylesheets.

Low code usage

This component can be declared directly in Python, using backend-driven UI.

python
ui.DataFrame(content={
        "dataframe": "", # str 
        "showIndex": "yes", # str [yes, no]
        "enableSearch": "no", # str [yes, no]
        "enableDownload": "no", # str [yes, no]
        "displayRowCount": 0.0, # Union[float, str] 
        "wrapText": "no", # str [yes, no]
        "primaryTextColor": "", # str 
        "secondaryTextColor": "", # str 
        "separatorColor": "", # str 
        "dataframeBackgroundColor": "", # str 
        "dataframeHeaderRowBackgroundColor": "", # str 
        "fontStyle": "normal", # str [normal, monospace]
        "cssClasses": "", # str 
    }
)

Reference