Sign-up Form
nswds-ui/sign-up-formFreeBlock
A sign-up 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/sign-up-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 {8 Field,9 FieldDescription,10 FieldGroup,11 FieldLabel,12 FieldLegend,13 FieldSet,14} from '@/components/field'15import { Input } from '@/components/input'16import { LabeledSeparator } from '@/components/labeled-separator'17import { Link } from '@/components/link'18import { IconLogin } from '@/icons/login'19import { IconPersonAdd } from '@/icons/person-add'20import { cn } from '@/lib/utils'2122/**23 * SignUpForm — the account-creation counterpart to LoginForm.24 *25 * A composed pattern (Card + Field + Input + Button), published as a worked26 * example: copy the source and wire the fields to your own registration27 * handler rather than configuring it through props.28 *29 * Best-practice notes baked in:30 * - Single sign-on (Microsoft Entra ID) leads as the recommended path with31 * solid emphasis; email + password registration is the fallback, grouped32 * in a FieldSet whose legend names the set for assistive tech.33 * - `autoComplete="new-password"` on both the password and confirm-password34 * fields tells password managers to offer/save a generated password (vs.35 * the `current-password` hint LoginForm uses).36 * - A visible password-requirements hint is associated with the input via37 * `aria-describedby` so screen readers announce the rules (WCAG 3.3.2).38 * - Terms acceptance is communicated inline at the point of action rather39 * than via a pre-checked checkbox.40 */41export function SignUpForm({ className, ...props }: React.ComponentProps<'div'>) {42 return (43 <div className={cn('flex flex-col gap-6', className)} {...props}>44 <Card className='w-full'>45 <CardHeader>46 <CardTitle>Create your account</CardTitle>47 <CardDescription>Enter your details below to create a new account.</CardDescription>48 </CardHeader>49 <CardContent>50 <form>51 <FieldGroup>52 {/*53 * Single sign-on first: NSW Government staff authenticate with54 * Microsoft Entra ID, so SSO is the recommended path and carries55 * primary (solid) emphasis. Email + password registration is the56 * fallback below the separator.57 */}58 <Field>59 <FieldDescription>60// … truncated
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 |
