Log in
Log into community
Join the Webstudio community
View all posts
Related posts
Was this helpful?
😞
😐
😃
Powered by
Hall
Inactive
Updated 2 months ago
0
Follow
Tabs not working with collections
Tabs not working with collections
Inactive
0
Follow
At a glance
c
cramses.
2 months ago
·
I want to have a "Tabs" component which is changing according to my variable.
I hope my video explains what I want to do.
Problem is, that the tabs with don´t seem to work with a collection item.
Is this my fault?
Is my problem clear?
J
c
J
35 comments
Share
Open in Discord
J
John Siciliano
2 months ago
I didnt watch but probably this
https://docs.webstudio.is/university/core-components/collection.md#using-collections-within-accordions
c
cramses.
2 months ago
Ehm no I think it´s a different problem
J
John Siciliano
2 months ago
okay looking
J
John Siciliano
2 months ago
So you added a value attribute to your tabs and provided them a unique value from the collection?
c
cramses.
2 months ago
Yes
J
John Siciliano
2 months ago
Can you screenshot so i can see? I haven't tried this on tabs but suspect thats the issue
J
John Siciliano
2 months ago
You need to specify an attribute called Value and provide it with something unique
Attachment
J
John Siciliano
2 months ago
Though I'm looking at which instance because on Accordions its just the parent Item but Tabs have multiple wrappers
J
John Siciliano
2 months ago
I think you apply it to both the tab trigger and tab content
J
John Siciliano
2 months ago
so they maintain a relationship
J
John Siciliano
2 months ago
e.g. tab trigger 1 as Value "asdf" and tab content 1 as Value "asdf"
c
cramses.
2 months ago
But the tab trigger and the tab content don´t have a value attribute (yet)
J
John Siciliano
2 months ago
add one 🙂
c
cramses.
2 months ago
You´re the king
c
cramses.
2 months ago
It works
c
cramses.
2 months ago
One thing though, how can I edit the default value?
I know it´s in the tabs, but how can I make it depending on the variable?
J
John Siciliano
2 months ago
Sweet. Can you provide a screenshot so I can add that to docs?
J
John Siciliano
2 months ago
On Tabs instance IIRC there is a default
c
cramses.
2 months ago
Yeah, let me show you what I mean
J
John Siciliano
2 months ago
BTW you can reference the Radix docs to understand what properties there are to modify
https://www.radix-ui.com/primitives/docs/components/tabs
J
John Siciliano
2 months ago
Ah maybe just bind the first collection value to the default value?
c
cramses.
2 months ago
Yeah.. just found out xD
J
John Siciliano
2 months ago
Cool
c
cramses.
2 months ago
Ok, so what do you need for the docs?
J
John Siciliano
2 months ago
Best res image you can send of the Tab Trigger and Value in view and the Tab Content and value in view
J
John Siciliano
2 months ago
so 2 images
c
cramses.
2 months ago
like this?
Attachment
J
John Siciliano
2 months ago
Yes but with the Navigator in view to just to make sure people know what to select
c
cramses.
2 months ago
Like this?
Attachments
J
John Siciliano
2 months ago
yep perfect thanks! will get this added to docs
J
John Siciliano
2 months ago
Boom
https://docs.webstudio.is/university/core-components/collection.md#tabs
J
Jeremy
2 months ago
@John Siciliano, would these images work for the docs?
Attachments
J
Jeremy
2 months ago
Simply so you don't need to click into them to see what's happening.
J
John Siciliano
2 months ago
Yes 🙂 thanks!
J
John Siciliano
2 months ago
uploading now
Add a reply
Sign up and join the conversation on Discord
Join on Discord