Skip to content

Any planned support for data* or aria-* options? #78

Closed

Description

@rc1405

As the title indicates, any planned support for the above options add they are supported in react? Main use case would be for using bootstrap within apps.

Activity

  1. chriddyp commented on Jul 10, 2017

    @chriddyp
    Member

    Good idea. It seems like we should support this.

    It'll be a little bit tricky because data-* and aria-* are regex properties. Our dynamic component generation code depends on a strict set of properties rather than a pattern of property names (see https://github.com/plotly/dash/blob/master/dash/development/base_component.py#L188-L259).

  2. rc1405 commented on Jul 12, 2017

    @rc1405
    Author

    Full disclosure, I don't have access to my development area but wanted to throw some initial thoughts together. The catch is you would have to replace the dash (-) with an underscore(_) when initially initiating. There are some documentation flaws in doing it this way that would need to be corrected, but some thoughts to debate.

    `>>> import dash_html_components as html

    html.Div("testing", data_test="#testing")
    Div(children='testing', data-test='#testing')

    `

    https://github.com/rc1405/dash/blob/bootstrap/dash/development/base_component.py

  3. rc1405 commented on Jul 12, 2017

    @rc1405
    Author

    or even add the available properties for each class of: data_flags=[{"test": "#testing"] and aria_flags[{"key": "value"}], which can be propagated to data-test="#testing" and aria-key="value" in base_component.py

  4. rc1405 commented on Jul 16, 2017

    @rc1405
    Author

    First method of https://github.com/rc1405/dash/blob/bootstrap/dash/development/base_component.py

    Provides capability such as:

    image

    Example code:

    import dash_html_components as html
    
    app = dash.Dash()
    
    app.layout = html.Div([
        html.H1('Hello Dash'),
    
        html.Div('''
            Dash: A web application framework for Python.
        '''),
    
    ], data_stuff='blah')
    
    if __name__ == '__main__':
        app.run_server(host='0.0.0.0', port=8080)
    
    
    
    
    
  5. javValverde commented on Jul 28, 2017

    @javValverde

    I am also really interested in using bootstrap with dash! Are there any plans for implementing it?

  6. chriddyp commented on Mar 26, 2018

    @chriddyp
    Member

    I wrote a guide on how to add support for this in Dash in https://community.plot.ly/t/can-data-attributes-be-created-in-dash/7222/2?u=chriddyp

  7. chriddyp commented on Jun 8, 2018

    @chriddyp
    Member

    Done in #237

  8. added a commit that references this issue on Apr 23, 2019
  9. added a commit that references this issue on Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions