Quick Tip: How to Create a Simple Set of Switch Buttons
In the following tutorial you will learn how to create a simple set of switch buttons. First, we'll use the Rectangle Tool along with the Rounded Corners and the Drop Shadow effects to create the shapes behind the button. For the button we'll use a mesh, some Pathfinder options and two simple strokes.
Create a 600 by 300px, RGB document. First, enable the Grid (View > Show Grid) and the Snap to Grid (View > Snap to Grid). Next, you'll need a grid every 1px. Go to Edit > Preferences > Guides > Grid, enter 1 in the Gridline every box and 1 in the Subdivisions box. You can also open the Info panel (Window > Info) for a live preview with the size and position of your shapes. Do not forget to replace the unit of measurement to pixels from Edit > Preferences > Unit > General. Al these options will significantly increase your work speed.
Pick the Rectangle Tool (M) and create a 60 by 30px shape. Fill it with the linear gradient shown below and add a 1pt stroke. Set its color at R=88 G=89 B=91 and align it to outside.
Reselect the rectangle created in the previous step and focus on the Appearance panel (Window > Appearance). Add a second stroke for your shape using the Add New Stroke button. It's the little, black square icon from the bottom of the Appearance panel. Select this new stroke from the Appearance panel. Set its color to R=35 G=31 B=32, align it to inside, lower its opacity to 30% and change its blending mode to Overlay. Make sure that this new stroke is still selected and click on the Duplicate Selected Item button. It's the little, file icon from the bottom of the Appearance panel. Obviously, this added a copy of the selected stroke. Select it and decrease its weight to 1pt.
Reselect your shape, make sure that no fill or stroke is selected (in the Appearance panel) and go to Effect > Stylize > Drop Shadow. Enter the data shown below, click OK and go to Effect > Stylize > Rounded Corners. Enter a 14px radius and click OK. Focus on the Appearance panel and make sure that the Rounded Corners is at the top of the Appearance panel.
Pick the Rectangle Tool (M), create a 33 by 2px shape and place it as shown in the following image. Fill it with the linear gradient shown below and add a 1pt stroke. Set its color at R=230 G=231 B=232 and align it to outside. Reselect this rectangle, make sure that no fill or stroke is selected and go to Effect > Stylize > Rounded Corners. Enter a 1px radius and click OK.
Pick the Ellipse Tool (L) and create a 28px circle. Fill it with the radial gradient shown below, place it as shown in the following image and go to Object > Expand. Check the Gradient Mesh button from the Expand menu and click OK. Move to the Layers panel and you will find a group with a mesh a clipping path. Delete the clipping path then ungroup the mesh (Shift + Command + G).
Reselect the mesh created in the previous step and open the Transform panel. Make sure the the "Constrain Width and Height Proportions" button is checked then enter 28 in the width box. Continue with the Mesh Tool (U) and add the four mesh points highlighted in the second image.
Reselect the mesh edited in the previous step. Pick the Direct Selection Tool (A), select the mesh points one by one and add the colors shown in the following image.
Pick the Ellipse Tool (L), create an 8px circle, fill it with black and place it as shown in the first image. Open the Transparency panel (Window > Transparency). Select this black circle along with the mesh, open the fly-out menu of the Transparency panel, click on Make Opacity Mask then uncheck the Clip box. In the end your mesh should look like in the third image.
Pick the Ellipse Tool (L), create a 28px circle, fill it with a random color and place it as shown in the first image. Select this new circle and go to Object > Path > Offset Path. Enter a -10px Offset and click OK. Select both circles, open the Pathfinder panel and click on the Minus Front button. Select the resulting shape, remove the color from the fill and add a 1pt stroke. Set its color at R=45 G=45 B=45 and align it to outside. Add a second stroke for this shape, make it white and align it to inside.
Finally, you can recolor your buttons. In the following images you can find two different set of colors that you can use for your button.
Now your work is done. Here is how it should look. I hope you've enjoyed this tut.