Coding with Custom Components

Hi,

I drop in a lot of custom HTML components into my Elements projects. Is it possible to select all the code in a component and automatically format/indent it, similar to how you can do in VS Code with Option + Shift + F.

Does Elements have anything like this built in, or is there a shortcut I’ve missed? If not, are there any workarounds or plans to add such a feature in the future?

Thanks,

John

We use the Monaco Code Editor framework that powers VSCode so it’s entirely possible, and a great suggestion!

As a workaround you could paste your code into VSCode to format it, and then paste it back into Elements, if you like to keep things neat and tidy.

Alternatively, you could put your Custom Components into a DevPack, that way you can use VSCode as your main editor!

Thanks for the quick response.

I’m doing the copy / paste VSCode thing at the moment.

I’ll look into the DevPack thing.

Be great if it was all baked in!

Cheers,

John

1 Like

Just a quick one to see if adding this is on your roadmap?

We’ve not got round to it yet, but it is something we’d like to do.

If you’re serious about building components, you really should switch over to DevPacks that way you can use your coding editor of choice :slight_smile:

:backhand_index_pointing_right: Check out the QuickStart Video Guide to get going!

1 Like

Great, I’ll have a look!