Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Components as DataTable data?

Is it possible to render a Dash component within a Dash DataTable ?

The following code returns an Objects are not valid as a React child error. Is that a known limitation or is there a way to hack around ?

import dash
import dash_table
import dash_html_components as html

app = dash.Dash(__name__)

a = html.Img(src='')
b = html.Img(src='')
c = html.Img(src='')

app.layout = dash_table.DataTable(
        {"name": 'title', "id": 'title'},
        {"name": 'img', "id": 'img'}],
        {'title': 'A', 'img': a},
        {'title': 'B', 'img': b},
        {'title': 'C', 'img': c}

if __name__ == '__main__':

This isn’t possible right now. However it looks like you are trying to render images as cells: for this you can use the markdown presentation option.

Thanks for the answer. This was just a dummy example, the actual use case was to build a dynamic table with a column of individual map objects at each row. So markdown wont suffice unfortunatly.

Ah ok. Yeah in this case you’ll need to use html.Table