Skip to content

Sign-in form

Forms
Sign-in form
Sign in
Use your work email to continue.

We'll never share your email.

Email + password form composed from Field primitives, with helper text and a submit row.

card · field · input · button
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@/components/ui/card"
import { FieldGroup, Field, FieldLabel, FieldDescription } from "@/components/ui/field"
import { Input } from "@/components/ui/input"
import { Button } from "@/components/ui/button"

export function SignInForm() {
  return (
    <Card className="max-w-sm">
      <CardHeader>
        <CardTitle>Sign in</CardTitle>
        <CardDescription>Use your work email to continue.</CardDescription>
      </CardHeader>
      <CardContent>
        <FieldGroup>
          <Field>
            <FieldLabel htmlFor="email">Email</FieldLabel>
            <Input type="email" placeholder="you@company.com" />
            <FieldDescription>We'll never share your email.</FieldDescription>
          </Field>
          <Field>
            <FieldLabel htmlFor="password">Password</FieldLabel>
            <Input type="password" placeholder="••••••••" />
          </Field>
        </FieldGroup>
      </CardContent>
      <CardFooter><Button className="w-full">Continue</Button></CardFooter>
    </Card>
  )
}
ui26/react
<script lang="ts">
  import Card from "$lib/components/ui/card.svelte"
  import CardHeader from "$lib/components/ui/card-header.svelte"
  import CardTitle from "$lib/components/ui/card-title.svelte"
  import CardDescription from "$lib/components/ui/card-description.svelte"
  import CardContent from "$lib/components/ui/card-content.svelte"
  import FieldGroup from "$lib/components/ui/field-group.svelte"
  import Field from "$lib/components/ui/field.svelte"
  import FieldLabel from "$lib/components/ui/field-label.svelte"
  import Input from "$lib/components/ui/input.svelte"
  import FieldDescription from "$lib/components/ui/field-description.svelte"
  import CardFooter from "$lib/components/ui/card-footer.svelte"
  import Button from "$lib/components/ui/button.svelte"
</script>

<Card class="max-w-sm">
  <CardHeader>
    <CardTitle>Sign in</CardTitle>
    <CardDescription>Use your work email to continue.</CardDescription>
  </CardHeader>
  <CardContent>
    <FieldGroup>
      <Field>
        <FieldLabel htmlFor="email">Email</FieldLabel>
        <Input type="email" placeholder="you@company.com" />
        <FieldDescription>We'll never share your email.</FieldDescription>
      </Field>
      <Field>
        <FieldLabel htmlFor="password">Password</FieldLabel>
        <Input type="password" placeholder="••••••••" />
      </Field>
    </FieldGroup>
  </CardContent>
  <CardFooter><Button class="w-full">Continue</Button></CardFooter>
</Card>
ui26/svelte
---
import Card from "@/components/ui/card.astro"
import CardHeader from "@/components/ui/card-header.astro"
import CardTitle from "@/components/ui/card-title.astro"
import CardDescription from "@/components/ui/card-description.astro"
import CardContent from "@/components/ui/card-content.astro"
import FieldGroup from "@/components/ui/field-group.astro"
import Field from "@/components/ui/field.astro"
import FieldLabel from "@/components/ui/field-label.astro"
import Input from "@/components/ui/input.astro"
import FieldDescription from "@/components/ui/field-description.astro"
import CardFooter from "@/components/ui/card-footer.astro"
import Button from "@/components/ui/button.astro"
---

<Card class="max-w-sm">
  <CardHeader>
    <CardTitle>Sign in</CardTitle>
    <CardDescription>Use your work email to continue.</CardDescription>
  </CardHeader>
  <CardContent>
    <FieldGroup>
      <Field>
        <FieldLabel htmlFor="email">Email</FieldLabel>
        <Input type="email" placeholder="you@company.com" />
        <FieldDescription>We'll never share your email.</FieldDescription>
      </Field>
      <Field>
        <FieldLabel htmlFor="password">Password</FieldLabel>
        <Input type="password" placeholder="••••••••" />
      </Field>
    </FieldGroup>
  </CardContent>
  <CardFooter><Button class="w-full">Continue</Button></CardFooter>
</Card>
ui26/astro
{
  "root": "card",
  "elements": {
    "card": {
      "type": "Card",
      "props": {
        "className": "max-w-sm"
      },
      "children": [
        "hdr",
        "content",
        "footer"
      ]
    },
    "hdr": {
      "type": "CardHeader",
      "props": {},
      "children": [
        "title",
        "desc"
      ]
    },
    "title": {
      "type": "CardTitle",
      "props": {
        "text": "Sign in"
      },
      "children": []
    },
    "desc": {
      "type": "CardDescription",
      "props": {
        "text": "Use your work email to continue."
      },
      "children": []
    },
    "content": {
      "type": "CardContent",
      "props": {},
      "children": [
        "group"
      ]
    },
    "group": {
      "type": "FieldGroup",
      "props": {},
      "children": [
        "f-email",
        "f-pw"
      ]
    },
    "f-email": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-email",
        "in-email",
        "desc-email"
      ]
    },
    "lbl-email": {
      "type": "FieldLabel",
      "props": {
        "text": "Email",
        "htmlFor": "email"
      },
      "children": []
    },
    "in-email": {
      "type": "Input",
      "props": {
        "type": "email",
        "placeholder": "you@company.com"
      },
      "children": []
    },
    "desc-email": {
      "type": "FieldDescription",
      "props": {
        "text": "We'll never share your email."
      },
      "children": []
    },
    "f-pw": {
      "type": "Field",
      "props": {},
      "children": [
        "lbl-pw",
        "in-pw"
      ]
    },
    "lbl-pw": {
      "type": "FieldLabel",
      "props": {
        "text": "Password",
        "htmlFor": "password"
      },
      "children": []
    },
    "in-pw": {
      "type": "Input",
      "props": {
        "type": "password",
        "placeholder": "••••••••"
      },
      "children": []
    },
    "footer": {
      "type": "CardFooter",
      "props": {},
      "children": [
        "btn"
      ]
    },
    "btn": {
      "type": "Button",
      "props": {
        "label": "Continue",
        "className": "w-full"
      },
      "children": []
    }
  }
}
ui26/json-render