-
Notifications
You must be signed in to change notification settings - Fork 155
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
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…izro into dev/styled-containers
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…izro into dev/styled-containers
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this 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! 🥇
kwargs
for single component modelskwargs
for single component models (via extra
)
The once exception where I did not apply this was navigation as it seemed to complicated
There was a problem hiding this 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
There was a problem hiding this 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.
vizro-core/changelog.d/20250303_110318_maximilian_schulz_enable_kwargs.md
Outdated
Show resolved
Hide resolved
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.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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 casedmc
,dbc
anddcc
.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
extra
?Alternatives considered
extra: Dict[str,Any]
without merge extra with the defaults of a componentextra: Dict[str,Any]
with nested merge of extra with the defaults of a componentextra: ComponentExtraType
- whereComponentExtraType
is a pydantic model of selectedextra
arguments that would enhance usability and error explanationOpen ToDoS
Screenshot
Notice
I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":