<!-- Markdown twin of https://oneredesign.com/screens/onboarding -->

# 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](/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

| Element | Position | Size | Notes |
| --- | --- | --- | --- |
| "Skip" | x 310, y 64 | 56 x 22 | 15px, grey, right-aligned |
| Hero panel | x 24, y 120 | 342 x 360 | radius 28, gradient blue to pink at 135 degrees |
| Large orb | x 60, y 170 | 120 x 120 | white at 25% opacity |
| Small orb | x 230, y 330 | 96 x 96 | white at 18% opacity |
| Hero card | x 72, y 250 | 246 x 150 | white, radius 20, shadow blur 24, y offset 12 |
| Headline | x 32, y 520 | 326 x 68 | 28px, bold, centred, two lines |
| Body | x 40, y 600 | 310 x 46 | 16px, grey, centred, two lines |
| Active page dot | x 167, y 668 | 24 x 8 | radius 4, blue |
| Page dot two | x 199, y 668 | 8 x 8 | circle |
| Page dot three | x 215, y 668 | 8 x 8 | circle |
| "Get started" | x 24, y 736 | 342 x 56 | filled, 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,
  },
});
```

## SwiftUI

The gradient is a `LinearGradient` fill with start and end `UnitPoint`s of (0.15, 0.15) and (0.85, 0.85), which is the 135 degree angle on a 342 by 360 box. The orbs are `Circle`s with `.opacity`, and the card uses `.shadow(radius: 24, x: 0, y: 12)`.

```
import SwiftUI

struct Welcome: View {
  private func handleStart() {}

  var body: some View {
    ZStack(alignment: .topLeading) {
      Color(red: 0.96, green: 0.96, blue: 0.93)
        .frame(width: 390, height: 844)
      Text("Skip")
        .font(.custom("Inter", size: 15))
        .lineSpacing(6)
        .foregroundColor(Color(red: 0.36, green: 0.36, blue: 0.39))
        .multilineTextAlignment(.trailing)
        .frame(width: 56, height: 22, alignment: .topLeading)
        .position(x: 338, y: 75)
      RoundedRectangle(cornerRadius: 28)
        .fill(LinearGradient(colors: [Color(red: 0.16, green: 0.31, blue: 0.85), Color(red: 1, green: 0.29, blue: 0.49)], startPoint: UnitPoint(x: 0.15, y: 0.15), endPoint: UnitPoint(x: 0.85, y: 0.85)))
        .frame(width: 342, height: 360)
        .position(x: 195, y: 300)
      Circle()
        .fill(Color(red: 1, green: 1, blue: 1))
        .frame(width: 120, height: 120)
        .opacity(0.25)
        .position(x: 120, y: 230)
      Circle()
        .fill(Color(red: 1, green: 1, blue: 1))
        .frame(width: 96, height: 96)
        .opacity(0.18)
        .position(x: 278, y: 378)
      RoundedRectangle(cornerRadius: 20)
        .fill(Color(red: 1, green: 1, blue: 1))
        .frame(width: 246, height: 150)
        .shadow(color: Color(red: 0.11, green: 0.16, blue: 0.42), radius: 24, x: 0, y: 12)
        .position(x: 195, y: 325)
      Text("Plan your week in one place")
        .font(.custom("Inter", size: 28))
        .fontWeight(.bold)
        .lineSpacing(5.6)
        .foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
        .multilineTextAlignment(.center)
        .frame(width: 326, height: 68, alignment: .topLeading)
        .position(x: 195, y: 554)
      Text("Add tasks, set reminders, and see what is next at a glance.")
        .font(.custom("Inter", size: 16))
        .lineSpacing(6.4)
        .foregroundColor(Color(red: 0.36, green: 0.36, blue: 0.39))
        .multilineTextAlignment(.center)
        .frame(width: 310, height: 46, alignment: .topLeading)
        .position(x: 195, y: 623)
      RoundedRectangle(cornerRadius: 4)
        .fill(Color(red: 0.16, green: 0.31, blue: 0.85))
        .frame(width: 24, height: 8)
        .position(x: 179, y: 672)
      Circle()
        .fill(Color(red: 0.84, green: 0.83, blue: 0.78))
        .frame(width: 8, height: 8)
        .position(x: 203, y: 672)
      Circle()
        .fill(Color(red: 0.84, green: 0.83, blue: 0.78))
        .frame(width: 8, height: 8)
        .position(x: 219, y: 672)
      Button(action: handleStart) {
        ZStack(alignment: .topLeading) {
        RoundedRectangle(cornerRadius: 16)
        .fill(Color(red: 0.16, green: 0.31, blue: 0.85))
        .frame(width: 342, height: 56)
        .position(x: 171, y: 28)
        Text("Get started")
        .font(.custom("Inter", size: 16))
        .fontWeight(.semibold)
        .lineSpacing(4.8)
        .foregroundColor(Color(red: 1, green: 1, blue: 1))
        .multilineTextAlignment(.center)
        .frame(width: 342, height: 56, alignment: .center)
        .position(x: 171, y: 28)
      }
      .frame(width: 342, height: 56)
      }
      .buttonStyle(PressStyle())
      .position(x: 195, y: 764)
    }
    .frame(width: 390, height: 844)
  }
}

struct PressStyle: ButtonStyle {
  func makeBody(configuration: Configuration) -> some View {
    configuration.label.opacity(configuration.isPressed ? 0.6 : 1)
  }
}
```

## Flutter

The gradient is a `BoxDecoration` with a `LinearGradient` whose `begin` and `end` alignments come from the same angle, and the card's shadow is a `BoxShadow` with `blurRadius: 24` and `offset: Offset(0, 12)`.

```
import 'package:flutter/material.dart';

class Welcome extends StatelessWidget {
  const Welcome({super.key});

  void handleStart() {}

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 390,
      height: 844,
      child: Stack(
        children: [
          Positioned.fill(child: Container(color: Color(0xFFF6F4EE))),
          Positioned(
            left: 310,
            top: 64,
            child: SizedBox(
              width: 56,
              height: 22,
              child: Text(
                'Skip',
                textAlign: TextAlign.right,
                style: TextStyle(
                  fontFamily: 'Inter',
                  fontSize: 15,
                  color: Color(0xFF5B5B63),
                  height: 1.4,
                ),
              ),
            ),
          ),
          Positioned(
            left: 24,
            top: 120,
            child: Container(
              width: 342,
              height: 360,
              decoration: BoxDecoration(
                gradient: LinearGradient(
                  colors: [Color(0xFF2A50D8), Color(0xFFFF4B7E)],
                  begin: Alignment(-0.71, -0.71),
                  end: Alignment(0.71, 0.71),
                ),
                borderRadius: BorderRadius.circular(28),
              ),
            ),
          ),
          Positioned(
            left: 60,
            top: 170,
            child: Opacity(
              opacity: 0.25,
              child: Container(
                width: 120,
                height: 120,
                decoration: BoxDecoration(
                  color: Color(0xFFFFFFFF),
                  shape: BoxShape.circle,
                ),
              ),
            ),
          ),
          Positioned(
            left: 230,
            top: 330,
            child: Opacity(
              opacity: 0.18,
              child: Container(
                width: 96,
                height: 96,
                decoration: BoxDecoration(
                  color: Color(0xFFFFFFFF),
                  shape: BoxShape.circle,
                ),
              ),
            ),
          ),
          Positioned(
            left: 72,
            top: 250,
            child: Container(
              width: 246,
              height: 150,
              decoration: BoxDecoration(
                color: Color(0xFFFFFFFF),
                borderRadius: BorderRadius.circular(20),
                boxShadow: [
                  BoxShadow(
                    color: Color(0xFF1B2A6B),
                    blurRadius: 24,
                    offset: Offset(0, 12),
                  ),
                ],
              ),
            ),
          ),
          Positioned(
            left: 32,
            top: 520,
            child: SizedBox(
              width: 326,
              height: 68,
              child: Text(
                'Plan your week in one place',
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontFamily: 'Inter',
                  fontSize: 28,
                  color: Color(0xFF17171A),
                  height: 1.2,
                  fontWeight: FontWeight.w700,
                ),
              ),
            ),
          ),
          Positioned(
            left: 40,
            top: 600,
            child: SizedBox(
              width: 310,
              height: 46,
              child: Text(
                'Add tasks, set reminders, and see what is next at a glance.',
                textAlign: TextAlign.center,
                style: TextStyle(
                  fontFamily: 'Inter',
                  fontSize: 16,
                  color: Color(0xFF5B5B63),
                  height: 1.4,
                ),
              ),
            ),
          ),
          Positioned(
            left: 167,
            top: 668,
            child: Container(
              width: 24,
              height: 8,
              decoration: BoxDecoration(
                color: Color(0xFF2A50D8),
                borderRadius: BorderRadius.circular(4),
              ),
            ),
          ),
          Positioned(
            left: 199,
            top: 668,
            child: Container(
              width: 8,
              height: 8,
              decoration: BoxDecoration(
                color: Color(0xFFD7D3C8),
                shape: BoxShape.circle,
              ),
            ),
          ),
          Positioned(
            left: 215,
            top: 668,
            child: Container(
              width: 8,
              height: 8,
              decoration: BoxDecoration(
                color: Color(0xFFD7D3C8),
                shape: BoxShape.circle,
              ),
            ),
          ),
          Positioned(
            left: 24,
            top: 736,
            child: _Pressable(
              onTap: handleStart,
              child: SizedBox(
                width: 342,
                height: 56,
                child: Stack(
                  children: [
                    Positioned(
                      left: 0,
                      top: 0,
                      child: Container(
                        width: 342,
                        height: 56,
                        decoration: BoxDecoration(
                          color: Color(0xFF2A50D8),
                          borderRadius: BorderRadius.circular(16),
                        ),
                      ),
                    ),
                    Positioned(
                      left: 0,
                      top: 0,
                      child: SizedBox(
                        width: 342,
                        height: 56,
                        child: Align(
                          alignment: Alignment.center,
                          child: Text(
                            'Get started',
                            textAlign: TextAlign.center,
                            style: TextStyle(
                              fontFamily: 'Inter',
                              fontSize: 16,
                              color: Color(0xFFFFFFFF),
                              height: 1.3,
                              fontWeight: FontWeight.w600,
                            ),
                          ),
                        ),
                      ),
                    ),
                  ],
                ),
              ),
            ),
          ),
        ],
      ),
    );
  }
}

class _Pressable extends StatefulWidget {
  final VoidCallback onTap;
  final Widget child;
  const _Pressable({required this.onTap, required this.child});

  @override
  State<_Pressable> createState() => _PressableState();
}

class _PressableState extends State<_Pressable> {
  bool _pressed = false;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: widget.onTap,
      onTapDown: (_) => setState(() => _pressed = true),
      onTapUp: (_) => setState(() => _pressed = false),
      onTapCancel: () => setState(() => _pressed = false),
      child: Opacity(opacity: _pressed ? 0.6 : 1.0, child: widget.child),
    );
  }
}
```

## HTML and CSS

The gradient is a single CSS `linear-gradient(135deg, #2A50D8 0%, #FF4B7E 100%)` background, the orbs use `opacity`, and the card has a `box-shadow`. This is the lightest of the four exports for this screen.

```
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Welcome</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Inter&display=swap" rel="stylesheet" />
<style>
html, body {
  margin: 0;
  padding: 0;
  background: #F6F4EE;
}
.screen {
  position: relative;
  width: 390px;
  height: 844px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  background: #F6F4EE;
}
.screen::-webkit-scrollbar {
  display: none;
}
.skip {
  position: absolute;
  left: 310px;
  top: 64px;
  width: 56px;
  height: 22px;
  color: #5B5B63;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  text-align: right;
  line-height: 1.4;
  white-space: pre-wrap;
}
.hero {
  position: absolute;
  left: 24px;
  top: 120px;
  width: 342px;
  height: 360px;
  background: linear-gradient(135deg, #2A50D8 0%, #FF4B7E 100%);
  border-radius: 28px;
}
.orbLarge {
  position: absolute;
  left: 60px;
  top: 170px;
  width: 120px;
  height: 120px;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.25;
}
.orbSmall {
  position: absolute;
  left: 230px;
  top: 330px;
  width: 96px;
  height: 96px;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.18;
}
.heroCard {
  position: absolute;
  left: 72px;
  top: 250px;
  width: 246px;
  height: 150px;
  background: #ffffff;
  border-radius: 20px;
  filter: drop-shadow(0px 12px 24px #1B2A6B);
}
.headline {
  position: absolute;
  left: 32px;
  top: 520px;
  width: 326px;
  height: 68px;
  color: #17171A;
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  white-space: pre-wrap;
}
.body {
  position: absolute;
  left: 40px;
  top: 600px;
  width: 310px;
  height: 46px;
  color: #5B5B63;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  text-align: center;
  line-height: 1.4;
  white-space: pre-wrap;
}
.dotActive {
  position: absolute;
  left: 167px;
  top: 668px;
  width: 24px;
  height: 8px;
  background: #2A50D8;
  border-radius: 4px;
}
.dotTwo {
  position: absolute;
  left: 199px;
  top: 668px;
  width: 8px;
  height: 8px;
  background: #D7D3C8;
  border-radius: 50%;
}
.dotThree {
  position: absolute;
  left: 215px;
  top: 668px;
  width: 8px;
  height: 8px;
  background: #D7D3C8;
  border-radius: 50%;
}
.group {
  position: absolute;
  left: 24px;
  top: 736px;
  width: 342px;
  height: 56px;
  cursor: pointer;
}
.start {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 342px;
  height: 56px;
  background: #2A50D8;
  border-radius: 16px;
}
.startLabel {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 342px;
  height: 56px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  white-space: pre-wrap;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tappable {
  appearance: none;
  border: none;
  padding: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: inherit;
}
.tappable:active {
  opacity: 0.6;
}
</style>
</head>
<body>
  <div class="screen">
    <div class="skip">Skip</div>
    <div class="hero"></div>
    <div class="orbLarge"></div>
    <div class="orbSmall"></div>
    <div class="heroCard"></div>
    <div class="headline">Plan your week in one place</div>
    <div class="body">Add tasks, set reminders, and see what is next at a glance.</div>
    <div class="dotActive"></div>
    <div class="dotTwo"></div>
    <div class="dotThree"></div>
    <button type="button" class="tappable group" onclick="handleStart()">
      <div class="start"></div>
      <div class="startLabel">Get started</div>
    </button>
  </div>
<script>
function handleStart() {}
</script>
</body>
</html>
```

## 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](/docs/what-you-can-build) lists every control and property the canvas supports, limits included.
