[Toolkit][Shadcn] Remove attributes.defaults() in component templates#3653
[Toolkit][Shadcn] Remove attributes.defaults() in component templates#3653seb-jean wants to merge 23 commits into
attributes.defaults() in component templates#3653Conversation
seb-jean
commented
Jun 2, 2026
| Q | A |
|---|---|
| Bug fix? | no |
| New feature? | no |
| Deprecations? | no |
| Documentation? | yes |
| Issues | Part of #3233 |
| License | MIT |
13c21e1 to
c62875a
Compare
Kocal
left a comment
There was a problem hiding this comment.
Thank you for working on this, but there are a few nuances to consider. I stopped the review at src/Toolkit/kits/shadcn/alert/templates/components/Alert.html.twig file btw
| 'data-slot': 'alert-dialog-content', | ||
| 'data-size': size, | ||
| 'data-alert-dialog-target': 'dialog', | ||
| 'data-action': 'keydown.esc->alert-dialog#close:prevent', |
There was a problem hiding this comment.
However, for data-action it can be different, maybe it can be useful to make it overridable, but only by using the html_attr_merge Twig filter
|
Thanks for your feedback, @Kocal
<div class="flex gap-2">
<twig:Checkbox id="terms" />
<twig:Label for="terms" data-slot="test-data-slot">Accept terms and conditions</twig:Label>
</div>I went to http://127.0.0.1:9044/toolkit/kits/shadcn/components/label, then opened a new tab to view the preview demo: http://127.0.0.1:9044/toolkit/component_preview?[...]. I looked at the source code, and I saw two data slots applied to the <label data-slot="label" class="[...]" for="terms" data-slot="test-data-slot">Accept terms and conditions</label>Furthermore, this might need to be modified because it mentions the use of
|
c62875a to
a0794d9
Compare
|
hi @seb-jean can you try and update select component? Current : Better view: |
I'm not going to make the change because it's outside the scope of the PR and concerns another component introduced in the PR: #3479 |
|
I’m adding two examples of In the file ux/src/Toolkit/kits/shadcn/alert/templates/components/Alert.html.twig, the ux/src/Toolkit/kits/shadcn/alert/templates/components/Alert.html.twig Lines 14 to 21 in 08eeb19 However, in the file ux/src/Toolkit/kits/shadcn/accordion/templates/components/Accordion/Content.html.twig, the As a result, I’m not sure which approach is the recommended one or what the best practice is. |
53a1321 to
d634604
Compare
|
I made multiple commits to make the review easier. I didn't understand the comment, could you explain how to proceed? I kept
|
d634604 to
54fd53a
Compare
attributes.defaults() in component templatesattributes.defaults() in component templates
…ta-orientation` in `separator`
… and `data-variant` in `button`
54fd53a to
2a98cae
Compare