How to create a rendering variant in sitecore jss with nextjs. Any document to follow.
1 Answer
You can create rendering variant in jss inside the component tsx file as below.
export const Default = (props: CardProps) => {
return <div>Your card content here</div>;
};
export const WithAccent = (props: CardProps) => {
return <div>Your card content here</div>;
};
In the above component there are two variants Default and WithAccent. Thereafter you can create above variants inside the Headless Variants folder for the component. You can find more details on the Sitecore Headless documentation here.
Hope this helps!!! Let me know in case you have any queries.