Sections
File Viewer
- Overview
- Anatomy
- Header
- Navigation
- Renderers
FileViewerTitle renders the active file display name from
FileViewerProvider state.
<FileViewerTitle />Behavior
- Reads
descriptor.displayNamefrom file viewer context. It does not take asource,title, or file name prop. - Renders a
data-slot="file-viewer-title"element with truncating text. - The file name is the primary identity. Do not add decorative file-type icons beside it unless the surrounding workflow has a stronger reason.
API Reference
| Prop | Type | Description |
|---|---|---|
...props | React.ComponentProps<"span"> | Standard span props; className is merged. |
Source
file-viewer-header.tsx
"use client";
import * as React from "react";
import { PanelLeft, PanelRight } from "lucide-react";
import { cn } from "@/lib/utils";
import { Button } from "./button";
import { Spinner } from "./spinner";
import { useFileViewerControlsState } from "./file-viewer-provider";
import { useFileViewerRequiredResourceState } from "./file-viewer-resource-state";
import {