Design+Code logo

Quick links

Suggested search

01

Search Bar Container

  • Add a Stack H and rename it Search Bar Container
  • In Settings, set the Gap to 4
  • In Layout, set the Height to 104pt and paddings to 60, 16, 0, 16
  • Set Pin To Top left

When we scroll the cards, we still want to keep the Search bar fixed at the top. To keep the Search over the cards, set Depth to 11.

  • In Appearance, set the background Color to #17182B

02

Diamond Button

  • Add a Stack V and rename it Diamond Button
  • In Layout, set the Width and the Height to 44pt and paddings to 6
  • Add a new Stack in the Stack and rename it Background
  • In Layout, set the Width and the Height to 100%
  • In Appearance, set a new background color; color White - 10%
  • Add a Corner Radius 10
  • Add Border 1pt, color white, opacity 10%
  • In Transform, set the rotation Z to 45
  • For the Icon, add a SF Symbol in the parent Stack
  • In Settings, set the icon to “list.bullet”, Size to 15pt, Container Size to 32x32 and the Color to System Gray
  • In Layout, set Pin To Center Center
  • Make it into a component because we will be using this UI a lot

03

Search Bar

  • Add a Stack H and rename it Search Bar
  • In Settings, set the Alignment to Center and Distribution to Space Between
  • In Layout, set the Width to 248pt, Height to 42pt, paddings to 10, 16, 10, 16
  • In Appearance, set the background color to Gradient #22283E - #171827
  • Set Corner Radius to 30
  • Add a Border 1pt, color white, opacity 10%

The Search bar contains 3 elements, 2 icons and a text field. Add a SF Symbol.

  • Set the icon to “magnifyingglass”, Size to 16pt, Container Size to 24x24 and the Color to System Gray
  • Duplicate it and change the icon to “mic.fill”

04

Text Field

The Text field element is a really important UI that allows users to enter text into a UI. It is normally used in forms.

  • Add a Text field
  • In Settings, Placeholder Text to “Where To”
  • Set Type to “Footnote - Bold”: Styles Bold and Size 13pt
  • Set the Text in White, the Placeholder in System Gray and the Alignment Center
  • In Layout, set the Width to Fill Width and the Height to 42pt

05

When you scroll, the Search Bar doesn’t stick to the top. To fix that, go to Layout and toggle Pin to Page. Also, don’t forget to turn the Search Bar into a component.

BACK TO

States and Interactions

READ NEXT

Custom Segmented Controls

Templates and source code

Download source files

Download the videos and assets to refer and learn offline without interuption.

check

Design template

check

Source code for all sections

check

Video files, ePub and subtitles

Browse all downloads

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.

icon

10 courses - 37 hours

course logo

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

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

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

Build Quick Apps with SwiftUI

Apply your Swift and SwiftUI knowledge by building real, quick and various applications from scratch

11 hrs

course logo

CSS Handbook

A comprehensive series of tutorials that encompass styled-components, CSS, and all layout and UI developments

1 hrs

course logo

Advanced React Hooks

Learn how to build a website with Typescript, Hooks, Contentful and Gatsby Cloud

5 hrs

course logo

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

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

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

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