Skip to content

Onboarding welcome screen in SwiftUI, Flutter, React Native and HTML/CSS

A single welcome screen in all four targets: gradient hero, shadow card, page dots and a CTA.

Open in editor

An onboarding welcome screen is mostly decoration, which makes it a good test of whether an export keeps the parts that are hard to type by hand: a gradient at an exact angle, translucent shapes stacked over it, a soft drop shadow, and a call to action pinned near the bottom. We drew one at 390 by 844 (an iPhone 14) on a warm off-white background and exported it to all four targets. The code below is the generator's output, unedited.

What we drew

ElementPositionSizeNotes
"Skip"x 310, y 6456 x 2215px, grey, right-aligned
Hero panelx 24, y 120342 x 360radius 28, gradient blue to pink at 135 degrees
Large orbx 60, y 170120 x 120white at 25% opacity
Small orbx 230, y 33096 x 96white at 18% opacity
Hero cardx 72, y 250246 x 150white, radius 20, shadow blur 24, y offset 12
Headlinex 32, y 520326 x 6828px, bold, centred, two lines
Bodyx 40, y 600310 x 4616px, grey, centred, two lines
Active page dotx 167, y 66824 x 8radius 4, blue
Page dot twox 199, y 6688 x 8circle
Page dot threex 215, y 6688 x 8circle
"Get started"x 24, y 736342 x 56filled, radius 16

The hero card is centred on the hero panel: the panel spans x 24 to 366, so its centre is 195, and the card at x 72 with width 246 has the centre 72 + 123 = 195. The three page dots are centred on the screen the same way: they run from x 167 to 223 (24 + 8 gap + 8 + 8 gap + 8) and 167 + 56 / 2 = 195. The button ends at y 792, which leaves 52 below it on an 844 canvas, enough to clear the 34 points the home indicator occupies.

React Native

The gradient is an expo-linear-gradient LinearGradient (the one import this screen needs beyond react-native), with its start and end points worked out from the 135 degree angle. The orbs use opacity, and the hero card carries shadowColor, shadowOffset and shadowRadius, plus elevation for Android.

import React from 'react';
import { View, Text, Pressable, StyleSheet } from 'react-native';
import { LinearGradient } from 'expo-linear-gradient';

export default function Welcome() {
  const handleStart = () => {};

  return (
    <View style={styles.screen}>
      <Text style={styles.skip}>{"Skip"}</Text>
      <LinearGradient colors={['#2A50D8', '#FF4B7E']} start={{ x: 0.15, y: 0.15 }} end={{ x: 0.85, y: 0.85 }} style={styles.hero} />
      <View style={styles.orbLarge} />
      <View style={styles.orbSmall} />
      <View style={styles.heroCard} />
      <Text style={styles.headline}>{"Plan your week in one place"}</Text>
      <Text style={styles.body}>{"Add tasks, set reminders, and see what is next at a glance."}</Text>
      <View style={styles.dotActive} />
      <View style={styles.dotTwo} />
      <View style={styles.dotThree} />
      <Pressable onPress={handleStart} style={({ pressed }) => [styles.group, pressed && styles.pressed]}>
        <View style={styles.start} />
        <View style={styles.startLabel}><Text style={styles.startLabelText}>{"Get started"}</Text></View>
      </Pressable>
    </View>
  );
}

const styles = StyleSheet.create({
  screen: {
    flex: 1,
    backgroundColor: '#F6F4EE',
  },
  skip: {
    position: 'absolute',
    left: 310,
    top: 64,
    width: 56,
    height: 22,
    color: '#5B5B63',
    fontFamily: 'Inter',
    fontSize: 15,
    lineHeight: 21,
    textAlign: 'right',
  },
  hero: {
    position: 'absolute',
    left: 24,
    top: 120,
    width: 342,
    height: 360,
    borderRadius: 28,
  },
  orbLarge: {
    position: 'absolute',
    left: 60,
    top: 170,
    width: 120,
    height: 120,
    borderRadius: 60,
    backgroundColor: '#ffffff',
    opacity: 0.25,
  },
  orbSmall: {
    position: 'absolute',
    left: 230,
    top: 330,
    width: 96,
    height: 96,
    borderRadius: 48,
    backgroundColor: '#ffffff',
    opacity: 0.18,
  },
  heroCard: {
    position: 'absolute',
    left: 72,
    top: 250,
    width: 246,
    height: 150,
    borderRadius: 20,
    backgroundColor: '#ffffff',
    shadowColor: '#1B2A6B',
    shadowOffset: { width: 0, height: 12 },
    shadowOpacity: 1,
    shadowRadius: 24,
    elevation: 24,
  },
  headline: {
    position: 'absolute',
    left: 32,
    top: 520,
    width: 326,
    height: 68,
    color: '#17171A',
    fontFamily: 'Inter',
    fontSize: 28,
    lineHeight: 34,
    textAlign: 'center',
    fontWeight: '700',
  },
  body: {
    position: 'absolute',
    left: 40,
    top: 600,
    width: 310,
    height: 46,
    color: '#5B5B63',
    fontFamily: 'Inter',
    fontSize: 16,
    lineHeight: 22,
    textAlign: 'center',
  },
  dotActive: {
    position: 'absolute',
    left: 167,
    top: 668,
    width: 24,
    height: 8,
    borderRadius: 4,
    backgroundColor: '#2A50D8',
  },
  dotTwo: {
    position: 'absolute',
    left: 199,
    top: 668,
    width: 8,
    height: 8,
    borderRadius: 4,
    backgroundColor: '#D7D3C8',
  },
  dotThree: {
    position: 'absolute',
    left: 215,
    top: 668,
    width: 8,
    height: 8,
    borderRadius: 4,
    backgroundColor: '#D7D3C8',
  },
  group: {
    position: 'absolute',
    left: 24,
    top: 736,
    width: 342,
    height: 56,
  },
  start: {
    position: 'absolute',
    left: 0,
    top: 0,
    width: 342,
    height: 56,
    borderRadius: 16,
    backgroundColor: '#2A50D8',
  },
  startLabel: {
    position: 'absolute',
    left: 0,
    top: 0,
    width: 342,
    height: 56,
    justifyContent: 'center',
  },
  startLabelText: {
    color: '#ffffff',
    fontFamily: 'Inter',
    fontSize: 16,
    lineHeight: 21,
    textAlign: 'center',
    fontWeight: '600',
  },
  pressed: {
    opacity: 0.6,
  },
});

What this does not do

  • Not a pager. The dots are drawn shapes. There is no swipe, no carousel and no state: moving to the next onboarding step, and highlighting the next dot, is yours to build.
  • "Skip" is text. It is not wired to anything. Make it a button in your project, or draw it as one on the canvas.
  • One extra dependency in React Native. The gradient needs expo-linear-gradient. The other three targets need nothing beyond their platform.
  • Fixed size. The layout is 390 by 844. On a shorter phone the bottom button and the page dots would crowd the headline, so draw a second screen for that size.
  • Fonts by name. Inter is asked for by family name and not embedded.

Make your own

Open the editor, change any number, and the four files above change with it. What you can build lists every control and property the canvas supports, limits included.