signin
Pantallas Pantallas enteras hechas con los componentes. Empieza la tuya a partir de una de ellas.
La pantalla de inicio de sesión en cada estado por el que pasa: pidiendo una dirección, al volver, después de enviar el enlace, cuando algo ha ido mal y las otras formas de entrar.
Cada ejemplo funciona de verdad, pero sus enlaces no llevan a ninguna parte. HTML muestra el marcado para copiar.
Pedir una dirección
Un campo y un botón. Nada que recordar y nada que robar.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >Correo electrónico</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autofocus autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >Continuar</button >
</form >
<p rst-signin-or >or</p >
<div rst-signin-passkey ="after" >
<button rst-btn ="block" type ="button" aria-describedby ="rst-signin-passkey-msg" >Iniciar sesión con una llave de acceso</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" ></p >
<button type ="button" rst-signin-passkey-close hidden aria-label ="Cerrar" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
</div >
</section >
En una aplicación, esto llegaría a /signin. Aquí sus enlaces y formularios no llevan a ninguna parte.
Volver con Keymail
Para quien vuelve: la dirección que usó la última vez está en el botón, así que un toque la envía. Recordar esa dirección, y volver a comprobarla, es trabajo de tu aplicación.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<input type ="hidden" name ="address" value ="kay@example.org" >
<input type ="hidden" name ="expect" value ="keymail" >
<button rst-btn ="primary block" type ="submit" autofocus >
<span >Continuar como <bdi >kay@example.org</bdi ></span >
</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin, /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
Volver con un enlace por correo
La dirección está en el botón, así que no hay nada que teclear.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<input type ="hidden" name ="address" value ="grace@example.com" >
<button rst-btn ="primary block" type ="submit" autofocus >
<span >Continuar como <bdi >grace@example.com</bdi ></span >
</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin, /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
Una clave de acceso
La vía más rápida para quien ya tiene una, y no hay nada que teclear. Ofrece también una segunda vía: la gente pierde dispositivos, y una clave de acceso que no funciona es una puerta cerrada.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<div rst-signin-passkey ="before" >
<button rst-btn ="primary block" type ="button" aria-describedby ="rst-signin-passkey-msg" >Iniciar sesión con tu llave de acceso</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" ></p >
<button type ="button" rst-signin-passkey-close hidden aria-label ="Cerrar" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
<p rst-signin-or >or</p >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >Correo electrónico</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >Continuar</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin, /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
Una clave de acceso, cuando no se usó
Aquí el formulario del correo va después del botón, así que el mensaje se abre encima, sobre el título, y nunca tapa el campo del correo.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<div rst-signin-passkey ="before" >
<button rst-btn ="primary block" type ="button" aria-describedby ="rst-signin-passkey-msg" >Iniciar sesión con tu llave de acceso</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" >No se ha usado ninguna llave de acceso. Inténtalo de nuevo o usa tu correo electrónico.</p >
<button type ="button" rst-signin-passkey-close aria-label ="Cerrar" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
<p rst-signin-or >or</p >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >Correo electrónico</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >Continuar</button >
</form >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin, /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
Después de enviar el enlace
Repite la dirección tal cual. Es la única oportunidad de detectar una errata antes de quedarse esperando un correo que nunca llegará.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Revisa tu correo electrónico</h1 >
<p >Hemos enviado un enlace a <bdi >grace@example.com</bdi >. El enlace solo funciona una vez y caduca pronto.</p >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
Después de enviar el enlace, en otro navegador
Cuando la dirección no la envió este navegador, la página no la adivina.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Revisa tu correo electrónico</h1 >
<p >Hemos enviado un enlace a tu bandeja de entrada. El enlace solo funciona una vez y caduca pronto.</p >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
Cuando se ofreció Keymail y salió un enlace
Una línea dice que esta vez se envió un enlace. No adivina por qué.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Revisa tu correo electrónico</h1 >
<p >Esta vez te hemos enviado un enlace de inicio de sesión.</p >
<p >Hemos enviado un enlace a <bdi >kay@example.org</bdi >. El enlace solo funciona una vez y caduca pronto.</p >
<form rst-signin-form method ="post" action ="/signin/forget" >
<button rst-btn ="ghost block" type ="submit" >Usar otro correo electrónico</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin/forget. Aquí sus enlaces y formularios no llevan a ninguna parte.
De camino a Keymail
Una página de espera mientras se envía a alguien a iniciar sesión. Tu aplicación hace avanzar la página sola; el enlace está por si no lo hace.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Iniciando tu sesión</h1 >
<p >Te llevamos a confirmar que eres tú.</p >
<a rst-btn ="primary block" href ="#" >Continuar</a >
</div >
</section >
Una dirección que no parece correcta
El mensaje pertenece al campo, y ahí es donde empieza el foco.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >Correo electrónico</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" value ="grace@example" required autofocus autocomplete ="email" aria-invalid ="true" aria-describedby ="rst-signin-email-error" >
<p rst-field-error id ="rst-signin-email-error" >Eso no parece una dirección de correo electrónico.</p >
</div >
<button rst-btn ="primary block" type ="submit" >Continuar</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin. Aquí sus enlaces y formularios no llevan a ninguna parte.
Cuando Keymail no pudo confirmarlo
El botón cambia para enviar un enlace en su lugar, así nadie se queda atascado.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<div rst-callout id ="rst-signin-problem" rst-tone ="negative" tabindex ="-1" autofocus >
<span rst-callout-ic aria-hidden ="true" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" ><circle cx ="12" cy ="12" r ="10" /><path d ="m15 9-6 6" /><path d ="m9 9 6 6" /></svg >
</span >
<div rst-callout-body >
<p >No hemos podido confirmar que eres tú. Inténtalo de nuevo o envíate un enlace por correo.</p >
</div >
</div >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >Correo electrónico</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" value ="kay@example.org" required autocomplete ="email" >
</div >
<input type ="hidden" name ="force" value ="1" >
<button rst-btn ="primary block" type ="submit" >Envíame un enlace en vez de eso</button >
</form >
</div >
</section >
En una aplicación, esto llegaría a /signin. Aquí sus enlaces y formularios no llevan a ninguna parte.
Cuando no se usó ninguna clave de acceso
El mensaje se abre debajo del botón de la clave de acceso y no ocupa espacio, así que «Continuar» se queda donde estaba. Tu script escribe el mensaje y muestra el botón de cerrar. En un móvil estrecho, la nota puede tapar un enlace del pie hasta que se cierre.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<form rst-signin-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="rst-signin-email" >Correo electrónico</label >
<input rst-input type ="email" id ="rst-signin-email" name ="address" required autofocus autocomplete ="email" >
</div >
<button rst-btn ="primary block" type ="submit" >Continuar</button >
</form >
<p rst-signin-or >or</p >
<div rst-signin-passkey ="after" >
<button rst-btn ="block" type ="button" aria-describedby ="rst-signin-passkey-msg" >Iniciar sesión con una llave de acceso</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" >No se ha usado ninguna llave de acceso. Inténtalo de nuevo o usa tu correo electrónico.</p >
<button type ="button" rst-signin-passkey-close aria-label ="Cerrar" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
</div >
</section >
En una aplicación, esto llegaría a /signin. Aquí sus enlaces y formularios no llevan a ninguna parte.
Google, Apple y los demás
Te damos los botones, dibujados como exige cada empresa. No te damos el inicio de sesión en sí: eso lo conectas tú al proveedor que uses.
<section rst-box >
<h1 >Iniciar sesión</h1 >
<div rst-signin-providers >
<form method ="post" action ="/auth/google" >
<button rst-btn ="block" type ="submit" >
<svg aria-hidden ="true" focusable ="false" width ="1.1em" height ="1.1em" viewBox ="0 0 48 48" ><path fill ="#EA4335" d ="M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z" /><path fill ="#4285F4" d ="M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z" /><path fill ="#FBBC05" d ="M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z" /><path fill ="#34A853" d ="M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z" /></svg >
Continuar con Google
</button >
</form >
<form method ="post" action ="/auth/apple" >
<button rst-btn ="block" type ="submit" >
<svg aria-hidden ="true" focusable ="false" width ="1.1em" height ="1.1em" viewBox ="0 0 24 24" ><path fill ="currentColor" d ="M12.15 6.9c-.95 0-2.42-1.08-3.96-1.04-2.04.03-3.91 1.18-4.96 3.01-2.12 3.68-.55 9.1 1.52 12.09 1.01 1.45 2.2 3.09 3.79 3.04 1.52-.07 2.09-.99 3.94-.99 1.83 0 2.35.99 3.96.95 1.64-.03 2.68-1.48 3.68-2.95 1.15-1.69 1.63-3.33 1.66-3.42-.04-.01-3.18-1.22-3.22-4.86-.03-3.04 2.48-4.49 2.6-4.56-1.43-2.09-3.63-2.32-4.39-2.38-2-.15-3.68 1.09-4.62 1.09zm3.38-3.07c.84-1.01 1.4-2.43 1.25-3.83-1.21.05-2.66.8-3.53 1.82-.78.9-1.46 2.34-1.27 3.71 1.34.1 2.71-.69 3.55-1.7z" /></svg >
Continuar con Apple
</button >
</form >
<a href ="/signin" >Usar tu correo electrónico</a >
</div >
</section >
En una aplicación, esto llegaría a /auth/apple, /auth/google, /signin. Aquí sus enlaces y formularios no llevan a ninguna parte.
Correo y contraseña
Si aun así usas contraseñas, mantén la misma disposición de una vía principal y pon la forma de restablecerla justo debajo del botón, en lugar de esconderla.
La gente las reutiliza, se filtran, y a ti te toca el trabajo de guardarlas de forma segura. Usa un enlace por correo junto con una clave de acceso, o solo claves de acceso. El marcado está aquí porque algunos productos todavía lo necesitan.
<section rst-box >
<h1 >Iniciar sesión</h1 >
<form rst-form method ="post" action ="/signin" >
<div rst-field >
<label rst-field-label for ="pw-email" >Correo electrónico</label >
<input rst-input id ="pw-email" name ="email" type ="email" autocomplete ="email" required >
</div >
<div rst-field >
<label rst-field-label for ="pw-pass" >Contraseña</label >
<input rst-input id ="pw-pass" name ="password" type ="password" autocomplete ="current-password" required >
</div >
<button rst-btn ="primary" type ="submit" >Continuar</button >
</form >
</section >
En una aplicación, esto llegaría a /signin. Aquí sus enlaces y formularios no llevan a ninguna parte.
Una sola forma de entrar
Un botón, para la forma de entrar que esta persona usó la última vez o la que tu aplicación ofrece primero. Las demás están a un toque, tras «Otras formas de iniciar sesión». Cada botón de esta puerta tiene forma de píldora.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door ="one-way" >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<a rst-btn ="primary block" href ="/signin/oficina" >
<svg viewBox ="18 20 62 60" aria-hidden ="true" focusable ="false" ><rect x ="30.62" y ="23.78" width ="45.60" height ="36.48" rx ="7.98" fill ="currentColor" opacity =".55" /><rect x ="22.64" y ="36.32" width ="50.16" height ="38.76" rx ="7.98" fill ="currentColor" /></svg >
<span >Continuar con Oficina ID</span >
</a >
<a rst-btn ="ghost" href ="/signin?ways=1&way=oficina" >
<span >Otras formas de iniciar sesión</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
</div >
</section >
En una aplicación, esto llegaría a /signin/oficina, /signin?ways=1&way=oficina. Aquí sus enlaces y formularios no llevan a ninguna parte.
Una sola forma de entrar, con llave de acceso
La llave de acceso como única forma de entrar. Dibuja el botón desactivado y deja que el script lo active, para que nada se mueva cuando lo haga; la línea de debajo es donde el script dice qué pasó.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door ="one-way" >
<h1 id ="rst-signin-heading" >Inicia sesión en Harbour</h1 >
<div rst-signin-passkey ="before" >
<button rst-btn ="primary block" type ="button" aria-describedby ="rst-signin-passkey-msg" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" /><circle cx ="16.5" cy ="7.5" r =".5" fill ="currentColor" /></svg >
<span >Iniciar sesión con tu llave de acceso</span >
</button >
<div rst-signin-passkey-note >
<p rst-signin-passkey-msg id ="rst-signin-passkey-msg" aria-live ="polite" ></p >
<button type ="button" rst-signin-passkey-close hidden aria-label ="Cerrar" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M18 6 6 18" /><path d ="m6 6 12 12" /></svg >
</button >
</div >
</div >
<a rst-btn ="ghost" href ="/signin?ways=1&way=passkey" >
<span >Otras formas de iniciar sesión</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
</div >
</section >
En una aplicación, esto llegaría a /signin?ways=1&way=passkey. Aquí sus enlaces y formularios no llevan a ninguna parte.
Otras formas de iniciar sesión
Una lista de enlaces, no un formulario, así que no necesita script. Cada fila abre una pantalla con una sola forma de entrar, y la del correo muestra la dirección que este navegador recuerda.
<section rst-signin aria-labelledby ="rst-signin-heading" >
<div rst-signin-brand >
<div rst-signin-mark >
<svg viewBox ="0 0 48 48" aria-hidden ="true" focusable ="false" ><circle cx ="24" cy ="24" r ="21" fill ="none" stroke ="currentColor" stroke-width ="3" /><path d ="M11 29c4.5 0 4.5-4 9-4s4.5 4 9 4 4.5-4 9-4" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /><path d ="M24 11v11" fill ="none" stroke ="currentColor" stroke-width ="3" stroke-linecap ="round" /></svg >
</div >
<p rst-signin-name >Harbour</p >
<p rst-signin-pitch >Amarres y atraques, reservados en un minuto.</p >
</div >
<div rst-signin-door ="one-way" >
<h1 id ="rst-signin-heading" >Otras formas de iniciar sesión</h1 >
<div rst-signin-ways >
<a rst-btn ="block" href ="/signin?way=email" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><rect width ="20" height ="16" x ="2" y ="4" rx ="2" /><path d ="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7" /></svg >
<span >Correo electrónico <bdi >ada@example.com</bdi ></span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
<a rst-btn ="block" href ="/signin?way=passkey" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" /><circle cx ="16.5" cy ="7.5" r =".5" fill ="currentColor" /></svg >
<span >Iniciar sesión con una llave de acceso</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</a >
<form rst-signin-form method ="post" action ="/signin/forget" >
<input type ="hidden" name ="way" value ="email" >
<button rst-btn ="block" type ="submit" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><circle cx ="12" cy ="12" r ="4" /><path d ="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8" /></svg >
<span >Usar otro correo electrónico</span >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m9 18 6-6-6-6" /></svg >
</button >
</form >
</div >
<a rst-btn ="ghost" href ="/signin?way=oficina" >
<svg class ="icon" viewBox ="0 0 24 24" fill ="none" stroke ="currentColor" stroke-width ="2" stroke-linecap ="round" stroke-linejoin ="round" aria-hidden ="true" focusable ="false" ><path d ="m15 18-6-6 6-6" /></svg >
<span >Atrás</span >
</a >
</div >
</section >
En una aplicación, esto llegaría a /signin/forget, /signin?way=email, /signin?way=oficina, /signin?way=passkey. Aquí sus enlaces y formularios no llevan a ninguna parte.