Signup screen in SwiftUI, Flutter, React Native and HTML/CSS
A signup screen in all four targets: social buttons, divider, fields, hint and terms.
A signup screen is a login screen with more to get wrong: two alternative sign-in buttons, a divider that has to line up with its label, three fields, a hint under the password, and a block of small print that wraps to two lines. We drew it once at 390 by 844 (an iPhone 14) and exported it to all four targets. The code below is the generator's output, unedited.
What we drew
| Element | Position | Size | Notes |
|---|---|---|---|
| Title, "Create your account" | x 24, y 96 | 342 x 36 | 28px, bold |
| Subtitle | x 24, y 140 | 342 x 22 | 15px, grey |
| "Continue with Apple" | x 24, y 196 | 342 x 52 | outlined, radius 14 |
| "Continue with Google" | x 24, y 260 | 342 x 52 | outlined, radius 14 |
| Divider, left rule | x 24, y 336 | 150 x 1 | 1px line |
| Divider label, "or" | x 175, y 326 | 40 x 20 | 13px, centred |
| Divider, right rule | x 216, y 336 | 150 x 1 | 1px line |
| Full name field | x 24, y 364 | 342 x 48 | radius 12 |
| Email field | x 24, y 428 | 342 x 48 | email keyboard |
| Password field | x 24, y 492 | 342 x 48 | secure entry |
| Hint | x 24, y 548 | 342 x 18 | 13px, grey |
| "Create account" | x 24, y 588 | 342 x 52 | filled, radius 14 |
| Terms | x 24, y 664 | 342 x 36 | 13px, centred, two lines |
| Sign-in link | x 24, y 740 | 342 x 22 | 15px, medium, centred |
The divider is the part worth checking by hand. The rules and the label have to add up to the full content width: 150 + 1 + 40 + 1 + 150 = 342, so the left rule ends at x 174, the label sits from 175 to 215, and the right rule starts at 216 and ends at 366, the same right margin as everything else. The two social buttons are 12 apart (248 to 260), the three fields are 16 apart (412 to 428, 476 to 492), and the hint sits 8 below the password field (540 to 548). The terms paragraph is 36 tall because 13px type at a 1.4 line height is about 18 a line, and two lines is what that sentence takes at this width.
React Native
Each of the three buttons is a Pressable containing both its rectangle and its label, so a tap on the text counts as a tap on the button. The fields are plain TextInputs, with keyboardType="email-address" on the email field and secureTextEntry on the password.
import React from 'react';
import { View, Text, Pressable, TextInput, StyleSheet } from 'react-native';
export default function Signup() {
const handleApple = () => {};
const handleGoogle = () => {};
const handleCreate = () => {};
return (
<View style={styles.screen}>
<Text style={styles.title}>{"Create your account"}</Text>
<Text style={styles.subtitle}>{"It takes about a minute."}</Text>
<Pressable onPress={handleApple} style={({ pressed }) => [styles.group, pressed && styles.pressed]}>
<View style={styles.apple} />
<View style={styles.appleLabel}><Text style={styles.appleLabelText}>{"Continue with Apple"}</Text></View>
</Pressable>
<Pressable onPress={handleGoogle} style={({ pressed }) => [styles.group2, pressed && styles.pressed]}>
<View style={styles.google} />
<View style={styles.googleLabel}><Text style={styles.googleLabelText}>{"Continue with Google"}</Text></View>
</Pressable>
<View style={styles.ruleLeft} />
<Text style={styles.or}>{"or"}</Text>
<View style={styles.ruleRight} />
<TextInput style={styles.name} placeholder={"Full name"} placeholderTextColor="#9ca3af" />
<TextInput style={styles.email} placeholder={"Email"} placeholderTextColor="#9ca3af" keyboardType="email-address" />
<TextInput style={styles.password} placeholder={"Password"} placeholderTextColor="#9ca3af" secureTextEntry />
<Text style={styles.hint}>{"Use at least 8 characters."}</Text>
<Pressable onPress={handleCreate} style={({ pressed }) => [styles.group3, pressed && styles.pressed]}>
<View style={styles.create} />
<View style={styles.createLabel}><Text style={styles.createLabelText}>{"Create account"}</Text></View>
</Pressable>
<Text style={styles.terms}>{"By creating an account you agree to our Terms and Privacy Policy."}</Text>
<Text style={styles.signInLink}>{"Already have an account? Sign in"}</Text>
</View>
);
}
const styles = StyleSheet.create({
screen: {
flex: 1,
backgroundColor: '#ffffff',
},
title: {
position: 'absolute',
left: 24,
top: 96,
width: 342,
height: 36,
color: '#17171A',
fontFamily: 'Inter',
fontSize: 28,
lineHeight: 36,
textAlign: 'left',
fontWeight: '700',
},
subtitle: {
position: 'absolute',
left: 24,
top: 140,
width: 342,
height: 22,
color: '#5B5B63',
fontFamily: 'Inter',
fontSize: 15,
lineHeight: 21,
textAlign: 'left',
},
group: {
position: 'absolute',
left: 24,
top: 196,
width: 342,
height: 52,
},
apple: {
position: 'absolute',
left: 0,
top: 0,
width: 342,
height: 52,
borderRadius: 14,
backgroundColor: '#ffffff',
borderWidth: 1,
borderColor: '#E4E1D8',
},
appleLabel: {
position: 'absolute',
left: 0,
top: 0,
width: 342,
height: 52,
justifyContent: 'center',
},
appleLabelText: {
color: '#17171A',
fontFamily: 'Inter',
fontSize: 16,
lineHeight: 21,
textAlign: 'center',
fontWeight: '600',
},
group2: {
position: 'absolute',
left: 24,
top: 260,
width: 342,
height: 52,
},
google: {
position: 'absolute',
left: 0,
top: 0,
width: 342,
height: 52,
borderRadius: 14,
backgroundColor: '#ffffff',
borderWidth: 1,
borderColor: '#E4E1D8',
},
googleLabel: {
position: 'absolute',
left: 0,
top: 0,
width: 342,
height: 52,
justifyContent: 'center',
},
googleLabelText: {
color: '#17171A',
fontFamily: 'Inter',
fontSize: 16,
lineHeight: 21,
textAlign: 'center',
fontWeight: '600',
},
ruleLeft: {
position: 'absolute',
left: 24,
top: 336,
width: 150,
height: 1,
borderRadius: 0,
backgroundColor: '#E4E1D8',
},
or: {
position: 'absolute',
left: 175,
top: 326,
width: 40,
height: 20,
color: '#5B5B63',
fontFamily: 'Inter',
fontSize: 13,
lineHeight: 18,
textAlign: 'center',
},
ruleRight: {
position: 'absolute',
left: 216,
top: 336,
width: 150,
height: 1,
borderRadius: 0,
backgroundColor: '#E4E1D8',
},
name: {
position: 'absolute',
left: 24,
top: 364,
width: 342,
height: 48,
backgroundColor: '#ffffff',
color: '#17171A',
fontFamily: 'Inter',
fontSize: 16,
paddingHorizontal: 12,
textAlign: 'left',
borderRadius: 12,
borderWidth: 1,
borderColor: '#E4E1D8',
},
email: {
position: 'absolute',
left: 24,
top: 428,
width: 342,
height: 48,
backgroundColor: '#ffffff',
color: '#17171A',
fontFamily: 'Inter',
fontSize: 16,
paddingHorizontal: 12,
textAlign: 'left',
borderRadius: 12,
borderWidth: 1,
borderColor: '#E4E1D8',
},
password: {
position: 'absolute',
left: 24,
top: 492,
width: 342,
height: 48,
backgroundColor: '#ffffff',
color: '#17171A',
fontFamily: 'Inter',
fontSize: 16,
paddingHorizontal: 12,
textAlign: 'left',
borderRadius: 12,
borderWidth: 1,
borderColor: '#E4E1D8',
},
hint: {
position: 'absolute',
left: 24,
top: 548,
width: 342,
height: 18,
color: '#5B5B63',
fontFamily: 'Inter',
fontSize: 13,
lineHeight: 18,
textAlign: 'left',
},
group3: {
position: 'absolute',
left: 24,
top: 588,
width: 342,
height: 52,
},
create: {
position: 'absolute',
left: 0,
top: 0,
width: 342,
height: 52,
borderRadius: 14,
backgroundColor: '#2A50D8',
},
createLabel: {
position: 'absolute',
left: 0,
top: 0,
width: 342,
height: 52,
justifyContent: 'center',
},
createLabelText: {
color: '#ffffff',
fontFamily: 'Inter',
fontSize: 16,
lineHeight: 21,
textAlign: 'center',
fontWeight: '600',
},
terms: {
position: 'absolute',
left: 24,
top: 664,
width: 342,
height: 36,
color: '#5B5B63',
fontFamily: 'Inter',
fontSize: 13,
lineHeight: 18,
textAlign: 'center',
},
signInLink: {
position: 'absolute',
left: 24,
top: 740,
width: 342,
height: 22,
color: '#2A50D8',
fontFamily: 'Inter',
fontSize: 15,
lineHeight: 21,
textAlign: 'center',
fontWeight: '500',
},
pressed: {
opacity: 0.6,
},
});SwiftUI
The divider label's .position(x: 195, y: 336) is the centre of its box (175 + 40 / 2 and 326 + 20 / 2), which lines up with the rules' own centres on the same row. Each of the three fields has its own generated @State string, and the password is a SecureField. Each button is a Button with its label inside.
import SwiftUI
struct Signup: View {
@State private var field10: String = ""
@State private var field11: String = ""
@State private var field12: String = ""
private func handleApple() {}
private func handleGoogle() {}
private func handleCreate() {}
var body: some View {
ZStack(alignment: .topLeading) {
Color(red: 1, green: 1, blue: 1)
.frame(width: 390, height: 844)
Text("Create your account")
.font(.custom("Inter", size: 28))
.fontWeight(.bold)
.lineSpacing(8.4)
.foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
.multilineTextAlignment(.leading)
.frame(width: 342, height: 36, alignment: .topLeading)
.position(x: 195, y: 114)
Text("It takes about a minute.")
.font(.custom("Inter", size: 15))
.lineSpacing(6)
.foregroundColor(Color(red: 0.36, green: 0.36, blue: 0.39))
.multilineTextAlignment(.leading)
.frame(width: 342, height: 22, alignment: .topLeading)
.position(x: 195, y: 151)
Button(action: handleApple) {
ZStack(alignment: .topLeading) {
RoundedRectangle(cornerRadius: 14)
.fill(Color(red: 1, green: 1, blue: 1))
.overlay(RoundedRectangle(cornerRadius: 14).strokeBorder(Color(red: 0.89, green: 0.88, blue: 0.85), lineWidth: 1))
.frame(width: 342, height: 52)
.position(x: 171, y: 26)
Text("Continue with Apple")
.font(.custom("Inter", size: 16))
.fontWeight(.semibold)
.lineSpacing(4.8)
.foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
.multilineTextAlignment(.center)
.frame(width: 342, height: 52, alignment: .center)
.position(x: 171, y: 26)
}
.frame(width: 342, height: 52)
}
.buttonStyle(PressStyle())
.position(x: 195, y: 222)
Button(action: handleGoogle) {
ZStack(alignment: .topLeading) {
RoundedRectangle(cornerRadius: 14)
.fill(Color(red: 1, green: 1, blue: 1))
.overlay(RoundedRectangle(cornerRadius: 14).strokeBorder(Color(red: 0.89, green: 0.88, blue: 0.85), lineWidth: 1))
.frame(width: 342, height: 52)
.position(x: 171, y: 26)
Text("Continue with Google")
.font(.custom("Inter", size: 16))
.fontWeight(.semibold)
.lineSpacing(4.8)
.foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
.multilineTextAlignment(.center)
.frame(width: 342, height: 52, alignment: .center)
.position(x: 171, y: 26)
}
.frame(width: 342, height: 52)
}
.buttonStyle(PressStyle())
.position(x: 195, y: 286)
RoundedRectangle(cornerRadius: 0)
.fill(Color(red: 0.89, green: 0.88, blue: 0.85))
.frame(width: 150, height: 1)
.position(x: 99, y: 336.5)
Text("or")
.font(.custom("Inter", size: 13))
.lineSpacing(5.2)
.foregroundColor(Color(red: 0.36, green: 0.36, blue: 0.39))
.multilineTextAlignment(.center)
.frame(width: 40, height: 20, alignment: .topLeading)
.position(x: 195, y: 336)
RoundedRectangle(cornerRadius: 0)
.fill(Color(red: 0.89, green: 0.88, blue: 0.85))
.frame(width: 150, height: 1)
.position(x: 291, y: 336.5)
TextField("Full name", text: $field10)
.font(.custom("Inter", size: 16))
.foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
.multilineTextAlignment(.leading)
.padding(.horizontal, 12)
.frame(width: 342, height: 48, alignment: .leading)
.background(Color(red: 1, green: 1, blue: 1))
.cornerRadius(12)
.overlay(RoundedRectangle(cornerRadius: 12).strokeBorder(Color(red: 0.89, green: 0.88, blue: 0.85), lineWidth: 1))
.position(x: 195, y: 388)
TextField("Email", text: $field11)
.font(.custom("Inter", size: 16))
.foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
.multilineTextAlignment(.leading)
.keyboardType(.emailAddress)
.padding(.horizontal, 12)
.frame(width: 342, height: 48, alignment: .leading)
.background(Color(red: 1, green: 1, blue: 1))
.cornerRadius(12)
.overlay(RoundedRectangle(cornerRadius: 12).strokeBorder(Color(red: 0.89, green: 0.88, blue: 0.85), lineWidth: 1))
.position(x: 195, y: 452)
SecureField("Password", text: $field12)
.font(.custom("Inter", size: 16))
.foregroundColor(Color(red: 0.09, green: 0.09, blue: 0.1))
.multilineTextAlignment(.leading)
.padding(.horizontal, 12)
.frame(width: 342, height: 48, alignment: .leading)
.background(Color(red: 1, green: 1, blue: 1))
.cornerRadius(12)
.overlay(RoundedRectangle(cornerRadius: 12).strokeBorder(Color(red: 0.89, green: 0.88, blue: 0.85), lineWidth: 1))
.position(x: 195, y: 516)
Text("Use at least 8 characters.")
.font(.custom("Inter", size: 13))
.lineSpacing(5.2)
.foregroundColor(Color(red: 0.36, green: 0.36, blue: 0.39))
.multilineTextAlignment(.leading)
.frame(width: 342, height: 18, alignment: .topLeading)
.position(x: 195, y: 557)
Button(action: handleCreate) {
ZStack(alignment: .topLeading) {
RoundedRectangle(cornerRadius: 14)
.fill(Color(red: 0.16, green: 0.31, blue: 0.85))
.frame(width: 342, height: 52)
.position(x: 171, y: 26)
Text("Create account")
.font(.custom("Inter", size: 16))
.fontWeight(.semibold)
.lineSpacing(4.8)
.foregroundColor(Color(red: 1, green: 1, blue: 1))
.multilineTextAlignment(.center)
.frame(width: 342, height: 52, alignment: .center)
.position(x: 171, y: 26)
}
.frame(width: 342, height: 52)
}
.buttonStyle(PressStyle())
.position(x: 195, y: 614)
Text("By creating an account you agree to our Terms and Privacy Policy.")
.font(.custom("Inter", size: 13))
.lineSpacing(5.2)
.foregroundColor(Color(red: 0.36, green: 0.36, blue: 0.39))
.multilineTextAlignment(.center)
.frame(width: 342, height: 36, alignment: .topLeading)
.position(x: 195, y: 682)
Text("Already have an account? Sign in")
.font(.custom("Inter", size: 15))
.fontWeight(.medium)
.lineSpacing(6)
.foregroundColor(Color(red: 0.16, green: 0.31, blue: 0.85))
.multilineTextAlignment(.center)
.frame(width: 342, height: 22, alignment: .topLeading)
.position(x: 195, y: 751)
}
.frame(width: 390, height: 844)
}
}
struct PressStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label.opacity(configuration.isPressed ? 0.6 : 1)
}
}Flutter
Positions are Positioned widgets inside one Stack. Each button is a generated _Pressable widget that wraps its rectangle and label and gives press feedback, and the fields are TextFields with the hint text and keyboard type set.
import 'package:flutter/material.dart';
class Signup extends StatelessWidget {
const Signup({super.key});
void handleApple() {}
void handleGoogle() {}
void handleCreate() {}
@override
Widget build(BuildContext context) {
return SizedBox(
width: 390,
height: 844,
child: Stack(
children: [
Positioned.fill(child: Container(color: Color(0xFFFFFFFF))),
Positioned(
left: 24,
top: 96,
child: SizedBox(
width: 342,
height: 36,
child: Text(
'Create your account',
textAlign: TextAlign.left,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 28,
color: Color(0xFF17171A),
height: 1.3,
fontWeight: FontWeight.w700,
),
),
),
),
Positioned(
left: 24,
top: 140,
child: SizedBox(
width: 342,
height: 22,
child: Text(
'It takes about a minute.',
textAlign: TextAlign.left,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 15,
color: Color(0xFF5B5B63),
height: 1.4,
),
),
),
),
Positioned(
left: 24,
top: 196,
child: _Pressable(
onTap: handleApple,
child: SizedBox(
width: 342,
height: 52,
child: Stack(
children: [
Positioned(
left: 0,
top: 0,
child: Container(
width: 342,
height: 52,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(14),
border: Border.all(color: Color(0xFFE4E1D8), width: 1),
),
),
),
Positioned(
left: 0,
top: 0,
child: SizedBox(
width: 342,
height: 52,
child: Align(
alignment: Alignment.center,
child: Text(
'Continue with Apple',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 16,
color: Color(0xFF17171A),
height: 1.3,
fontWeight: FontWeight.w600,
),
),
),
),
),
],
),
),
),
),
Positioned(
left: 24,
top: 260,
child: _Pressable(
onTap: handleGoogle,
child: SizedBox(
width: 342,
height: 52,
child: Stack(
children: [
Positioned(
left: 0,
top: 0,
child: Container(
width: 342,
height: 52,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(14),
border: Border.all(color: Color(0xFFE4E1D8), width: 1),
),
),
),
Positioned(
left: 0,
top: 0,
child: SizedBox(
width: 342,
height: 52,
child: Align(
alignment: Alignment.center,
child: Text(
'Continue with Google',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 16,
color: Color(0xFF17171A),
height: 1.3,
fontWeight: FontWeight.w600,
),
),
),
),
),
],
),
),
),
),
Positioned(
left: 24,
top: 336,
child: Container(
width: 150,
height: 1,
decoration: BoxDecoration(color: Color(0xFFE4E1D8)),
),
),
Positioned(
left: 175,
top: 326,
child: SizedBox(
width: 40,
height: 20,
child: Text(
'or',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 13,
color: Color(0xFF5B5B63),
height: 1.4,
),
),
),
),
Positioned(
left: 216,
top: 336,
child: Container(
width: 150,
height: 1,
decoration: BoxDecoration(color: Color(0xFFE4E1D8)),
),
),
Positioned(
left: 24,
top: 364,
child: Container(
width: 342,
height: 48,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Color(0xFFE4E1D8), width: 1),
),
child: TextField(
maxLines: 1,
textAlign: TextAlign.left,
style: TextStyle(
color: Color(0xFF17171A),
fontFamily: 'Inter',
fontSize: 16,
),
decoration: InputDecoration(
hintText: 'Full name',
hintStyle: const TextStyle(color: Color(0xFF9CA3AF)),
border: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(horizontal: 12),
),
),
),
),
Positioned(
left: 24,
top: 428,
child: Container(
width: 342,
height: 48,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Color(0xFFE4E1D8), width: 1),
),
child: TextField(
keyboardType: TextInputType.emailAddress,
maxLines: 1,
textAlign: TextAlign.left,
style: TextStyle(
color: Color(0xFF17171A),
fontFamily: 'Inter',
fontSize: 16,
),
decoration: InputDecoration(
hintText: 'Email',
hintStyle: const TextStyle(color: Color(0xFF9CA3AF)),
border: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(horizontal: 12),
),
),
),
),
Positioned(
left: 24,
top: 492,
child: Container(
width: 342,
height: 48,
decoration: BoxDecoration(
color: Color(0xFFFFFFFF),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: Color(0xFFE4E1D8), width: 1),
),
child: TextField(
obscureText: true,
maxLines: 1,
textAlign: TextAlign.left,
style: TextStyle(
color: Color(0xFF17171A),
fontFamily: 'Inter',
fontSize: 16,
),
decoration: InputDecoration(
hintText: 'Password',
hintStyle: const TextStyle(color: Color(0xFF9CA3AF)),
border: InputBorder.none,
isDense: true,
contentPadding: const EdgeInsets.symmetric(horizontal: 12),
),
),
),
),
Positioned(
left: 24,
top: 548,
child: SizedBox(
width: 342,
height: 18,
child: Text(
'Use at least 8 characters.',
textAlign: TextAlign.left,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 13,
color: Color(0xFF5B5B63),
height: 1.4,
),
),
),
),
Positioned(
left: 24,
top: 588,
child: _Pressable(
onTap: handleCreate,
child: SizedBox(
width: 342,
height: 52,
child: Stack(
children: [
Positioned(
left: 0,
top: 0,
child: Container(
width: 342,
height: 52,
decoration: BoxDecoration(
color: Color(0xFF2A50D8),
borderRadius: BorderRadius.circular(14),
),
),
),
Positioned(
left: 0,
top: 0,
child: SizedBox(
width: 342,
height: 52,
child: Align(
alignment: Alignment.center,
child: Text(
'Create account',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 16,
color: Color(0xFFFFFFFF),
height: 1.3,
fontWeight: FontWeight.w600,
),
),
),
),
),
],
),
),
),
),
Positioned(
left: 24,
top: 664,
child: SizedBox(
width: 342,
height: 36,
child: Text(
'By creating an account you agree to our Terms and Privacy Policy.',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 13,
color: Color(0xFF5B5B63),
height: 1.4,
),
),
),
),
Positioned(
left: 24,
top: 740,
child: SizedBox(
width: 342,
height: 22,
child: Text(
'Already have an account? Sign in',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 15,
color: Color(0xFF2A50D8),
height: 1.4,
fontWeight: FontWeight.w500,
),
),
),
),
],
),
);
}
}
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 buttons are real button elements and the fields are real input elements with the right type (text, email, password), so the browser's own keyboard and autofill behaviour applies. The handlers are stubs in a script block at the end.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Signup</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: #ffffff;
}
.screen {
position: relative;
width: 390px;
height: 844px;
overflow-x: hidden;
overflow-y: auto;
scrollbar-width: none;
background: #ffffff;
}
.screen::-webkit-scrollbar {
display: none;
}
.title {
position: absolute;
left: 24px;
top: 96px;
width: 342px;
height: 36px;
color: #17171A;
font-family: 'Inter', sans-serif;
font-size: 28px;
font-weight: 700;
text-align: left;
line-height: 1.3;
white-space: pre-wrap;
}
.subtitle {
position: absolute;
left: 24px;
top: 140px;
width: 342px;
height: 22px;
color: #5B5B63;
font-family: 'Inter', sans-serif;
font-size: 15px;
text-align: left;
line-height: 1.4;
white-space: pre-wrap;
}
.group {
position: absolute;
left: 24px;
top: 196px;
width: 342px;
height: 52px;
cursor: pointer;
}
.apple {
position: absolute;
left: 0px;
top: 0px;
width: 342px;
height: 52px;
background: #ffffff;
border-radius: 14px;
border: 1px solid #E4E1D8;
box-sizing: border-box;
}
.appleLabel {
position: absolute;
left: 0px;
top: 0px;
width: 342px;
height: 52px;
color: #17171A;
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;
}
.group2 {
position: absolute;
left: 24px;
top: 260px;
width: 342px;
height: 52px;
cursor: pointer;
}
.google {
position: absolute;
left: 0px;
top: 0px;
width: 342px;
height: 52px;
background: #ffffff;
border-radius: 14px;
border: 1px solid #E4E1D8;
box-sizing: border-box;
}
.googleLabel {
position: absolute;
left: 0px;
top: 0px;
width: 342px;
height: 52px;
color: #17171A;
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;
}
.ruleLeft {
position: absolute;
left: 24px;
top: 336px;
width: 150px;
height: 1px;
background: #E4E1D8;
}
.or {
position: absolute;
left: 175px;
top: 326px;
width: 40px;
height: 20px;
color: #5B5B63;
font-family: 'Inter', sans-serif;
font-size: 13px;
text-align: center;
line-height: 1.4;
white-space: pre-wrap;
}
.ruleRight {
position: absolute;
left: 216px;
top: 336px;
width: 150px;
height: 1px;
background: #E4E1D8;
}
.name {
position: absolute;
left: 24px;
top: 364px;
width: 342px;
height: 48px;
background: #ffffff;
color: #17171A;
font-family: 'Inter', sans-serif;
font-size: 16px;
text-align: left;
padding: 0 12px;
box-sizing: border-box;
outline: none;
border-radius: 12px;
border: 1px solid #E4E1D8;
}
.name::placeholder {
color: #9ca3af;
}
.email {
position: absolute;
left: 24px;
top: 428px;
width: 342px;
height: 48px;
background: #ffffff;
color: #17171A;
font-family: 'Inter', sans-serif;
font-size: 16px;
text-align: left;
padding: 0 12px;
box-sizing: border-box;
outline: none;
border-radius: 12px;
border: 1px solid #E4E1D8;
}
.email::placeholder {
color: #9ca3af;
}
.password {
position: absolute;
left: 24px;
top: 492px;
width: 342px;
height: 48px;
background: #ffffff;
color: #17171A;
font-family: 'Inter', sans-serif;
font-size: 16px;
text-align: left;
padding: 0 12px;
box-sizing: border-box;
outline: none;
border-radius: 12px;
border: 1px solid #E4E1D8;
}
.password::placeholder {
color: #9ca3af;
}
.hint {
position: absolute;
left: 24px;
top: 548px;
width: 342px;
height: 18px;
color: #5B5B63;
font-family: 'Inter', sans-serif;
font-size: 13px;
text-align: left;
line-height: 1.4;
white-space: pre-wrap;
}
.group3 {
position: absolute;
left: 24px;
top: 588px;
width: 342px;
height: 52px;
cursor: pointer;
}
.create {
position: absolute;
left: 0px;
top: 0px;
width: 342px;
height: 52px;
background: #2A50D8;
border-radius: 14px;
}
.createLabel {
position: absolute;
left: 0px;
top: 0px;
width: 342px;
height: 52px;
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;
}
.terms {
position: absolute;
left: 24px;
top: 664px;
width: 342px;
height: 36px;
color: #5B5B63;
font-family: 'Inter', sans-serif;
font-size: 13px;
text-align: center;
line-height: 1.4;
white-space: pre-wrap;
}
.signInLink {
position: absolute;
left: 24px;
top: 740px;
width: 342px;
height: 22px;
color: #2A50D8;
font-family: 'Inter', sans-serif;
font-size: 15px;
font-weight: 500;
text-align: center;
line-height: 1.4;
white-space: pre-wrap;
}
.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="title">Create your account</div>
<div class="subtitle">It takes about a minute.</div>
<button type="button" class="tappable group" onclick="handleApple()">
<div class="apple"></div>
<div class="appleLabel">Continue with Apple</div>
</button>
<button type="button" class="tappable group2" onclick="handleGoogle()">
<div class="google"></div>
<div class="googleLabel">Continue with Google</div>
</button>
<div class="ruleLeft"></div>
<div class="or">or</div>
<div class="ruleRight"></div>
<input class="name" type="text" placeholder="Full name" />
<input class="email" type="email" placeholder="Email" />
<input class="password" type="password" placeholder="Password" />
<div class="hint">Use at least 8 characters.</div>
<button type="button" class="tappable group3" onclick="handleCreate()">
<div class="create"></div>
<div class="createLabel">Create account</div>
</button>
<div class="terms">By creating an account you agree to our Terms and Privacy Policy.</div>
<div class="signInLink">Already have an account? Sign in</div>
</div>
<script>
function handleApple() {}
function handleGoogle() {}
function handleCreate() {}
</script>
</body>
</html>What this does not do
- No logic.
handleApple,handleGoogleandhandleCreateare empty. Authentication, validation and showing an error under the hint are yours to add. - No brand marks. The Apple and Google buttons are outlined rectangles with text. If your sign-in provider's guidelines require their logo or a specific button style, add it.
- Small print does not reflow. The terms box is 36 tall for two lines. A longer translation that wraps to three lines would overflow it, so redraw or resize it for that language.
- Fixed size and no keyboard avoidance. The screen is 390 by 844, and nothing moves when the keyboard opens.
- Fonts by name.
Interis 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.