Mobile app version of vmapp.org
Login or Join
Yeniel278

: Creating symbol with text field that is empty by default in Sketch? I want to create a symbol with an overridable text field that is empty by default. The problem is that Sketch automatically

@Yeniel278

Posted in: #SketchApp

I want to create a symbol with an overridable text field that is empty by default. The problem is that Sketch automatically removes text fields that contain no text. I tried setting the text to various whitespace characters but Sketch still removes the text field.

The only workaround I found was to make a symbol of the text too and set the override to an empty string but that creates unwanted side effects (for example the text field symbol will also be overridable).

Is there another way to achieve this?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Yeniel278

1 Comments

Sorted by latest first Latest Oldest Best

 

@Fox8063795

Make the text layer within your symbol a symbol itself. Make sure to set the text layer symbol to Resize Object not Stretch. The text layer object should be sized for your full text area.



Then, when you use the symbol, the text layer will resize properly with the field. You'll be able to override the text, as well as choose None which will remove the text symbol, for no placeholder text.



What makes this really powerful is you can duplicate this placeholder text symbol layer to make different colored text, for example to represent filled text AND placeholder text. Simply ensure that the symbols you want to have the option to switch between are the exact same size.


Then, on the main screen, you'll be able to select between these symbols.. including none for a blank text field!

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme