Copy link to clipboard
Copied
If you found my previous tutorial on creating a checkbox using states a tad cumbersome, I found something simpler that works. Now, this may not be ideal or recommended but it works for me, and if you think you want to try it, jump in!
Create a square (I have used Corner radius: 20, Stroke 4)
Convert the box to a component by using Cmd+K or using the right-click menu. This is your Default state, a blank Check Box. Rename this component to Check Box.
Create 2 new states for the component – MouseHover, and MouseClick.
Open the Icons & Symbols plug-in and drag the icons for check and user-check on to the stage. Resize them to a bigger size that fits into the check box.
This is where it gets a little tricky. With Default State selected, move the Check icon into the Check Box Component.
Right-click the Check icon and select Cut.
Open the Layers panel, click on the icon to the left of the Check Box component to expand it. Select Rectangle.
Now press Cmd+V or Ctrl+V to paste the Check Icon into the rectangle. Your layers panel should now look like this.
Remove the Fill from the Check icon so that it is now invisible
Repeat the process for the User Check icon. Your layer panel should now look like this.
Just to be sure, you now have an empty rectangle in the Default State with two objects inside that are invisible.
Now, select the Check Box component, switch to the MouseHover state, and select the User-check icon in the layers panel. Enable Fill.
Select the Check Box component, switch to the MouseClick state, and select the Check icon in the layers panel. Enable Fill.
Switch to the Prototype Mode, and wire the states as described in the images below.
Let me know if you have a better idea on how we could achieve the creation of a checkbox. I look forward to your entries.
Copy link to clipboard
Copied
Great tutorial, thanks! If I find an easier way, I will let you know 🙂