Skip to main content

Create dividers with Plugin API – figma.createDivider()?


Mikael_Ahlstrom

I have built a simple plugin for my organization to generate our best practice Figma file boilerplate. I would love to be able to take advantage of the new page dividers feature, but if I use the API to edit the name of the page to something like ‘—’ it doesn’t turn into a divider like it would from the UI.

Feature requests

  1. Add ability to create dividers — Figma.createDivider()?
  2. Turn pages to divider if name is changed to “—” or similar like in UI

CleanShot 2024-07-01 at 11.18.45

15 replies

Andrey_Cretsu

same situation


Andrey_Cretsu

@Mikael_Ahlstrom trying to do same goal plugin, could you tell me please how you replace first page, precreated when you open new file?


Mikael_Ahlstrom

@Andrey_Cretsu I don’t think you can with the API. I’m just keeping the Page 1 to be deleted manually.


Mikael_Ahlstrom

@Andrey_Cretsu you actually can rename existing pages. Here’s my entire TypeScript file with renaming.

Pastebin


Andrey_Cretsu

Andrey_Cretsu

@Mik thank you, I’ll check your code


Andrey_Cretsu

@Mikael_Ahlstrom I receive an error with your code about “includes”


Lenin
  • New Member
  • 3 replies
  • July 15, 2024

Would be nice to have this als available from the api 😁.

Perhaps @Gleb could bring this up to the Figma team 😬


Gleb
  • Power Member
  • 4706 replies
  • July 15, 2024

I don’t work for Figma

You can bring this to the team yourself by posting on discord.


Lenin
  • New Member
  • 3 replies
  • July 15, 2024

My bad i thought you were part of Figma 😅 . I’ll will be going in search of Figma’s discord


Mikael_Ahlstrom

@Andrey_Cretsu I don’t mean to sound rude, but if your code doesn’t still work, I suggest you google the error 😅 The problem is written in the end of that error message and solution is quite literally the first google result. Just add latest ECMAScript to your tsconfig.json and you’re good.


Shnitz
  • 1 reply
  • July 15, 2024

Same, naming the layer with ----- or **** just puts the names like this. I hope they will add this option to the plugin API


Gleb
  • Power Member
  • 4706 replies
  • July 15, 2024

Everyone at Figma is very busy with AI now so it’s not guaranteed anyone would fix anything 😆😆


Jimmy.v
  • 1 reply
  • August 14, 2024

Same issue here.
It’s funny how everyone creates the same plugin in their organisations. 😅 (maybe an idea for another feature request haha).


tank666
  • 4859 replies
  • November 22, 2024

Now you can create page dividers using API. Read more:

figma.com – 22 Nov 24

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings