Skip to content
WingoUI
ComponentsTemplatesDocsPricingAI agentsBlogChangelogContact
Components
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCountry SelectCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerEmail InputEmoji PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime PickerTimezone SelectTree Select
Forms
Address InputBooking WidgetCSV 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 GalleryImage LightboxLocation MapPDF ViewerPowerPoint ViewerQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadChat WidgetConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Background PatternGravity LettersMarqueeTerminalText 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 FlowOrder History PagePost Listing WizardPricing PageProfile PageRegister PageSettings PageUsers Admin Page
Templates
About PageAcademy PageAccessibility PageAffiliate PageAgency PageAI Product PageAppointment Booking 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 PageHome Services PageImpact PageIntegration Detail PageIntegrations PageJob Detail PageLanding PageLaunch PageLegal PageManifesto PagePortfolio PagePress PageProduct Tour PagePromo PageReal Estate PageReferral PageResearch Report PageRestaurant PageRoadmap PageROI Calculator PageSecurity PageSolutions PageStartups PageStatus PageStorefront PageSwitch PageTemplate Gallery PageTravel PageWaitlist PageYear in Review Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryTheme

Hooks & Utilities

UIProvider

Hooks & Utilities

UIProvider TypeScript helper for React

TonesuseClipboard
Live props
Options
locale
reducedMotion
inherit
  1. Home
  2. Components
  3. Hooks & Utilities
  4. UIProvider
Free

UIProvider TypeScript helper for React

v1.0.0·Added in 1.0.0

A React config provider for Wingo UI: app-wide default props for every component, the Intl locale and a reduced-motion policy.

Wrap the app once. Every Wingo UI component reads its defaults from the provider (keyed by its data-slot name), so a whole project can switch to large, fully rounded buttons or a de-DE locale in one place. Props passed directly to a component still win. In the demo, pick a locale or a motion policy and watch the readout card change, and turn inherit off to see the nested buttons drop the outer radius and tone.

UIProvider is a free React helper in the React hooks and utilities category, written in TypeScript for React 19. It installs as source with npx wingo-ui@latest add ui-config.

Add to a project

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

npx wingo-ui@latest add ui-config

Usage

Import UIProvider from @/lib/ui-config.

import { UIProvider } from "@/lib/ui-config"

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <UIProvider
      locale="en-GB"
      defaults={{
        button: { radius: "full", size: "lg" },
        input: { variant: "filled" },
      }}
    >
      {children}
    </UIProvider>
  )
}

API

  • defaults
    Record<string, Record<string, unknown>>

    Default props per component, keyed by data-slot name, e.g. { button: { size: "lg", radius: "full" } }.

  • localedefault ""
    string

    Intl locale that locale-aware components read through useUIConfig().locale (e.g. "en-GB"). Empty leaves it to the component or an outer provider.

  • reducedMotiondefault "user"
    "user" | "always" | "never"

    The reduced-motion policy stored in the config and readable through useUIConfig(): user follows prefers-reduced-motion, always or never force a choice for your own code.

  • inheritdefault true
    boolean

    Merge with an outer UIProvider instead of replacing it, so a section can override a few defaults.

Parts

  • useDefaults

    hook

    Used inside components: merges provider defaults under the received props (undefined props do not override). Signature: <P>(name: string, props: P) => P.

  • useUIConfig

    hook

    Reads the merged config (defaults, locale, reducedMotion). Signature: () => UIConfig.

  • UIConfig

    type

    { defaults?, locale?, reducedMotion? }: the config a provider holds and useUIConfig returns.

  • UIProviderProps

    type

    Props of UIProvider: UIConfig plus children and inherit.

  • ComponentDefaults

    type

    Default props per component, keyed by data-slot name: Record<string, Record<string, unknown>>.

Examples

Defaults for a whole card

One provider makes every button large and fully rounded. Props on a single button still win.

Nested section override

A nested provider sets size sm. With inherit it keeps the outer radius and tone; without it, it starts fresh.

Locale for formatting

Locale-aware components read useUIConfig().locale, so the same price prints as en-US or de-DE.

Dependencies

No dependencies beyond React.

Files

  • lib/ui-config.tsx

FAQ

Is the UIProvider helper free?

Yes. The source is free and needs no account: copy it from the Code tab or install it with the CLI.

How do I install UIProvider?

Run npx wingo-ui@latest add ui-config. With shadcn, run npx shadcn@latest add https://wingo-ui.com/r/ui-config.json.

See also

ButtonuseLocalehookMotion presetslibInput

Used in

Fluid OrbListing cardQR CodeBadgeEmoji ReactionGaugeCarouselAvatar UploadPowerPoint ViewerHero HeaderGitHub ActivityColor Picker

and 326 more.

More React hooks and utilities

useClipboardhookuseConsenthookuseControllableStatehookuseCooldownhookuseDebouncehookuseKeyboardInsethook
All 36 React hooks and utilities

Articles using this component

  • shadcn Tailwind v4 Migration: Step by Step From v3

    Next.js and Tailwind CSS · Nov 6, 2026 · 10 min read

  • Tailwind v4 Nextjs 16 Setup: Config, Fonts and 5 Fixes

    Next.js and Tailwind CSS · Nov 6, 2026 · 9 min read

  • Claude Code Design System: Make 50 Screens Match

    Building UI with AI agents · Oct 16, 2026 · 12 min read

  • Next.js Component Library Setup for the App Router

    Next.js and Tailwind CSS · Oct 13, 2026 · 8 min read

PreviousTonesNext useClipboard
No provider
Outer provider: radius full, tone brand
Nested provider: size sm, merged with the outer one
locale
not set
reducedMotion
user
button defaults
radius, tone, size
Price in this locale
$1,249.50