Sign Up 2



<section id="relume" class="px-[5%]">
<div class="relative flex min-h-svh flex-col justify-center overflow-auto py-24 lg:py-20">
<div class="absolute left-0 right-0 top-0 flex h-16 items-center justify-between md:h-18">
<a href="#"
><img src="https://d22po4pjz3o32e.cloudfront.net/logo-image.svg" alt="Logo text"
/></a>
<div class="inline-flex gap-x-1">
<p class="hidden md:block">Already have an account?</p>
<a href="#" class="underline">Log In</a>
</div>
</div>
<div class="container max-w-sm">
<div class="mb-8 text-center md:mb-10 lg:mb-12">
<h1 class="mb-5 text-5xl font-bold md:mb-6 md:text-7xl lg:text-8xl">Sign Up</h1>
<p class="md:text-md">Lorem ipsum dolor sit amet adipiscing elit.</p>
</div>
<form class="grid grid-cols-1 gap-4">
<div class="relative flex w-full items-center">
<input
type="email"
class="flex size-full min-h-11 border border-border-primary bg-background-primary py-2 align-middle file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-neutral focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 px-3"
id="email"
placeholder="Email"
value=""
/>
</div>
<div class="relative flex w-full items-center">
<input
type="password"
class="flex size-full min-h-11 border border-border-primary bg-background-primary py-2 align-middle file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-neutral focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 px-3"
id="password"
placeholder="Password"
value=""
/>
</div>
<button
class="focus-visible:ring-border-primary inline-flex gap-3 items-center justify-center whitespace-nowrap ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-border-primary bg-background-alternative text-text-alternative px-6 py-3"
>
Sign up
</button>
<div class="my-3 h-px w-full bg-border-primary md:my-4"></div>
<button
class="focus-visible:ring-border-primary inline-flex gap-3 items-center justify-center whitespace-nowrap ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-border-primary text-text-primary bg-background-primary px-6 py-3 gap-x-3"
title="Sign up with Google"
>
<svg
stroke="currentColor"
fill="currentColor"
stroke-width="0"
viewBox="0 0 24 24"
class="size-6"
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M20.283 10.356h-8.327v3.451h4.792c-.446 2.193-2.313 3.453-4.792 3.453a5.27 5.27 0 0 1-5.279-5.28 5.27 5.27 0 0 1 5.279-5.279c1.259 0 2.397.447 3.29 1.178l2.6-2.599c-1.584-1.381-3.615-2.233-5.89-2.233a8.908 8.908 0 0 0-8.934 8.934 8.907 8.907 0 0 0 8.934 8.934c4.467 0 8.529-3.249 8.529-8.934 0-.528-.081-1.097-.202-1.625z"
></path></svg
>Sign up with Google</button
><button
class="focus-visible:ring-border-primary inline-flex gap-3 items-center justify-center whitespace-nowrap ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-border-primary text-text-primary bg-background-primary px-6 py-3 gap-x-3"
title="Sign up with Facebook"
>
<svg
stroke="currentColor"
fill="currentColor"
stroke-width="0"
viewBox="0 0 24 24"
class="size-6"
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12.001 2.002c-5.522 0-9.999 4.477-9.999 9.999 0 4.99 3.656 9.126 8.437 9.879v-6.988h-2.54v-2.891h2.54V9.798c0-2.508 1.493-3.891 3.776-3.891 1.094 0 2.24.195 2.24.195v2.459h-1.264c-1.24 0-1.628.772-1.628 1.563v1.875h2.771l-.443 2.891h-2.328v6.988C18.344 21.129 22 16.992 22 12.001c0-5.522-4.477-9.999-9.999-9.999z"
></path></svg
>Sign up with Facebook</button
><button
class="focus-visible:ring-border-primary inline-flex gap-3 items-center justify-center whitespace-nowrap ring-offset-white transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-border-primary text-text-primary bg-background-primary px-6 py-3 gap-x-3"
title="Sign up with Apple"
>
<svg
stroke="currentColor"
fill="currentColor"
stroke-width="0"
viewBox="0 0 24 24"
class="size-6"
height="1em"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M19.665 16.811a10.316 10.316 0 0 1-1.021 1.837c-.537.767-.978 1.297-1.316 1.592-.525.482-1.089.73-1.692.744-.432 0-.954-.123-1.562-.373-.61-.249-1.17-.371-1.683-.371-.537 0-1.113.122-1.73.371-.616.25-1.114.381-1.495.393-.577.025-1.154-.229-1.729-.764-.367-.32-.826-.87-1.377-1.648-.59-.829-1.075-1.794-1.455-2.891-.407-1.187-.611-2.335-.611-3.447 0-1.273.275-2.372.826-3.292a4.857 4.857 0 0 1 1.73-1.751 4.65 4.65 0 0 1 2.34-.662c.46 0 1.063.142 1.81.422s1.227.422 1.436.422c.158 0 .689-.167 1.593-.498.853-.307 1.573-.434 2.163-.384 1.6.129 2.801.759 3.6 1.895-1.43.867-2.137 2.08-2.123 3.637.012 1.213.453 2.222 1.317 3.023a4.33 4.33 0 0 0 1.315.863c-.106.307-.218.6-.336.882zM15.998 2.38c0 .95-.348 1.838-1.039 2.659-.836.976-1.846 1.541-2.941 1.452a2.955 2.955 0 0 1-.021-.36c0-.913.396-1.889 1.103-2.688.352-.404.8-.741 1.343-1.009.542-.264 1.054-.41 1.536-.435.013.128.019.255.019.381z"
></path></svg
>Sign up with Apple
</button>
</form>
</div>
<footer class="absolute bottom-0 left-0 right-0 flex h-16 items-center justify-center md:h-18">
<p class="text-sm">© 2024 Relume</p>
</footer>
</div>
</section>
"use client";
import { useState } from "react";
import { Button, Input } from "@relume_io/relume-ui";
import type { ButtonProps } from "@relume_io/relume-ui";
import { BiLogoApple, BiLogoFacebookCircle, BiLogoGoogle } from "react-icons/bi";
type ImageProps = {
url?: string;
src: string;
alt?: string;
};
type Props = {
logo: ImageProps;
logInText: string;
logInLink: {
text: string;
url: string;
};
title: string;
description: string;
inputPlaceholderEmail: string;
inputPlaceholderPassword: string;
signUpButton: ButtonProps;
socialLoginButtons: ButtonProps[];
footerText: string;
};
export type Signup2Props = React.ComponentPropsWithoutRef<"section"> & Partial<Props>;
export const Signup2 = (props: Signup2Props) => {
const {
logo,
logInText,
logInLink,
title,
description,
inputPlaceholderEmail,
inputPlaceholderPassword,
signUpButton,
socialLoginButtons,
footerText,
} = {
...Signup2Defaults,
...props,
};
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
console.log({ email, password });
};
return (
<section id="relume" className="px-[5%]">
<div className="relative flex min-h-svh flex-col justify-center overflow-auto py-24 lg:py-20">
<div className="absolute left-0 right-0 top-0 flex h-16 items-center justify-between md:h-18">
<a href={logo.url}>
<img src={logo.src} alt={logo.alt} />
</a>
<div className="inline-flex gap-x-1">
<p className="hidden md:block">{logInText}</p>
<a href={logInLink.url} className="underline">
{logInLink.text}
</a>
</div>
</div>
<div className="container max-w-sm">
<div className="mb-8 text-center md:mb-10 lg:mb-12">
<h1 className="mb-5 text-5xl font-bold md:mb-6 md:text-7xl lg:text-8xl">{title}</h1>
<p className="md:text-md">{description}</p>
</div>
<form className="grid grid-cols-1 gap-4" onSubmit={handleSubmit}>
<Input
type="email"
id="email"
placeholder={inputPlaceholderEmail}
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<Input
type="password"
id="password"
placeholder={inputPlaceholderPassword}
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
<Button
variant={signUpButton.variant}
size={signUpButton.size}
iconLeft={signUpButton.iconLeft}
iconRight={signUpButton.iconRight}
>
{signUpButton.title}
</Button>
<div className="my-3 h-px w-full bg-border-primary md:my-4" />
{socialLoginButtons.map((button, index) => (
<Button key={index} {...button} className="gap-x-3">
{button.title}
</Button>
))}
</form>
</div>
<footer className="absolute bottom-0 left-0 right-0 flex h-16 items-center justify-center md:h-18">
<p className="text-sm">{footerText}</p>
</footer>
</div>
</section>
);
};
export const Signup2Defaults: Props = {
logo: {
url: "#",
src: "https://d22po4pjz3o32e.cloudfront.net/logo-image.svg",
alt: "Logo text",
},
logInText: "Already have an account?",
logInLink: {
text: "Log In",
url: "#",
},
title: "Sign Up",
description: "Lorem ipsum dolor sit amet adipiscing elit.",
inputPlaceholderEmail: "Email",
inputPlaceholderPassword: "Password",
signUpButton: {
title: "Sign up",
},
socialLoginButtons: [
{
variant: "secondary",
title: "Sign up with Google",
iconLeft: <BiLogoGoogle className="size-6" />,
},
{
variant: "secondary",
title: "Sign up with Facebook",
iconLeft: <BiLogoFacebookCircle className="size-6" />,
},
{
variant: "secondary",
title: "Sign up with Apple",
iconLeft: <BiLogoApple className="size-6" />,
},
],
footerText: "© 2024 Relume",
};
Need help?
For installation guidelines and API information, visit the docs.
Examples
No items found.