# Inductive sensor

A threaded proximity sensor exposes its oscillator coil and a movable metal target. Distance and range determine a qualitative detected output without inventing a target.

> For the complete index, see [llms.txt](https://robocn.dev/llms.txt). A Markdown version of any page is available by appending `.md` to its URL or by sending an `Accept: text/markdown` header.

## Install

```bash
bunx --bun shadcn@latest add https://robocn.dev/r/inductive-sensor.json
```

Registry item: `inductive-sensor` · [`https://robocn.dev/r/inductive-sensor.json`](https://robocn.dev/r/inductive-sensor.json)

## Notes

- Distance is normalized to the drawing and is not calibrated. The component does not infer material, frequency, field strength or millimetres.

## Usage

```tsx
import { InductiveSensor } from "@/components/ui/inductive-sensor"

<InductiveSensor behavior="approach" target="tooth" range={0.3} />
<InductiveSensor distance={0.2} interactive onDistanceChange={setDistance} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `distance` | `number` | — | Controlled target distance from 0 near to 1 far. |
| `behavior` | `"approach" | "inspect" | "static"` | `"approach"` | Full approach cycle or motion near the threshold. |
| `target` | `"plate" | "tooth" | "none"` | `"plate"` | Metal target geometry; none always reports clear. |
| `range` | `number` | `0.35` | Qualitative detection threshold, clamped to 0.1–1. |
| `interactive / onDistanceChange` | `boolean / (distance: number) => void` | — | Drag and report target distance. |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One inductive sensor, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `animate` | `boolean` | `true` | Off parks the machine at phase and stops rendering. A reduced-motion preference does the same. |
| `paused` | `boolean` | `false` | Freeze where it stands. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `variant` | `"solid" | "outline" | "blueprint" | "wire"` | `"solid"` | How the machine is painted. Geometry never changes between variants. |
| `size` | `"xs" | "sm" | "md" | "lg" | "xl" | number` | `"md"` | Rendered width in pixels, or a step on the scale. |
| `color` | `string` | `var(--robot-shell)` | Body panels — the colour the machine reads as. |
| `accent` | `string` | `var(--robot-accent)` | Status colour: tip light, live tool, readouts. |
| `metal` | `string` | `var(--robot-metal)` | Bare machined parts: collars, bolts, tool bodies. |
| `dark` | `string` | `var(--robot-dark)` | Cast joints, base, shadow side. |
| `palette` | `Partial<RobotPalette>` | — | Override any subset of roles at once, including glow and grid. |

## Source

- `src/components/ui/inductive-sensor.tsx`
