Forgot Password Form
nswds-ui/forgot-password-formFreeBlock
A forgot-password form worked example (Card + Field + Input + Button) wired with NSWDS components. Copy-and-adapt block — not a published component.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/digitalnsw/nswds-ui/main/apps/registry/public/r/forgot-password-form.jsonSource
1'use client'23import type * as React from 'react'45import { Button } from '@/components/button'6import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/card'7import { Field, FieldDescription, FieldGroup, FieldLabel } from '@/components/field'8import { Input } from '@/components/input'9import { Link } from '@/components/link'10import { cn } from '@/lib/utils'1112/**13 * ForgotPasswordForm — the password-reset request step that pairs with the14 * "Forgot your password?" link in LoginForm.15 *16 * A composed pattern (Card + Field + Input + Button), published as a worked17 * example: copy the source and wire the single email field to your own reset18 * handler rather than configuring it through props.19 *20 * Single-field by design. The flow is intentionally minimal — collect the21 * email, send the reset link, and (for account-enumeration safety) show the22 * same confirmation whether or not the address is registered.23 */24export function ForgotPasswordForm({ className, ...props }: React.ComponentProps<'div'>) {25 return (26 <div className={cn('flex flex-col gap-6', className)} {...props}>27 <Card className='w-full'>28 <CardHeader>29 <CardTitle>Forgot your password?</CardTitle>30 <CardDescription>31 Enter the email address for your account and we'll send you a link to reset your32 password.33 </CardDescription>34 </CardHeader>35 <CardContent>36 <form>37 <FieldGroup>38 {/* No htmlFor/id wiring: the Field associates the label with the39 * control automatically (Base UI generates the id per instance). */}40 <Field>41 <FieldLabel>Email</FieldLabel>42 <Input type='email' autoComplete='email' placeholder='m@example.com' required />43 </Field>44 <Field>45 <Button type='submit'>Send reset link</Button>46 </Field>47 <Field>48 <FieldDescription className='text-center'>49 Remembered your password? <Link href='#'>Back to login</Link>50 </FieldDescription>51 </Field>52 </FieldGroup>53 </form>54 </CardContent>55 </Card>56 </div>57 )58}
What it pulls in
Other registry items
Files it writes
More from @nswds/ui
All 46 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Footer — Collapsible Site Mapfooter-accordion | @nswds/ui | Blocks | Free | no deps | |
| Footer — Compact Barfooter-compact | @nswds/ui | Blocks | Free | no deps | |
| Footer — Contact Detailsfooter-contact | @nswds/ui | Blocks | Free | no deps | |
| Footer — Call to Actionfooter-cta | @nswds/ui | Blocks | Free | no deps | |
| Footer — Newsletterfooter-newsletter | @nswds/ui | Blocks | Free | no deps | |
| Footer — Simple Centredfooter-simple-centred | @nswds/ui | Blocks | Free | no deps | |
| Footer — Site Mapfooter-sitemap | @nswds/ui | Blocks | Free | no deps | |
| Footer — Site Map with Brandfooter-sitemap-brand | @nswds/ui | Blocks | Free | no deps |
