# Type conversions

**Category:** Interaction  
**Live demo:** https://xenolithengine.github.io/xenolith-graph/examples/type-conversions/  
**Frameworks shipped:** vanilla, react

## Description

Typed pins of different types refuse to connect — unless you register a conversion. NumberSource (out: number) won’t wire into TextSink (in: text) until `types.registerConversion("number", "text", String)` is called. Toggle the cast live; the existing edge drops when it disappears.

## Source files

  - [vanilla] vanilla/type-conversions.ts
  - [vanilla] shared/type-conversions.ts
  - [react] demos/TypeConversionsDemo.tsx
  - [react] shared/type-conversions.ts

## How to use this example

Open the live demo at https://xenolithengine.github.io/xenolith-graph/examples/type-conversions/ to interact with it in the browser. The same source files are
reproduced verbatim in the page so you can copy-paste into your own project. Every example is
self-contained — pick one, copy the files, install `@xenolithengine/graph-editor` + the relevant framework
adapter, and it runs.

## See also

- Full project docs: https://xenolithengine.github.io/xenolith-graph/llms.txt
- All examples (raw): https://xenolithengine.github.io/xenolith-graph/api/graphs.jsonl
- MCP tool catalog: https://xenolithengine.github.io/xenolith-graph/api/mcp-tools.json
- Repository: https://github.com/XenolithEngine/xenolith-graph
