Map and Drawer animation
Add to favorites
Use native elements to create a beautiful map screen
Play video
![icon](http://images.ctfassets.net/ooa29xqb8tix/6LKKWLFkx6JrlMY2mWPocd/2513a06a163424ba900bcff844c2c3fb/play-logo.png?w=400&q=50)
Design and Prototype an App with Play
Map Button
First, let’s create a button to navigate to the Map screen. Add a Stack V and name it: Map Button. Set the Alignment and the Distribution to Center. The Width is 100PT, the Height is 36PT. Pin To Bottom Center, toggle Pin To Page with a Depth of 10. To position it above the Tab bar, set the Offset Y to -106PT. In it, add a Button element. Set the Button Size to Custom, Button Style to Filled, only check the text “Map” and the type is Footnote. Set the Width to 100PT and the Height to 36PT. In Appearance, set the Title Color to white, Corner Radius to 24 and an Effect Background Blur Dark.
- Set the Alignment and the Distribution to Center
- Set the Width to 100PT and the Height to 36PT
- Pin To Bottom Center, toggle Pin To Page with a Depth of 10.
- Set the Offset Y to -106PT
In the Map Button, add a Medium Button element. Set the Button Size to Custom, Button Style to Filled, only check the text “Map” and the type is Footnote.
- Set the Width to 100PT and the Height to 36PT
- In Appearance, set the Title Color to white,
- Set Corner Radius to 24 and add Effect Background Blur Dark
Then, let’s add a Diamond Button, set the margin left to -14 and Pin To Center Left with a Depth of 5. Set the background to Clear and add an Effect Background Blur Dark. Set the Icon to “mapping.and.ellipse” with the color white.
Open Map
While selecting the Page, add a new state and name it: Open Map. Then, on the Map Button, add a Tap trigger with a Set State action where the Target is Page, the Start State is Default and End State is Open Map. On the animation, set the Duration to 0.5s and Easing to Ease In & Out.
Hiding elements
The main differences between the Default state and the Open Map one is that we are replacing everything below the Segmented controls by a Map element and a Drawer.
In the Open Map state, we will hide the Card Container, set the Offset Y of the Tab bar to 100PT and set the Offset Y of the Map Button to 48PT.
Map element
Then, let’s add a Stack V and name it: Map Container. Set the Width to 100%, the Height to 730PT and set the Offset Y to 120PT. Next, add a Map element. On the side, you will see a Pin icon, tap on it and insert a couple pins. Set the Width to 100% and the Height to 730PT. In Appearance, set the Corner Radius to 30 and set the UI Style to your preference. In Settings, you have a lot of Map options: you can set the starting location to a specific pin or even change it.
- Set the Width to 100%, the Height to 730PT
- Set the Offset Y to 120PT.
Next, add a Map element. On the side, you will see a Pin icon, tap on it and insert a couple pins.
- Set the Width to 100% and the Height to 730PT
- In Appearance, set the Corner Radius to 30 and set the UI Style to your preference
- In Settings, you have a lot of Map options: you can set the starting location to a specific pin or even change it
Close Button
Now, let’s add a close button to transit to the Default state. On the Side Menu, we already designed a close button so let’s make it into a component and use it on this screen. Set the margin top to 47, margin right to 16 and Pin To Top Right. Add a Tap trigger with the Set State action. The target is the Page, Start state is Current State and End State is Default. For the animation, set the Duration to 0.5s and Easing to Ease In & Out.
- Set the margin top to 47, margin right to 16 and Pin To Top Right
- Add an Offset Y to 48PT
- Add a Tap trigger with the Set State action. The target is the Page, Start state is Current State and End State is Default
- For the animation, set the Duration to 0.5s and Easing to Ease In & Out
Drawer
The drawer is very similar to a modal but it sticks to the bottom. By using the pan gesture, we will be able to open and close the drawer. First, add a Stack V and name it: Drawer. Set the Gap to 30PT and Alignment to Center. Set the Width to 100% and the Height to 700PT. For the paddings (0, 16, 32, 16) and Pin To Bottom Center with Pin To Page. In Appearance, set the BG Color to #313A5B - #21273D and the Corner Radius top to 20. Add a Border 1PT white at 20% and a Drop Shadow: Offset X 0PT, Offset Y 10PT, Blur 20, Color Black at 30%.
- Set the Gap to 30PT and Alignment to Center
- Set the Width to 100% and the Height to 700PT
- For the paddings (0, 16, 32, 16) and Pin To Bottom Center with Pin To Page
- In Appearance, set the BG Color to #313A5B - #21273D
- Set the Corner Radius top-left to 20 and top-right to 20
- Add a Border 1PT white at 20%
- Add Drop Shadow: Offset X 0PT, Offset Y 10PT, Blur 20, Color Black at 30%.
Then, let’s add elements in it, start with a stack and name it: Indicator. Set the Width to 54PT and the Height to 5PT. Add margin top to 8. In Appearance, set the BG Color to white at 30% opacity and the Corner Radius to 16.
- Set the Width to 54PT and the Height to 5PT
- Add margin top to 8. In Appearance
- Sett the BG Color to white at 30% opacity
- Set the Corner Radius to 16
- Add a Text “289 Cabins”, Type to Subhead 2 and Color White
Duplicate the Booking Card 4 times and make the Drawer into a component.
Drawer Animation
Create a new State called Show. In Default, set the Scrolling to None and the Offset Y to 610PT. Then, in Show, set the Scrolling to vertical and disable the indicator. Set the Offset Y to 0. To allow the Pan gesture, add a trigger While Panning, set Pan Direction to Up & Down, Pan Boundary to Screen and toggle the Optimize for Dragging. Add the action Set State, Target Self, Start State Default, End State Show, Trigger Direction Up at 0.5s Ease In & Out.
- In Default, set the Scrolling to None and the Offset Y to 610PT. Then, in Show, set the Scrolling to vertical and disable the indicator. Set the Offset Y to 0
- To allow the Pan gesture, add a trigger While Panning, set Pan Direction to Up & Down, Pan Boundary to Screen and toggle the Optimize for Dragging. Add the action Set State, Target Self, Start State Default, End State Show, Trigger Direction Up at 0.5s Ease In & Out
Fix bugs
On the Side Menu, make sure to set the Offset Y to 48 to hide it. In Default, hide the Map Container.
Templates and source code
Download source files
Download the videos and assets to refer and learn offline without interuption.
Design template
Source code for all sections
Video files, ePub and subtitles
Browse all downloads
1
Intro to Play
Build a completely functional prototype without writing a single line of code from your phone
4:29
2
Layout and Components
Learn how to make and re-use custom elements
20:23
3
States and Interactions
Make your app more engaging with state-based animations
6:52
4
Custom Search Bar and Segmented Control
Use Textfield to make a custom component
8:03
5
Custom Segmented Controls
Alternative UI to radio buttons and dropdown menus
10:35
6
Tab bar Lottie animation
Create a beautiful animation for Tab Bar using Lottie
17:44
7
Sidebar menu animation
Implement a smooth and exciting menu transition
38:07
8
Map and Drawer animation
Use native elements to create a beautiful map screen
16:32
9
Navigation and Detail screen
Transition to another screen
56:38
10
Native Date Picker
Design a beautiful interactive calendar
9:14
Meet the instructor
We all try to be consistent with our way of teaching step-by-step, providing source files and prioritizing design in our courses.
Willie Yam
Front-end/UI developer at Design+Code
I do UI coding. HTML/CSS/JS/SWIFTUI dev.
10 courses - 37 hours
![course logo](http://images.ctfassets.net/ooa29xqb8tix/6LKKWLFkx6JrlMY2mWPocd/2513a06a163424ba900bcff844c2c3fb/play-logo.png?w=400&q=50?fm=jpg&q=50)
Design and Prototype an App with Play
Build a completely functional prototype without writing a single line of code from your phone
3 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/1bYdUtniEAUH3jdqQd3Qc1/7cf21d20882bfe59f01d7bc74e81010d/react-logo.png?w=400&q=50?fm=jpg&q=50)
Create a 3D site with game controls in Spline
Build an interactive 3D scene implemented on a ReactJS site using Figma and Spline
2 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/4bWEQMRsA6PzjiHljsxryp/55d78d84da072e9c22caddbccd67396b/swift-logo.png?w=400&q=50?fm=jpg&q=50)
Build a Movie Booking App in SwiftUI
Learn how to create an iOS app based on a beautiful UI design from Figma with interesting animations and interactions, create a custom tab bar and use navigation views to build a whole flow
1 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/628IYmTv4uib8slYz9iuok/3de9010de04ae92a23c94f9885746db2/swift-logo.png?w=400&q=50?fm=jpg&q=50)
Build Quick Apps with SwiftUI
Apply your Swift and SwiftUI knowledge by building real, quick and various applications from scratch
11 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/0cjyplK9nhXoHTHN3XfTr/0e1edc5106a4c99ca2de7eeaaa772603/ui-logo.png?w=400&q=50?fm=jpg&q=50)
CSS Handbook
A comprehensive series of tutorials that encompass styled-components, CSS, and all layout and UI developments
1 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/1bYdUtniEAUH3jdqQd3Qc1/7cf21d20882bfe59f01d7bc74e81010d/react-logo.png?w=400&q=50?fm=jpg&q=50)
Advanced React Hooks
Learn how to build a website with Typescript, Hooks, Contentful and Gatsby Cloud
5 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/4k80OoiAH74E4JWnzT7iHv/d8b989084c313064df5be11f940ea48b/unity-logo.png?w=400&q=50?fm=jpg&q=50)
Unity for Designers
If you want to make a game and don't know where to start, you are in the right place. I will teach you how to use Unity, code in C# and share essential tips and tricks to make your first game.
5 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/1YISP6mvD83Gao3lQdhWqi/8b36d37d05f77a894dd0b7d30f8e6753/js-logo.png?w=400&q=50?fm=jpg&q=50)
Create a Javascript Game
Learn how to create a web game using Phaser 3, a popular javascript game engine. Draw a map using an editor, implement the player, make the player move, apply physics, collisions, and implement the enemies.
2 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/4bWEQMRsA6PzjiHljsxryp/55d78d84da072e9c22caddbccd67396b/swift-logo.png?w=400&q=50?fm=jpg&q=50)
Build an ARKit 2 App
Introduction to ARKit and learn how to make your own playground. You will be able to add models or even your own designs into the app and play with them
4 hrs
![course logo](http://images.ctfassets.net/ooa29xqb8tix/4bWEQMRsA6PzjiHljsxryp/55d78d84da072e9c22caddbccd67396b/swift-logo.png?w=400&q=50?fm=jpg&q=50)
Create a SpriteKit Game
Overview of SpriteKit a powerful 2D sprite-based framework for games development from Apple and learn how to create your very own platform
3 hrs