2

How to create a rendering variant in sitecore jss with nextjs. Any document to follow.

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.