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 indexBooleanShows the dataframe’s index. If an Arrow table is used, shows the zero-based integer index.
  1. Yes
  2. No
Enable searchBoolean-
  1. Yes
  2. No
Enable adding a recordBoolean-
  1. Yes
  2. No
Enable updating a recordBoolean-
  1. Yes
  2. No
Enable downloadBooleanAllows the user to download the data as CSV.
  1. Yes
  2. No
ActionsKey-ValueDefine rows actions-
Use MarkdownBooleanIf active, the output will be sanitized; unsafe elements will be removed.
  1. Yes
  2. No
Display row countNumberSpecifies how many rows to show simultaneously.-
Wrap textBooleanNot wrapping text allows for an uniform grid, but may be inconvenient if your data contains longer text fields.
  1. Yes
  2. No
Primary textColor--
Secondary textColor--
AccentColor--
SeparatorColor--
BackgroundColor--
Font styleText-
  1. normal
  2. monospace
Custom CSS classesTextCSS classes, separated by spaces. You can define classes in custom stylesheets.-

Events

Low code usage

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

ui.DataFrame(content={
        "dataframe": "", # str 
        "showIndex": "yes", # str [yes, no]
        "enableSearch": "no", # str [yes, no]
        "enableRecordAdd": "no", # str [yes, no]
        "enableRecordUpdate": "no", # str [yes, no]
        "enableDownload": "no", # str [yes, no]
        "actions": {}, # Union[Dict, str] 
        "useMarkdown": "no", # str [yes, no]
        "displayRowCount": 0.0, # Union[float, str] 
        "wrapText": "no", # str [yes, no]
        "primaryTextColor": "", # str 
        "secondaryTextColor": "", # str 
        "accentColor": "", # str 
        "separatorColor": "", # str 
        "dataframeBackgroundColor": "", # str 
        "fontStyle": "normal", # str [normal, monospace]
        "cssClasses": "", # str 
    },
    handlers={
        "wf-dataframe-add": handle_event,
        "wf-dataframe-update": handle_event,
        "wf-dataframe-action": handle_event,
    }
)

A function, in this example handle_event, should be implemented in your code to handle events.

def handle_event(state, payload, context, ui):
  pass

Reference