# zidane-ui/settings/demos

Import: `import { … } from 'zidane-ui/settings/demos'`. Source: [ui/src/settings/demos/index.ts](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/index.ts).

## Components

### `ApprovalDemo`

Component.

Renders the demo of an approval mode.

```ts
function ApprovalDemo(props: ApprovalDemoProps): Element
```

**Parameters**

- `props` (`ApprovalDemoProps`): Component props.

**Returns** `Element`

Source: [ui/src/settings/demos/autonomy.tsx:113](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/autonomy.tsx#L113)

### `ConversationPresetPreview`

Component.

`zidane-ui/settings/demos`: the settings' previews and mini demos, for a
page that shows them on their own (a gallery). The mini demos are small
decorative scenes of what a feature, an extension or an approval mode does;
the tutorial scenes are one per topic, each taking the step on show; the
conversation preview draws a transcript in the settings it is given. They
are kept off `zidane-ui/settings`, whose pages load them on demand, so the
settings screen doesn't carry the transcript and every scene up front.

```ts
function ConversationPresetPreview(props: ConversationPresetPreviewProps): Element
```

**Parameters**

- `props` (`ConversationPresetPreviewProps`): Component props.

**Returns** `Element`

**Props**

- `className?` (`string`): Extra classes on the block.
- `maxHeight?` (`number`): The height of the preview's scroller, in pixels.
- `onApply` (`(preset: TranscriptPresetId) => void`): Applies a preset: every setting of `transcriptPreset(id).settings`.
- `settings` (`Partial<Settings>`): The settings in effect.
- `style?` (`CSSProperties`): Inline styles on the root element.

Source: [ui/src/settings/conversation-preview.tsx:152](https://github.com/Tahul/zidane/blob/main/ui/src/settings/conversation-preview.tsx#L152)

### `ConversationPreview`

Component.

`zidane-ui/settings/demos`: the settings' previews and mini demos, for a
page that shows them on their own (a gallery). The mini demos are small
decorative scenes of what a feature, an extension or an approval mode does;
the tutorial scenes are one per topic, each taking the step on show; the
conversation preview draws a transcript in the settings it is given. They
are kept off `zidane-ui/settings`, whose pages load them on demand, so the
settings screen doesn't carry the transcript and every scene up front.

```ts
function ConversationPreview(props: ConversationPreviewProps): Element
```

**Parameters**

- `props` (`ConversationPreviewProps`): Component props.

**Returns** `Element`

**Props**

- `className?` (`string`): Extra classes on the window.
- `maxHeight?` (`number`): The height of the window's scroller, in pixels.
- `settings` (`Partial<Settings>`): The settings to draw the sample with.
- `style?` (`CSSProperties`): Inline styles on the root element.
- `title?` (`string`): The caption of the window. Defaults to the `preview` label.

Source: [ui/src/settings/conversation-preview.tsx:101](https://github.com/Tahul/zidane/blob/main/ui/src/settings/conversation-preview.tsx#L101)

### `ExtensionDemo`

Component.

Renders the demo of a native extension, or nothing for an extension without one.

```ts
function ExtensionDemo(props: ExtensionDemoProps): Element | null
```

**Parameters**

- `props` (`ExtensionDemoProps`): Component props.

**Returns** `Element | null`

Source: [ui/src/settings/demos/extensions.tsx:231](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/extensions.tsx#L231)

### `FeatureDemo`

Component.

Renders the demo of a feature, or nothing for a feature without one.

```ts
function FeatureDemo(props: FeatureDemoProps): Element | null
```

**Parameters**

- `props` (`FeatureDemoProps`): Component props.

**Returns** `Element | null`

Source: [ui/src/settings/demos/features.tsx:577](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/features.tsx#L577)

### `SandboxDemo`

Component.

Renders the sandbox demo: the project allowed, `~/.ssh` blocked.

```ts
function SandboxDemo(props: DemoProps): Element
```

**Parameters**

- `props` (`DemoProps`): Component props.

**Returns** `Element`

**Props**

- `className?` (`string`): Extra classes on the root element.
- `on` (`boolean`): The switch is on: the demo plays. Off: it dims and stands still.
- `style?` (`CSSProperties`): Inline styles on the root element.

Source: [ui/src/settings/demos/autonomy.tsx:129](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/autonomy.tsx#L129)

## Constants

### `TUTORIAL_SCENES`

Constant.

The scene of each tutorial.

```ts
const TUTORIAL_SCENES: Readonly<Record<TutorialTopic, ComponentType<SceneProps>>>
```

Source: [ui/src/settings/demos/how-it-works.tsx:757](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/how-it-works.tsx#L757)

## Interfaces

### `ConversationPresetPreviewProps`

Interface.

Props of [`ConversationPresetPreview`](https://zidane.si/docs/reference/ui-settings-demos.md#ConversationPresetPreview).

```ts
interface ConversationPresetPreviewProps
```

**Properties**

- `className?` (`string`): Extra classes on the block.
- `maxHeight?` (`number`): The height of the preview's scroller, in pixels.
- `onApply` (`(preset: TranscriptPresetId) => void`): Applies a preset: every setting of `transcriptPreset(id).settings`.
- `settings` (`Partial<Settings>`): The settings in effect.
- `style?` (`CSSProperties`): Inline styles on the root element.

Source: [ui/src/settings/conversation-preview.tsx:133](https://github.com/Tahul/zidane/blob/main/ui/src/settings/conversation-preview.tsx#L133)

### `ConversationPreviewProps`

Interface.

Props of [`ConversationPreview`](https://zidane.si/docs/reference/ui-settings-demos.md#ConversationPreview).

```ts
interface ConversationPreviewProps
```

**Properties**

- `className?` (`string`): Extra classes on the window.
- `maxHeight?` (`number`): The height of the window's scroller, in pixels.
- `settings` (`Partial<Settings>`): The settings to draw the sample with.
- `style?` (`CSSProperties`): Inline styles on the root element.
- `title?` (`string`): The caption of the window. Defaults to the `preview` label.

Source: [ui/src/settings/conversation-preview.tsx:83](https://github.com/Tahul/zidane/blob/main/ui/src/settings/conversation-preview.tsx#L83)

### `DemoProps`

Interface.

What every demo takes: whether the switch it shows is on.

```ts
interface DemoProps
```

**Properties**

- `className?` (`string`): Extra classes on the root element.
- `on` (`boolean`): The switch is on: the demo plays. Off: it dims and stands still.
- `style?` (`CSSProperties`): Inline styles on the root element.

Source: [ui/src/settings/demos/parts.tsx:10](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/parts.tsx#L10)

### `SceneProps`

Interface.

What every tutorial scene takes.

```ts
interface SceneProps
```

**Properties**

- `className?` (`string`): Extra classes on the root element.
- `step` (`number`): The step on show, from 0.
- `style?` (`CSSProperties`): Inline styles on the root element.

Source: [ui/src/settings/demos/tour.tsx:13](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/tour.tsx#L13)

## Types

### `FeatureDemoId`

Type.

What a feature demo can show: a setting's key, or the app's motion (Appearance › Motion, not a table row).

```ts
type FeatureDemoId = BooleanSettingKey | 'motion'
```

Source: [ui/src/settings/demos/features.tsx:532](https://github.com/Tahul/zidane/blob/main/ui/src/settings/demos/features.tsx#L532)
