Sign up


Install
npx shadcn add @klarhimmel/app-auth-signupDetailsAbout, usage, props and more
Create an account: name, email and a password with its rules, a required consent checkbox that names the terms and privacy links, and idle, sending, error and…
States
sign up in 4 forms: idle, sending, error, consent.
state: idle
Name the section
Say what this page creates
Say in one line what a person gets with an account.
Ask if they have one already Sign in
state: sending
Name the section
Say what this page creates
Say in one line what a person gets with an account.
Ask if they have one already Sign in
state: error
Name the section
Say what this page creates
Say in one line what a person gets with an account.
Ask if they have one already Sign in
state: consent
Name the section
Say what this page creates
Say in one line what a person gets with an account.
Ask if they have one already Sign in
Notes
When to use it
Account creation with name, email, a password and a required consent box. For people who already have an account send them to app-auth-signin; after signup a code step like app-auth-code often follows.
Writing for it
- The consent sentence is built from before, a terms link, and and a privacy link, with before up to 60 characters. Write it so it reads as one sentence when the links are inserted.
- passwordHint (120) should state the actual rule, such as the minimum length, so no one finds it out from an error.
- Fill messages.consent (120) with what is missing, for example that the terms must be accepted, since it describes the unticked box in the consent state.
Watch out for
This block is strict: the consent sentence and its two links are never replaced by default text if they are invalid, so an empty terms or privacy label cannot ship. Pressing submit without ticking the box marks it as missing even when state is idle.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
Props
The consent sentence (before, two links, and) is what a person agrees to, so it is never replaced by defaults: invalid text shows an invalid state. State adds sending, error and consent-missing.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Name the section' | Text, up to 60 characters. Optional; empty is not rendered. |
title | string | 'Say what this page creates' | Text, up to 120 characters. |
description | string | 'Say in one line what a person gets …' | Text, up to 300 characters. Optional; empty is not rendered. |
nameLabel | string | 'Full name' | Text, up to 40 characters. |
emailLabel | string | 'Work email' | Text, up to 40 characters. |
passwordLabel | string | 'Password' | Text, up to 40 characters. |
passwordHint | string | 'Say how long and what kind of secre…' | Text, up to 120 characters. |
showLabel | string | 'Show password' | Text, up to 30 characters. |
hideLabel | string | 'Hide password' | Text, up to 30 characters. |
consent | { before, terms, and, privacy } | {…} | Fields: before, terms, and, privacy. |
submit | string | 'Create account' | Text, up to 30 characters. |
sending | string | 'Creating it…' | Text, up to 30 characters. |
alternative | { text, link } | {…} | Fields: text, link. |
state | 'idle' | 'sending' | 'error' | 'consent' | 'idle' | One of 'idle', 'sending', 'error', 'consent'. |
messages | { error, consent } | {…} | Fields: error, consent. |
action | string | - | Text, up to 300 characters. Optional; empty is not rendered. |
method | 'post' | 'get' | - | One of 'post', 'get'. Optional; empty is not rendered. |
hidden | { } | - | Optional; empty is not rendered. |
captcha | boolean | - | Optional; empty is not rendered. |
captchaSitekey | string | - | Text, up to 100 characters. Optional; empty is not rendered. |
headingLevel | '1' | '2' | - | One of '1', '2'. Optional; empty is not rendered. |
Install
Installs
- Banner
- Button
- Checkbox
- Input
- TextLink
- About
- Create an account: name, email and a password with its rules, a required consent checkbox that names the terms and privacy links, and idle, sending, error and consent-missing states.
- States
- Idle, sending, error, consent missing. The consent sentence is strict: never replaced by defaults. New project? Set it up once: /get-started/installation.