# Code walkthrough

Emphasize and scroll to selected lines of source.

Source: https://legend.so/slides/effects/code-walkthrough/

Legend Slides: Preview.

[← All effects](https://legend.so/slides/effects/)![Code walkthrough in Legend Slides](https://legend.so/slides/effects/previews/code-walkthrough/237f961ade4242bb4ee322c6138544a8cc099e2909078140510b9ad92954fc6b.png)

Still captured in Legend Slides for macOS (development build).

[Install in Slides](legend-slides://effects/install?pack=presenting&version=1.0.0)[Open example in Slides](legend-slides://effects/example?effect=code-walkthrough)[Download example](https://legend.so/slides/effects/examples/code-walkthrough/e70db6d37ed4e6b79632cd2e1568ab36835ca61e65ae276072f4d9f90805062c.mdx)

Requires a Legend Slides build with effect installation support. Installs the presenting pack (1.0.0, 22 KB source) and its dependencies. macOS host capabilities: reanimated, skia. Installed decks work offline.

## Use it in a deck

```mdx
---
title: Code walkthrough
---

import { View, Text } from "react-native";
import { CodeWalkthrough } from "slides:presenting/CodeWalkthrough";

export const code = "const data = await load();\nconst result = transform(data);\nrender(result);";

# Code walkthrough

<View style={{ width: 1696, height: 650 }}>
<Steps count={3}>{step => <CodeWalkthrough source={code} lines={[step + 1, step + 1]} explanation={<Text style={{color: "white",fontSize: 48}}>Follow the highlighted line.</Text>} />}</Steps>
</View>
```

## Configure

**source**

Source text to display.

**lines**

One-based selected lines.

**explanation**

Content beside the code.

Only imported effects enter the compiled deck. [Installation and versioning →](https://legend.so/slides/effects/installation/)

[View Markdown](https://legend.so/slides/effects/code-walkthrough.md)[Report a documentation correction](https://github.com/LegendApp/legend-docs/issues/new?title=Docs%3A+Code+walkthrough&body=Page%3A+https%3A%2F%2Flegend.so%2Fslides%2Feffects%2Fcode-walkthrough%0A%0AWhat+is+incorrect+or+missing%3F%0A%0AExpected+behavior+or+supporting+source%3A%0A)
