# Navigation to Detail Views Use `navigateTo()` for drilling into detail views from list patterns. ## List Pattern ```typescript import { navigateTo, pattern, UI, Writable } from "commontools"; import ItemDetail from "./item-detail.tsx"; interface Item { name: string; status: string; } interface Input { items: Writable; } export default pattern(({ items }) => ({ [UI]: ( {items.map((item) => ( {item.name} navigateTo(ItemDetail({ item }))}> Edit ))} ), items, })); ``` ## Detail Pattern with `.key()` The detail pattern receives a `Writable` and uses `.key()` to access individual fields for editing: ```typescript import { pattern, UI, Writable } from "commontools"; interface Item { name: string; status: string; } interface Input { item: Writable; // Single Writable of the whole object } export default pattern(({ item }) => ({ [UI]: ( ), item, })); ``` **Why `.key()`?** When you need to edit fields of an object passed from a list: - Use `Writable` (not separate Writables for each field) - Use `.key("fieldName")` to get a Writable for that specific field - The `.key()` result works directly with `$value` bindings - Changes sync automatically back to the list ## Canonical Example See `packages/patterns/reading-list/` for a complete implementation: - `reading-list.tsx` - List with navigation to detail - `reading-item-detail.tsx` - Detail view using `.key()` for field editing ## See Also - [Writable Methods](../concepts/types-and-schemas/writable.md) - `.key()` and other methods - [Two-Way Binding](./two-way-binding.md) - `$value` binding syntax - [Conditional Rendering](./conditional.md) - Using ifElse for show/hide