Sign in
A centred card with a form and a footer link.
Updated
Default
Sign in
Use your account email.
<div class="mx-auto max-w-sm">
{ui card, title: 'Sign in', description: 'Use your account email.'}
<form class="flex flex-col gap-4">
{ui field, name: 'email', label: 'Email'}
{ui input, name: 'email', type: 'email', placeholder: '[email protected]' /}
{/ui}
{ui field, name: 'password', label: 'Password'}
{ui input, name: 'password', type: 'password' /}
{/ui}
{ui button, title: 'Sign in', class: 'w-full' /}
</form>
{block footer}
<p class="text-muted">No account? <a href="#">Create one</a></p>
{/block}
{/ui}
</div>
The card and fields keep their defaults. The only extras are mx-auto max-w-sm to centre and narrow the card, and w-full on the button. The link sits in the card's footer block.
Failed attempt
Sign in
Use your account email.
<div class="mx-auto max-w-sm">
{ui card, title: 'Sign in', description: 'Use your account email.'}
<form class="flex flex-col gap-4">
{ui alert,
title: 'Wrong email or password',
icon: 'circle-alert',
class: 'alert-destructive',
/}
{ui field, name: 'email', label: 'Email'}
{ui input, name: 'email', type: 'email', value: '[email protected]' /}
{/ui}
{ui field, name: 'password', label: 'Password'}
{ui input, name: 'password', type: 'password' /}
{/ui}
{ui button, title: 'Sign in', class: 'w-full' /}
</form>
{/ui}
</div>
An alert-destructive alert at the top of the form says the attempt failed, and the email comes back filled in so only the password is retyped. The message does not say which of the two was wrong.