Are there examples of component as props released in 2.5.0?

Hi all,

in dash 2.5.0 the component as props feature has been released as you can see here Release Dash v2.5.0 · plotly/dash · GitHub

I wanted to play with it but I am failing to understand how to implement it.
As far as I understand, and following up on a discussion happened here around 1 month ago, this should somehow enable the possibility to render datatable cells as individual components such as graphs, checkboxes, dropdowns and so on.

Is there anything available that I can read? a working example or any kind of draft documentation about this feature?
In the test part I see used as function ComponentAsProp() but that doesn’t seem included in my dash 2.5.1 (from pip list).

Many thanks

hi @MrGianlu ,
Quite a coincidence! I’m drafting the announcement post right now, and I hope to publish it next week. For now, see our Dash docs for components as props examples.

1 Like

nice one, thanks for the link!

correct me if I am wrong, but apparently datatable doesn’t accept children.
I tried to push html.Div(dcc.Dropdown[‘Option 1’,‘Option 2’]) as values for a certain column, but it doesn’t work, it can’t render them.

Am I going in the wrong direction or datatable component just doesn’t accept children?

hi @MrGianlu
You are correct. The DataTable does not accept children. DataTable might be part of Components as Props in the future, but for now only the Dropdown, Checklist, and RadioItems can have other Dash components within their properties, specifically the label of the options property.

thanks for your reply @adamschroeder, is it in the pipeline to implement the same in dash datatable (render components in cells)?

I am a bit confused because in a discussion happened some time ago it seemed to me that this feature (pull #1965) was supposed to be working on datatable cells.

So I thought it was something considered in scope.

anyways, great job :slight_smile:

As I understand, the new feature makes is possible for component developer to allow passing components as props. But the developer has to make modifications (technically, change the PropType) in the code to enable the behavior. Hence, the Dash datatable will need an update itself before the feature is enabled.

1 Like

Thanks Emil, that’s my understanding too.

Looking at the datatable source code it doesn’t sound like an easy implementation though.

Looking forward for this feature, I’m a strong believer in dash and I see datatable as the key for success :slight_smile: for the moment I’m using an ag-grid js implementation, but I’m looking forward to switch to a native component!

1 Like