Master the use of drag, time interactions, sound effects, and keystrokes in Adobe XD while designing a "drag to delete" feature for a Messages app by following this comprehensive tutorial.
This exercise is excerpted from Noble Desktop’s past web design training materials and is compatible with Adobe XD updates through 2020. We now teach Figma as the primary tool for web and UX & UI design. To learn current skills in web design, check out our Figma Bootcamp and graphic design classes in NYC and live online.
Topics covered in this Adobe XD tutorial:
Adding a Drag Interaction, Adding a Time Interaction, Adding a Sound Effect, Adding a Keystroke
Exercise Preview
Exercise Overview
In this exercise, you’ll design a “drag to delete” feature for a Messages app. You’ll use drag interactions, timed interactions, and define a keystroke.
Getting Started
- In Adobe XD, go to File > Open from Your Computer or hit Cmd–Shift–O (Mac) or Ctrl–Shift–O (Windows).
-
Navigate into Desktop > Class Files > Adobe XD Class and double–click on Messages App.xd to open it.
We’ve already created the layout and graphics for this design, so let’s focus on prototyping the functionality that will lets us swipe to delete the Erin Steed message. This functionality and animation can’t be built entirely into a component, so we’ll choose one message to show it off on. This will be good enough to show the client and developer how we want the feature to work.
- In the Toolbar, choose the Select tool
.
- Click on the red trash can graphic to select it.
- Cut it by hitting Cmd–X (Mac) or Ctrl–X (Windows).
- Now we need to put it into the Erin Steed message row, hidden off screen, so we can swipe across and reveal the hidden red bar. Double–click on the Erin Steed message row to go into the component instance.
- Paste the red bar by hitting Cmd–V (Mac) or Ctrl–V (Windows).
-
As shown below, hold Shift and drag the red bar to the right so its edge touches the edge the artboard (it will snap into place).
- Click in an empty area of the canvas to make sure nothing is selected. The red bar will disappear but don’t worry!
- Select the artboard by clicking on the artboard name Messages (at the top left of the artboard).
- Duplicate it by hitting Cmd–D (Mac) or Ctrl–D (Windows).
- Rename the new artboard by double–clicking the Messages – 1 name at the top left and change it to Delete.
-
Drag the Delete artboard down slightly (by dragging its name to move it).
When things overlap in a moment this will make it easier to see what’s going on.
-
On the Delete artboard, drag the Erin Steed message row to the left so you reveal the entire red bar. You should end up with it looking like this:
NOTE: The first artboard shows the initial design. The second artboard shows how it will look at the end of the drag.
Adding a Drag Interaction
- At the top left of the window click Prototype.
- In the first artboard Messages, select the Erin Steed message row.
- A blue arrow will appear to the right of the red bar. Drag the blue arrow to the Delete artboard.
-
In the Property Inspector, set:
- Trigger: Drag
- Type: Auto-Animate
- Destination: Delete
- Easing: None
- At the top right of the window, click on Desktop Preview
or hit Cmd–Return (Mac) or Ctrl–Enter (Windows).
- Drag right to left over the Erin Steed message row to reveal the red delete bar. If you don’t drag very far it will snap back to the initial appearance, but if you drag far enough it will snap so the full red bar is shown.
Close the preview window.
Adding a Time Interaction
We need the red delete row to disappear without us doing any additional interaction. How do we tell XD to do something automatically? With a time interaction!
- At the top left of the window, click on Design.
- Click on the Delete artboard’s name to select it.
- Duplicate it by hitting Cmd–D (Mac) or Ctrl–D (Windows).
- Double–click on the artboard name Delete – 1 and change it to Done.
- In the Done artboard, select the red delete row.
-
Drag the bottom resize handle up so the red bar’s height becomes nothing (the trash can icon will still be partially visible, but the next step will take care of that).
- In the Property Inspector, set Opacity
to 0%.
- The lower messages must be moved up to fill the empty space. We’ve grouped all those messages, so drag them up (hold Shift as you drag) to fill the gap.
- At the top left of the window click Prototype.
- Select the Delete artboard by clicking its name.
- A blue arrow will appear on the right side of the artboard. Drag the blue arrow to the Done artboard.
-
In the Property Inspector, set:
- Trigger: Time
- Delay: 0 s
- Type: Auto-Animate
- Destination: Done
- Easing: None
- Duration: 0.2 s
- Click in an empty area of the canvas to sure nothing is selected.
- At the top right of the window, click on Desktop Preview
or hit Cmd–Return (Mac) or Ctrl–Enter (Windows).
- Drag right to left over the Erin Steed message row and release to see the red bar appear and then animate away!
Close the preview window.
Adding a Sound Effect
- Select the Done artboard by clicking its name.
- A blue arrow will appear on the right side of the artboard. Click the blue arrow (don’t drag this time, just click it).
-
In the Property Inspector, set:
- Trigger: Time
- Delay: 0 s
- Type: Audio Playback
- Audio File: Click on the menu and choose Add New File. Navigate into Desktop > Class Files > Adobe XD Class > Sounds and double–click on trash.wav to choose it.
- Click in an empty area of the canvas to sure nothing is selected.
- Make sure your speakers are on and loud enough to hear sounds.
- At the top right of the window, click on Desktop Preview
or hit Cmd–Return (Mac) or Ctrl–Enter (Windows).
- Drag right to left over the Erin Steed message row and release. The red bar appear will appear, animate away, and you should now hear a trash sound effect!
Close the preview window.
Adding a Keystroke
Finally, let’s add a keystroke to undo the message deletion.
- Select the Done artboard by clicking its name.
- A blue plus will appear on the right side of the artboard. Drag the blue plus to the Messages artboard.
-
In the Property Inspector, set:
- Trigger: Keys & Gamepad
- Key: Click into the field and press Cmd–Z (Mac) or Ctrl–Z (Windows)
- Type: Auto-Animate
- Destination: Messages
- Easing: Ease Out
- Duration: 0.2 s
- Click in an empty area of the canvas to sure nothing is selected.
- At the top right of the window, click on Desktop Preview
or hit Cmd–Return (Mac) or Ctrl–Enter (Windows).
- Drag right to left over the Erin Steed message row to delete the message.
Hit Cmd–Z (Mac) or Ctrl–Z (Windows) to undo and the Erin Steed message should reappear!
Audio in the Libraries Panel
The first time you add a sound it’s embedded into your XD file. It can be seen in the Audio File menu when choosing sounds, and also in the Libraries panel under Audio.
In the Libraries panel , you can Ctrl–click (Mac) or Right–click (Windows) on a sound and choose Delete if you’re not using it and want it to reduce the filesize or the XD file.
Free UI Kits
This Messages app was part of Apple’s iOS UI Kit they provide for free to make it easier to design iOS apps. To download it, in Adobe XD choose File > Get UI Kits > Apple iOS (and notice there are other UI Kits there too).
Apple’s default iOS system font is called San Francisco (SF for short). For this exercise we replaced San Francisco with Arial to avoid having missing fonts, but when using Apple’s UI Kit you should download San Francisco from developer.apple.com/fonts and install it on your computer.