Shopify Polaris - Navigation tab at top

poojafmile
Excursionist
18 1 0

Hello, 

I want to use the shopify polaris to make something like this, but each tab should have different contents.

poojafmile_0-1623639008506.png

 

poojafmile_1-1623639058981.png

 


Link Used: https://polaris.shopify.com/components/navigation/tabs#navigation


 

Thanks.

0 Likes
neverrun
New Member
2 0 0

declare a variable, such like comp. and include components which you want to use. and create if else ladder so like i

 

let comp = '';
if(selected == 0)
{
  comp = <Component 1/>
}
else if(selected == 1)
{
  comp = <Component 2/> 
}
...

return(
...
{comp} //Here is your assigned component. By help of selected index, components assigned to comp variable
...
);

 

 

0 Likes
neverrun
New Member
2 0 0

if you are in trouble with this post, i can help you as far as i can.

0 Likes