# useCursor

```ts
import { useCursor, Text } from "@pibbl/core";
```

`useCursor({ path?, style?, fill?, lineInteractionWidth? })` is render-only.
With a path, it follows the same logical targeting geometry as mouse events;
without one it supplies a component-level default. Re-render updates it, and
replacement or unmount releases its region and cursor ownership.

Its `style` uses the local [`CursorStyle`](/reference/types/styles/#cursorstyle) vocabulary.

```tsx
function Link() {
  useCursor({
    path: new Path2D("M0 0h120v36H0z"),
    style: "pointer",
    fill: true,
  });
  return <Text style={{ fill: "#2563eb" }}>Open</Text>;
}
```

See the [Hit areas and cursors live example](/playground/#/examples/events-and-interaction/hit-areas-and-cursors).

## API details from source

<span id="api-useCursor"></span>

Hook: wires a CSS cursor to the same logical target resolver used by mouse
events. The cursor is released when this hook slot is replaced or removed.

```ts
useCursor: ({ path, style, fill, lineInteractionWidth, }: { path?: Path2D | PathGeometry; style?: string; fill?: boolean; lineInteractionWidth?: number; }) => void
```

Related API: [useCursor](/reference/hooks/use-cursor/), [PathGeometry](/reference/functions/path-geometry/).

### Parameters

- **`options`** — Cursor style and optional fill or stroke hit region for the current component.
See [PathGeometry](/reference/functions/path-geometry/) .

### See also

[PathGeometry](/reference/functions/path-geometry/)

[View source — packages/core/src/lib/hooks/use-cursor.ts:29](/source/packages/core/src/lib/hooks/use-cursor-ts/#L29)

## Implementation guidance for agents

Read the [Input, focus, and native HTML companion](/agents/topics/input/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Typed event target](/minimal-examples/events/target/): A geometric Canvas target routes pointer, mouse, touch, wheel, keyboard, input, clipboard, and drag events. [Plain source](/minimal/events/target.tsx)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
