Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Enable kwargs for single component models (via extra) #1032

Merged
merged 101 commits into from
Mar 7, 2025

Conversation

maxschulz-COL
Copy link
Contributor

@maxschulz-COL maxschulz-COL commented Feb 20, 2025

Description

This PR introduces the extra arguments to the components: Container, Card, Button, Dropdown, Checklist, RadioItems, Slider, RangeSlider, DatePicker which are directly passed to their underlying foudation components, in this case dmc,dbc and dcc.

It is made clear in the API reference and argument docstring that this argument is not part of the Vizro schema, and may not be backwards compatible in future releases.

Main open question

  • Do we want to call the argument extra?

Alternatives considered

  • extra: Dict[str,Any] without merge extra with the defaults of a component
  • extra: Dict[str,Any] with nested merge of extra with the defaults of a component
  • extra: ComponentExtraType - where ComponentExtraType is a pydantic model of selected extra arguments that would enhance usability and error explanation

Open ToDoS

  • Write schema explanation
  • Write docs examples

Screenshot

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

huong-li-nguyen and others added 30 commits February 10, 2025 10:20
Copy link
Contributor

@petar-qb petar-qb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really clean now! 🥇

@maxschulz-COL maxschulz-COL changed the title [Feature] Enable kwargs for single component models [Feature] Enable kwargs for single component models (via extra) Mar 4, 2025
The once exception where I did not apply this was navigation as it seemed to complicated
Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some more comments for now - will write some more here later!

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style

Clarify language in `extra` argument explanations for Card, Button, and Container components to better describe their relationship with underlying Dash components
Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want me to check the docs/warning message any more after our discussion yesterday, but I'm happy for you to merge whenever you're happy with it.

maxschulz-COL and others added 12 commits March 6, 2025 16:21
Add notes to multiple user guide pages highlighting the `extra` argument as a quick way to customize components without creating custom components or CSS. Updated documentation for custom components, custom CSS, graph, and selectors to include guidance on using `extra` for quick modifications.
@maxschulz-COL maxschulz-COL enabled auto-merge (squash) March 7, 2025 13:41
@maxschulz-COL maxschulz-COL merged commit 3d2fd2c into main Mar 7, 2025
41 checks passed
@maxschulz-COL maxschulz-COL deleted the feature/enable_kwargs branch March 7, 2025 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants