This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Paul Kooi
Posted Aug 25 - Read on Facebook

Newbie question: Say I have a widget ( say maybe a carousel ) that I want to duplicate many times.... and then programmatically make changes to it. How would this be accomplished?

I tried using a for loop to replicate the widget but can't get it to work. The examples that I've found online suggest using an array and then looping over the array... but that doesn't allow me to make changes within the carousel itself.... hope this makes sense. Thanks


Krijn Rijshouwer

Hey Paul Kooi!

You have a couple of options. The best one is creating your own reusable component. So basically create a class/custom Layer that extends from PageComponent. I'll make you a little example! :)

Krijn Rijshouwer

Here's the example I promised you →

It shows how you can create your own component to easily repurpose code. And how you can make it customisable for every instance.

Paul Kooi

Thanks so much Krijin... Looking at the code that you've written there a few tools / concepts that I haven't yet learned. Let me dig in and then I might post more questions... if I can't figure it out. Thanks for the help. Appreciate it.

Read the entire post on Facebook