6

I'm doing some UI mockups in Draw.io and I was wanting to customize the appearance of some of the built-in shapes.

I'm using the Checkbox shape from the Mockup Forms library and it is not checked by default; I would like to check it.

Similarly, the Checkboxes shape is a box containing 4 checkboxes, the 3rd one being checked:

  1. How can I change the checked item to be the first item?
  2. How can I add or remove other checkboxes to this list?

2 Answers 2

2

With the shape you mentioned: select the checked sub-shape and paste it where you want it (replace the empty rectangle) or use a different shape which can be manipulated via style (create a simple rectangle then copy the following text into its style): "shape=mxgraph.mockup.forms.checkboxGroup;mainText=+Option 1,Option 2,Option 3,Option 4;textSize=10;textColor=#dddddd;fontColor=#666666;"

The "Option n" text can be whatever you want and add a "+" whick you want to be checked. You can also add or remove entries to the mainText list. The other parameters should be obvious. If you want further help, just ask.

The same applies to radio buttons, just use the "mxgraph.mockup.forms.radioGroup" shape.

2
  • What do you mean by "select the checked sub-shape"? How would I select a subshape? I see only a single shape here: i.stack.imgur.com/sMbph.png
    – CherryDT
    Feb 25, 2022 at 21:00
  • @CherryDT When you add a group of checkboxes the marked one is really a black circle over the normal one. So add a group of checkboxes and copy the selected.
    – PhoneixS
    Aug 31 at 13:07
0

the original script is:

strokeWidth=1;shadow=0;dashed=0;align=center;html=1;shape=mxgraph.mockup.forms.rrect;rSize=0;fillColor=default;strokeColor=#999999;gradientColor=#cccccc;align=left;spacingLeft=4;fontSize=17;fontColor=#666666;labelPosition=right;sketch=0;verticalAlign=top;spacing=3;spacingTop=-9;comic=0;treeMoving=0;treeFolding=0;part=0;container=0;fixDash=0;snapToPoint=0;

On shape variable replace "rrect" with "checkbox". The result should look like:

strokeWidth=1;shadow=0;dashed=0;align=center;html=1;shape=mxgraph.mockup.forms.checkbox;rSize=0;fillColor=default;strokeColor=#999999;gradientColor=#cccccc;align=left;spacingLeft=4;fontSize=17;fontColor=#666666;labelPosition=right;sketch=0;verticalAlign=top;spacing=3;spacingTop=-9;comic=0;treeMoving=0;treeFolding=0;part=0;container=0;fixDash=0;snapToPoint=0;

I hope it helps.

1
  • That changes a radio button to a checkbox.
    – PhoneixS
    Aug 31 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.