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

DOCX Viewer

MediaDOCX ViewerNew
CSV ViewerExcel Viewer
Live props
Content
src
fileName
Behavior
defaultZoom
defaultCommentsVisible
defaultChangesVisible
defaultDarkPages
locale
Appearance
variant
radius
highlightColor
activeHighlightColor
commentHighlightColor
Layout
showToolbar
showThumbnails
defaultSidebarOpen
showSearch
showComments
showChanges
showDarkPages
showDownload
showUpload
height640px
Code
import { DocxViewer } from "@/components/ui/docx-viewer"

<DocxViewer />
ProNew

v1.0.0·Added in 1.4.0

A Word (.docx) viewer with real pages, headers and footers, thumbnails, zoom, search, comments, tracked changes, download and upload.

Scroll through the pages: each one is laid out like Word's, with its header, footer and page numbers, and a page that runs long is split at its paragraphs and table rows. 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, the counter reads 2 of 5, and Enter / Shift+Enter or the arrows step through them. Comments show as cards beside the pages with the commented text highlighted; click a card or the highlighted text to pick it. When the viewer is too narrow for the cards, markers sit on the page edge and open the card in a popover (a bottom sheet on phones). The toolbar switches comments, tracked changes (insertions underlined in green, removals struck through in red) and dark pages on or off and downloads the original file; below 720px of width these move into the ⋯ menu, which also opens another .docx (you can drop one onto the viewer too). Pinch with two fingers, or Ctrl / ⌘ + scroll, to zoom around that point. The sidebar shows page thumbnails: click to jump; in the list Up / Down move, Home / End jump. It starts open beside the pages; below 520px of width it starts closed, slides over the pages when opened and closes after a pick; below 440px the zoom steps move into the ⋯ menu.

Add to a project

npx wingo-ui@latest add docx-viewer

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

Dependencies

docx-previewlucide-reactbuttondropdown-menupopovertooltipuse-controllable-stateui-config

Files

  • components/ui/docx-viewer.tsx

See also

PDF ViewerFile UploadFile manager
PreviousCSV ViewerNext Excel Viewer
Pageof –
Loading document