Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelog
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone Select
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 CardPopoverShare DialogSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSetup ChecklistSkeletonSpinnerToast
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 chartRadar chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselCSV ViewerDOCX EditorDOCX ViewerExcel ViewerFile SystemImage compareImage 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
Background PatternGravity LettersMarqueeText AnimateText Rotate
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
Marketing Sections
App Download SectionBlog Cards SectionCTA SectionFAQ SectionFeature GridFeature ShowcaseHero SectionIntegrations SectionLogo CloudMarketing FooterMarketing HeaderMarketing SectionNewsletter SectionPricing SectionStats SectionSteps SectionTeam SectionTestimonials SectionTimeline SectionVideo Section
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAPI Keys 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
Templates
About PageAcademy PageAccessibility PageAffiliate PageAI Product PageBlog PageBlog Post PageBug Bounty PageCareers PageChangelog PageCommunity PageCompare PageContact PageCustomer Story PageCustomers PageDemo Booking PageDevelopers PageDocs Home PageDownload PageEnterprise PageEvents PageExperts PageFAQ PageFeature PageGlossary PageHelp Article PageHelp Center PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePress PageProduct Tour PagePromo PageReferral PageResearch Report PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageSwitch PageTemplate Gallery PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Text & Effects

Background Pattern

Text & Effects

Background Pattern React component for Tailwind CSS v4

Workflow CanvasGravity Letters
Live props
Appearance
pattern
size
cellSizeFrom size
strokeWidth1px
dotSize1.5px
tone
color
fade
Behavior
animated
density0.04
duration3000ms
highlight
Layout
position
Code
import BackgroundPattern from "@/components/ui/background-pattern"

<BackgroundPattern />
  1. Home
  2. Components
  3. Text & Effects
  4. Background Pattern
Pro

Background Pattern React component for Tailwind CSS v4

v1.0.0·Added in 1.10.0

A decorative, theme-aware pattern layer of dots, grid, lines, diagonal stripes or crosses for heroes, cards, empty states and auth screens.

Drop it into any positioned element and it fills the space behind the content with a fine SVG pattern that fades out toward the edges, in a faint foreground color that reads in light and dark mode. With animated on, a sparse set of cells pulses in and out at random, the same cells on the server and in the browser. With highlight set to pointer, a soft spotlight brightens the pattern under the mouse and fades away when it leaves; touch screens skip it. It never takes clicks or focus and is hidden from screen readers. Under prefers-reduced-motion the pulsing stops and the pattern stays still.

Background Pattern is a Pro React component in the React effect components category, written in TypeScript for React 19 and Tailwind CSS v4. It installs as source with npx wingo-ui@latest add background-pattern, together with Motion presets, Tones and UIProvider and the npm package motion.

Add to a project

Requirements: React 19 and Tailwind CSS v4, in Next.js (App Router or Pages), Vite or React Router. Installation guide · Next.js setup · Vite setup

npx wingo-ui@latest add background-pattern

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

Usage

Import BackgroundPattern from @/components/ui/background-pattern.

import BackgroundPattern from "@/components/ui/background-pattern"

export function Hero() {
  return (
    <section className="relative isolate overflow-hidden px-6 py-24 text-center">
      <BackgroundPattern pattern="dots" fade="radial" />
      <h1 className="text-4xl font-semibold tracking-tight">Plan, build and ship in one place</h1>
    </section>
  )
}

Props

  • patterndefault "dots"
    "dots" | "grid" | "lines" | "diagonal" | "cross"

    The drawing repeated across the surface.

  • sizedefault "md"
    "sm" | "md" | "lg"

    Cell size: 16 / 24 / 40px.

  • cellSizedefault 0
    number

    An exact cell size in pixels that overrides size. 0 uses size.

  • strokeWidthdefault 1
    number

    Line width for grid, lines, diagonal and cross.

  • dotSizedefault 1.5
    number

    Dot radius for dots, capped at half the cell.

  • tonedefault "neutral"
    "neutral" | "brand" | "success" | "warning" | "danger" | "info"

    Semantic color. neutral is the foreground at 15% so it works in both themes; the other tones paint at 35% of the tone.

  • colordefault ""
    string

    Any CSS color; replaces the tone. The pattern paints at full strength in it, so pass a translucent color like rgb(124 58 237 / 0.3).

  • fadedefault "radial"
    "none" | "radial" | "top" | "bottom" | "edges"

    Where the pattern fades out. radial keeps the middle, top keeps the top and fades downward, bottom the reverse, edges fades all four sides.

  • animateddefault false
    boolean

    A sparse set of cells pulses in and out (dots, grid, lines and cross). The cells come from a fixed hash, so the server and the browser agree. Off under reduced motion and while scrolled out of view.

  • densitydefault 0.04
    number

    Share of cells that pulse when animated, capped at about 160 cells at once.

  • durationdefault 3000
    number

    One pulse in milliseconds. Cells start at random points of the cycle.

  • highlightdefault "none"
    "pointer" | "none"

    pointer adds a soft spotlight that follows the mouse over the parent element. Fine pointers only, so phones and tablets never show it.

  • positiondefault "absolute"
    "absolute" | "fixed" | "static"

    absolute fills the nearest positioned parent behind its content (give the parent relative and isolate), fixed fills the viewport, static sits in the flow at the size you give it.

  • classNames
    Partial<Record<"svg" | "mask" | "highlight", string>>

    Extra classes for the pattern svg, the fade mask wrapper and the spotlight layer.

  • className
    string

    Extra classes for the root, merged last. Change the strength with a text color, e.g. text-foreground/25.

Parts

  • BackgroundPatternProps

    type

    The props of BackgroundPattern: div props (without children and color) plus the options above.

  • BackgroundPatternKind

    type

    The pattern union: "dots" | "grid" | "lines" | "diagonal" | "cross".

  • BackgroundPatternSize

    type

    The size union: "sm" | "md" | "lg".

  • BackgroundPatternFade

    type

    The fade union: "none" | "radial" | "top" | "bottom" | "edges".

  • BackgroundPatternHighlight

    type

    The highlight union: "pointer" | "none".

  • BackgroundPatternPosition

    type

    The position union: "absolute" | "fixed" | "static".

  • BackgroundPatternSlot

    type

    The keys of classNames.

  • BackgroundPatternTone

    type

    The tone union, re-exported from lib/tones.

Examples

Hero

Dots with a radial fade behind a landing page headline.

Flickering grid behind a card

animated lights up a few random cells; edges fades all four sides.

Auth layout

Fine lines that fade out downward, behind a sign-in card.

Empty state

Diagonal stripes give an empty screen some texture.

Brand tone with a spotlight

tone brand and highlight pointer; the spotlight follows the mouse.

Dependencies

motionmotiontonesui-config

Files

  • components/ui/background-pattern.tsx

FAQ

Is the React Background Pattern component free?

The preview, props and docs are free; copying the source needs a Pro plan. See plans.

How do I install Background Pattern?

Run npx wingo-ui@latest add background-pattern. It also adds the Wingo UI items it builds on (Motion presets, Tones and UIProvider) and the npm package motion. With shadcn, add the @wingo-ui registry with your API key, then run npx shadcn@latest add @wingo-ui/background-pattern.

See also

Hero SectionEmpty StateCardLogin PageGrid Reveal

More React effect components

Gravity LettersMarqueeText AnimateText Rotate
All 5 React effect components
PreviousWorkflow CanvasNext Gravity Letters
New: release notes in one click

Plan, build and ship in one place

Projects, docs and releases for small teams, without the busywork.