WingoUI
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime Picker
Forms
Address InputCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text EditorSchema Builder
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX ViewerExcel ViewerFile SystemImage CropperImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Gravity Letters
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowPost Listing WizardPricing PageRegister PageSettings PageUsers Admin Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Media

PDF Viewer

MediaPDF ViewerNew
Location MapPowerPoint Viewer
Live props
Content
src
fileName
Behavior
defaultZoom
wasmUrl
Appearance
variant
radius
highlightColor
activeHighlightColor
selectionColor
Layout
showToolbar
showThumbnails
defaultSidebarOpen
showSearch
showRotateControls
showDownload
showUpload
height640px
Code
import { PdfViewer } from "@/components/ui/pdf-viewer"

<PdfViewer />
ProNew

v1.0.0·Added in 1.4.0

A PDF viewer on PDFium: sharp pages at any zoom, text search and selection, page thumbnails, rotation, download, upload and page overlays.

Scroll through the pages; only the ones on screen render, and zoomed-in pages paint in sharp tiles. Type a page number in the toolbar (Enter jumps, Up and Down step, Escape cancels). Zoom with - and +, or pick Automatic, Fit page, Fit width or a percentage from the zoom menu. Search opens from the toolbar or with Ctrl+F / ⌘F while focus is inside the viewer: hits are highlighted on every page, the counter reads 2 of 5, and Enter / Shift+Enter or the arrows step through them. Drag across text to select it and press Ctrl+C / ⌘C to copy. The sidebar shows page thumbnails: click to jump, Shift+click for a range, Ctrl/⌘+click to add a page; in the list Up / Down move, Home / End jump, Shift extends and Space toggles. The rotate buttons turn the selected pages (or the current one) and the reading position holds. The ⋯ menu downloads the file with your rotations applied and opens another PDF, which you can also drop onto the viewer. The sidebar starts open beside the pages; below 520px of width it starts closed, slides over the pages when opened and closes after a pick; below 600px the rotate buttons move into the ⋯ menu.

Add to a project

npx wingo-ui@latest add pdf-viewer

Pro item: the CLI needs a Pro account. See plans

Dependencies

@embedpdf/core@embedpdf/engines@embedpdf/models@embedpdf/plugin-document-manager@embedpdf/plugin-interaction-manager@embedpdf/plugin-render@embedpdf/plugin-rotate@embedpdf/plugin-scroll@embedpdf/plugin-search@embedpdf/plugin-selection@embedpdf/plugin-thumbnail@embedpdf/plugin-tiling@embedpdf/plugin-viewport@embedpdf/plugin-zoompdf-liblucide-reactbuttondropdown-menupopovertooltipuse-controllable-stateui-config

Files

  • components/ui/pdf-viewer.tsx

See also

File UploadFile managerImage LightboxVideo Player
PreviousLocation MapNext PowerPoint Viewer
Pageof –
Loading document