---
title: "Face Scan"
description: "A small face icon for a face ID check. It blinks while it waits, turns into a ring while it scans, then shows a check or shakes when the scan fails."
url: https://gelatinui.com/components/face-scan
markdown_url: https://gelatinui.com/components/face-scan.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/face-scan"
version: "2026-11-15"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Face Scan

> A small face icon for a face ID check. It blinks while it waits, turns into a ring while it scans, then shows a check or shakes when the scan fails.

Page: https://gelatinui.com/components/face-scan

## When to use it

Best for: A face check that runs, then answers with a check or a frown, on an unlock or approval screen.

- Set `status` to `scanning` while the check runs, then to `success` or `error`.
- Use `FaceScanSurface variant="hud"` for a dark box in the middle of the screen.
- Give each stage its own words with `labels`, or a function child on `FaceScanStatus`.

## When not to use it

- For a job that is not a face check, use a [Dot Matrix](https://gelatinui.com/components/dot-matrix.md).
- For a plain loading ring in a button, use a [Spinner](https://gelatinui.com/components/spinner.md).

## Notes for agents

- Compose `FaceScanGlyph` and `FaceScanStatus` in `FaceScan`. With no children, the root shows both.
- The app owns `status`: `idle`, `scanning`, `success`, or `error`. Each change morphs from the live shape.
- `size` is `sm` (24 px), `default` (48), `lg` (72), or `xl` (96). `FaceScanSurface` takes the size of the root.
- In the idle stage the face looks toward the pointer over the root. Set `lookAtPointer={false}` to stop it.
- The loops stop off screen and in a hidden tab. The glyph is `aria-hidden`; the status line says the stage.
- With no `FaceScanStatus`, nothing names the stage: give the root `role="img"` and an `aria-label` that you change with `status`.

## Anatomy

```text
FaceScan
├─ FaceScanGlyph (0..n)
├─ FaceScanStatus (0..n)
└─ FaceScanSurface (0..n)
```

## API reference

### FaceScan

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"default" \| "lg" \| "sm" \| "xl"` | "default" |  |
| `status` | `"error" \| "idle" \| "scanning" \| "success"` | "idle" | The stage: `idle` (default), `scanning`, `success`, or `error`. The app sets it. |
| `lookAtPointer` | `boolean` | true | In the idle stage, the face looks toward the pointer over the root. Default `true`. |
| `labels` | `Partial<FaceScanLabels>` |  | The words of each stage for `FaceScanStatus`. |
| `children` | `ReactNode` |  | The parts. With none, the root shows the glyph and the status line. |

### FaceScanGlyph

No props of its own: `className`, `children`, and every other prop go to the element it renders.

### FaceScanStatus

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `function \| ReactNode` |  | The words, or a function that answers per stage. With none, the root `labels` answer. |

### FaceScanSurface

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"hud" \| "plain" \| "tile"` | "plain" |  |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| FaceScan | `face-scan` |  |  |  |
| FaceScanGlyph | `face-scan-glyph` | `data-status` |  | `motion-timing`, `status-colors` |
| FaceScanStatus | `face-scan-status` |  |  |  |
| FaceScanSurface | `face-scan-surface` |  |  |  |

## Usage

Set `status` from your face check, and compose the parts.

```tsx title="face-unlock.tsx"
import { FaceScan, FaceScanGlyph, FaceScanStatus, FaceScanSurface } from "@/components/pro/effects/face-scan";

export function FaceUnlock({ status }: { status: "idle" | "scanning" | "success" | "error" }) {
  return (
    <FaceScan status={status} size="lg">
      <FaceScanSurface variant="tile">
        <FaceScanGlyph />
      </FaceScanSurface>
      <FaceScanStatus />
    </FaceScan>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui-pro/face-scan
```

It adds 27 registry items: 25 files, 4272 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Dot Matrix](https://gelatinui.com/components/dot-matrix.md)
- [Spinner](https://gelatinui.com/components/spinner.md)

## Motion

| Part | Motion |
| --- | --- |
| Curl | glide · the corners curl into a ring as the scan starts |
| Scan | progress · the ring turns once in 1.2 s while the eyes look around |
| Success | iconDraw · the ring closes, the check draws, and the glyph pops |
| Error | iconHover · the face frowns and shakes once |
| Idle | follow · the face looks toward the pointer and blinks every 4.2 s |
