• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
9

Creating checkboxes using components and states in XD

Adobe Employee ,
Nov 15, 2019 Nov 15, 2019

Copy link to clipboard

Copied

I went back to the XD artboard, and I realized that there was a simpler and more scalable way to create a checkbox. Let me know if you have a better way to do this.

 

Create a square (I have used Corner radius: 20, Stroke 4)

Screen Shot 2019-11-15 at 6.59.35 AM.png

 

Inside this square, create a smaller square and set its border size to zero.

innersquare.png

 

With the inner square selected, press Ctrl+K or Cmd+K to convert the inner square to a Component. Name the Component InnerSquare

innersquare_component.png

 

Now, select both the outer square and inner square and convert to component. Name it OuterSquare

Screen Shot 2019-11-15 at 7.04.31 AM.png

 

I am using a plug-in ICONS & SYMBOLS to drag icons for check mark and user-check to the artboard

Screen Shot 2019-11-14 at 3.54.06 PM.png

 

Enlarge the icons and convert them to Components named Check and User Check

check_usercheck.png

 

Select OuterSquare component and in the Properties panel, create two new states, Mouse-Over and Mouse-click

 outer_states.png

 

Here's where you have to be very careful. Ensuring that you are in the Mouse-Over state, do the following

  • Right-click the Check component and select Cut
  • Double-click inside the OuterSquare component to select InnerSquare
  • Right-click and paste
  • Move the Check component into the OuterSquare and adjust position.

mouse-over.png

Select the Mouse-Clickstate and repeat process to add the User-Check component.

 

Select Default State, Mouse-Over, and Mouse-Click one after the other in the Properties panel to see if the changes are reflected.

 

Switch to the Prototype mode to wire the states

defaultstate_wire.png

mousehover_wired.png

mouseclick_wired.png

 

Now, run the Prototype and see whether it works as intended. Again, this may not be the perfect way to create a checkbox, and I discovered a simpler way to do it. More on that later.

 

 

TOPICS
How to

Views

24.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 11, 2019 Dec 11, 2019

Copy link to clipboard

Copied

Why do we need to create the "InnerSquare" component though? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 11, 2019 Dec 11, 2019

Copy link to clipboard

Copied

Does it work when you do not convert that to a component? I did this tutorial sometime ago and if you have a better way to achieve this, can you upload your file to a shared location, and share the URL here?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 12, 2020 Feb 12, 2020

Copy link to clipboard

Copied

I've noticed that when you add a component to the CC library - it looses the states. Any chance this will be fixed soon?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 12, 2020 Feb 12, 2020

Copy link to clipboard

Copied

The team is working on this, and the feature should be updated soon. Did you try updating to the latest version of XD to see if this issue has been fixed?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 12, 2020 Feb 12, 2020

Copy link to clipboard

Copied

Thanks for the response Preran. Yes I'm on the most recent update, looking forward to this feature coming soon. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 29, 2020 Nov 29, 2020

Copy link to clipboard

Copied

The easiest solution! Just make a square. Then add a user check-icon and place it over the square. The size of the check-icon area should be enough to let it act as a checkbox with an click state. So set the hover and tap trigger to the check-icon instead doing it to the square. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 24, 2022 Feb 24, 2022

Copy link to clipboard

Copied

LATEST

Great idea, it works for me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines