Ant Design Svelte

ConfigProvider

General settings: locale, RTL, sizes, themes, component settings and containers.

When to use

ConfigProvider specifies general settings for the Svelte tree: theme, language, direction, size and design of components. Place it around an application or a separate area with its own settings. Nested providers allow sections and examples to be styled independently.

The provider passes the context to child components and creates a themed DOM wrapper. Local props of components specify common values; The rules for combining theme, locale and component config are different.

General settings and inheritance

Unspecified values ​​are inherited from the nearest provider. An explicit local size or disabled specifies the general componentSize/componentDisabled. direction specifies ltr/rtl, locale is a partial dictionary of components.

Problem Setting Example
Configure area size and availability componentSize, componentDisabled Size and Availability
Translate component signatures locale Locale
Change direction direction Direction
Isolate nested topic theme.inherit Inheritance and isolation
Set up a single family Component config Component Settings

The passed component config replaces the entire corresponding parent record. For example, a nested button does not automatically complete every field of an outer button. theme.token and locale use their own partial inheritance. Example settings shows local exceptions and record replacement.

Use ConfigProvider.modal to share classes and styles between declarative dialogs and context confirmations. Instance classes are added to the shared ones and local CSS is applied last. In the note editor example, both dialogs inherit the same spacing, and the editor lets you reduce it.

ConfigProvider.upload specifies the general class/style, classNames/styles, accept, customRequest and progress. Example Upload shows inheritance, empty nested record and local overrides. Local accept, including the empty string, and customRequest take precedence over general ones. Classes accumulate; The general slots CSS lines are applied before the local ones, the regular style applies to the trigger. Progress is merged across fields: a local empty object does not clear the overall progress. The new request handler is applied to the following files, the current request is saved. The full contract is described in Upload.

ConfigProvider.tree provides class/style and semantic classNames/styles for Tree and DirectoryTree. The Tree styling example demonstrates local callbacks and replacing nested configuration with tree={}. The internal TreeSelect tree does not inherit this record.

ConfigProvider.virtual sets a shared mode for Tree/DirectoryTree, TreeSelect, Listy, Select, and AutoComplete. Tree and TreeSelect use a window with nonzero height and row estimate; Listy defaults to raw mode. Select and AutoComplete enable virtualization by default. Grouped suggestions demonstrate inheritance. A local virtual=undefined enables default=true in Select/AutoComplete, while Tree/TreeSelect/Listy inherit the shared mode. Virtual tree.

ConfigProvider.form sets defaults labels, requiredMark, tooltip, semantic classNames/styles and scrollToFirstError. Local props Form take precedence. An empty nested form replaces the entire record; Form.tooltip separately combines global and local tooltip options. The size and disabled are set by the Form or the nearest ConfigProvider, not by the form-record fields. Example Form shows the application of semantic defaults.

Error templates are set via form.validateMessages on top of locale.Form.defaultValidateMessages. Local Form.validateMessages takes precedence, and rule.message has the highest priority. Nested provider groups are combined with the locale; the local Form group replaces the entire corresponding group. Example Form templates shows the difference.

For fields, the variant order is: local prop, closest Form.variant, component config, general ConfigProvider.variant, outlined. For InputPassword/InputSearch/InputOTP, after its own configuration, input.variant is checked. A nested Form without variant resets the variant of the outer Form. Card's local variant is limited to outlined/borderless; inherited filled/underlined retain the border.

Statistic, Steps and Timeline support their own records statistic/steps/timeline: class, style, classNames and styles. Local design takes precedence; a nested empty record replaces the ancestor's defaults. Statistic, Steps and Timeline show priorities. For Timeline, the root steps.class/style is saved, but not the semantic settings of Steps. The local prefixCls is set by the component itself; theme.cssVar.prefix does not replace it.

ConfigProvider.layout specifies only the class/style of Layout containers. The Header/Content/Footer and Sider sections do not receive records directly. The local style is applied after the general one; an empty nested layout replaces the entire record. Example Layout shows priorities and state saving when updating settings.

Ready-to-use dictionaries are available from @woodger/antd/locale. The language switching example imports the Chinese dictionary and changes the labels on a calendar, pagination and dialog.

General class prefix

Built-in icons use iconPrefixCls from the nearest provider. The default is anticon. This setting applies to Select, AutoComplete, TreeSelect, Cascader, CascaderPanel, Input and its variants, InputNumber, Form, Alert, Progress, Result, and the Button loading indicator. In the panels and Affix example, it changes the class prefix of the Alert icon.

ConfigProvider.prefixCls sets the base CSS prefix, ant by default. undefined and the empty string inherit the parent prefix. Currently connected are App, Layout, LayoutSider, LayoutHeader/Content/Footer, Statistic/Timer, QRCode, Steps, Timeline, Divider, Flex, Segmented, Avatar/AvatarGroup, Badge/BadgeRibbon, Tag/CheckableTag/CheckableTagGroup, Empty, Skeleton and its elements, Spin, Progress, Result, Alert, Collapse, Affix, Tooltip, Popover, Popconfirm, Slider, BorderBeam, Masonry, Splitter, Anchor, Space, SpaceCompact, SpaceAddon, Breadcrumb, Row, Typography, Carousel and Descriptions. For example, suite gives suite-app, suite-layout-header and suite-segmented. Other connected families and their prefix features are listed below.

A component's non-empty local prefixCls takes precedence and specifies the full class. For example, LayoutHeader prefixCls="region" gets region without adding a suffix. An empty local prop returns the fallback of the provider, and not necessarily the ant. Common prefix shows nested inheritance, local Sider, independent neighbor and draft/collapse saving.

Indicators and history shows Statistic/Timer, QRCode, Steps and Timeline. The internal Steps of Timeline separately inherits the common prefix: with suite and local Timeline.prefixCls="local-history" the root receives local-history and suite-steps. The Timeline local prefix does not rename Steps classes.

Layout and selection show Divider, Flex and Segmented. Empty nested provider and instance prefixCls inherit the parent prefix. Changing the general or local prefix preserves the selected value and radio DOM; by itself it does not call onChange. name Segmented preserves the current contract of the form: the native radio sends on, so the application value should be taken from bind:value or onChange.

Statuses and avatars show Avatar/Group, Badge/Ribbon, Tag/CheckableTag/Group, Empty, Skeleton with five independent elements, Spin, Progress and Result. For Badge, the local prefixCls does not change the ScrollNumber: it separately inherits the general prefix or scrollNumberPrefixCls. CSS ScrollNumber and Ribbon geometry follow a common provider prefix. Local prefixCls AvatarGroup does not rename members' Avatars.

Panels and Affix show Alert, Collapse and active pinning in an isolated scroll target. Changing the prefix preserves the expanded panels and editor DOM, its value, focus and selection. In SSR, the Affix remains in the thread, without an attachment class.

Popup and Slider show Tooltip, Popover, Popconfirm and single/range Slider. Slider tooltips separately inherit Tooltip prefix or tooltip.prefixCls; the local scale prefix does not affect them. The local Popconfirm.prefixCls changes the confirmation classes, and the external Popover separately inherits the common prefix. Software update preserves the DOM of the open popup, trigger and editor; a regular pointerdown outside the panel will still close it. In SSR, shells remain hidden without opening the popup and calling the container.

BorderBeam, Masonry and Splitter also share a local class and a common namespace of service geometry. The prefix of their service variables is taken from ConfigProvider.prefixCls without dots, regardless of the local prefixCls and theme.cssVar.prefix. The examples on the component pages show the same local classes in different scopes and preserve DOM, focus, and dimensions.

In Anchor, the missing item.prefixCls inherits the owner's prefix, and an explicit empty string selects the provider's prefix. With Space / Compact / Addon, each component selects a prefix independently; local Compact does not rename child cells and fields. Addon service variables use a common prefix without dots, separate from the theme's namespace.

Breadcrumb passes the allowed prefix to clauses and all separators, including type:separator. The local path prefix does not change the appearance of the individual Dropdown/Menu. Changing the general or local prefix preserves the links and the open menu.

Row changes row and layout state classes while maintaining responsive gutter and column context. Col also supports independent local prefixCls; responsive classes change, service variables use the common provider prefix without dots. All Typography variants select a prefix separately; actions and editor follow their text prefix, Tooltip follow their own settings. Changing the prefix preserves the active input and copy state.

Carousel changes the outer wrapper and progress animations, preserving the Slick classes. Nested Radio/Checkbox selectors depend on the global prefix provider, not the local Carousel.prefixCls or theme namespace. The current slide, editor and public ref are saved.

Descriptions passes the resolved prefix to all cells and the header, preserving the DOM, field and FormData. In the expanded Table row, styles respect the local Descriptions prefix separately from the general Table prefix; the example preserves an independent ant scope for Table.

Table inherits the common prefix with -table or the fully qualified local name prefixCls. Wrapper, rows, cells, sort and filter items use the table name; Checkbox, Button, Pagination and popup shell are their common prefixes. dropdownPrefixCls only changes the base name of the filter list with the addition of -menu. Changing names preserves the opened row and its editor, selection, page, open filter and scrolling. theme.components.Table, marker ant-table-css-var and namespace theme.cssVar.prefix are independent of the local class; The nested-border-top service variable uses a common prefix without dots.

Button, Tabs and Card support local and global prefixes. CardGrid/CardMeta without their own prop inherit Card; an empty line selects the provider. FloatButton similarly inherits Group. The owner local class does not rename individual Button, Input, or Typography.

Radio, Checkbox and Switch retain the values ​​and native controls. Group passes the base prefix to its options; arbitrary children choose it independently. Input and TextArea share a basic Input namespace; Password/Search have an independent inputPrefixCls, OTP has its own prefixCls. InputNumber, Mentions and Form are also connected. FormItem chooses a prefix regardless of Form; FormList.prefixCls styles the ErrorList. Media CSS Form respects the screen*max design tokens of its theme.

Rate, Listy, Tour and Image have examples of namespace changes. Image.previewPrefixCls - full viewer prefix; ImagePreviewGroup.previewPrefixCls is given a base name with automatic -preview. Nested Button/Tooltip and group thumbnails retain their own prefixes.

Dropdown, Menu, Pagination, Drawer and Modal support changing prefixes without resetting the open state. MessageHolder and NotificationHolder accept local prefixCls. In App the same settings are specified via message.prefixCls and notification.prefixCls, regardless of App.prefixCls. The confirmation prefix is ​​set in ModalConfirmConfig.

Upload/Dragger, Tree, Transfer, Select, AutoComplete and TreeSelect are also connected. AutoComplete's Select namespace changes, the nested editor is independent. TreeSelect resolves Select and TreeSelect namespaces from the same local prop, preserving the native Tree adapter.

Cascader and CascaderPanel use the common -select for field and the common -cascader for columns. A non-empty local prefixCls becomes the full prefix of both parts; search render gets the allowed Cascader prefix. The selected paths, editor and open popup are saved when the names are updated.

ColorPicker allows local prefix regardless of Popover, fields and preset groups. Nested Input/Select/InputNumber, Slider, Divider, Segmented and Collapse inherit the common provider prefix. Changing names preserves the incomplete HEX, color, and open panel; the native button and container operate in the same area.

Calendar shares a prefix with -picker; local prefixCls specifies the full base name of Picker, and the root appends -calendar. Cells and renderers follow this name, Select/Radio headers are an independent common prefix. Date with milliseconds, DOM and focus are preserved when names are updated.

DatePicker / RangePicker and TimePicker / TimeRangePicker use a common prefix with -picker or a fully qualified local name. Fields, popup, calendar and columns follow the name of their Picker; OK buttons independently inherit the Button prefix. Time cellRender.info.prefixCls and originNode use the resolved Picker name. Changing the prefix keeps the panel open and preserves input, selection and pending time, including in a controlled range. The prefix/suffix color service variable uses a common dotless prefix separate from theme.cssVar.prefix; canonical topic markers are preserved. Own prefixes work even without theme source settings: mode/primary/compact continue to design fields, panels and Calendar.

prefixCls classes and theme.cssVar.prefix are different settings. For a source theme, the fallback namespace follows the base prefix of the current provider. The inherited cssVar.prefix takes precedence over the new prefixCls; local cssVar.prefix - both. Explicit cssVar.prefix:undefined removes the inherited value and returns the fallback of the current scope, including when inherit=false. Without a local theme, the parent theme scope and namespace are preserved.

CSS variables show these priorities via theme.useToken().cssVar. In a tree without source theme settings, where only mode/primary/compact is used, namespace ant is saved. Canonical markers and --ant-* bridge are not renamed. Changing the common prefix preserves DOM controls, focus and values; SSR immediately receives the required classes and source variables.

Topic and reading tokens

theme.token specifies the initial and shared tokens. algorithm accepts an algorithm or a sequence of them; theme.defaultAlgorithm, theme.darkAlgorithm and theme.compactAlgorithm are available. Example Algorithms switches dark and compact design reactively.

Global theme.token.screen* controls the responsive column/span of Descriptions, like the Grid. The nested provider inherits the thresholds, inherit:false returns defaults. Changing tokens replaces media queries without remount; Before mount the fallback is saved in three columns. screenSMMin participates in order checking, request sm uses screenSM; incorrect boundary order is rejected already with SSR.

The same tokens control responsive for Pagination and columns/both gutter axes for Masonry. Pagination uses screenXSMax without explicitly setting size or componentSize; mini class does not guarantee lower height. In Masonry, if there is no match, columns falls back to xs or one column, and gutter is resolved separately. Changing tokens preserves the DOM and state; inheritance and inherit:false apply here too. The rules apply to the theme's Source engine being enabled; normal mode uses standard boundaries.

theme.components specifies settings for specific families. Check the help section of each component token page for support: the porting of token usage to CSS is still in progress. The component config object and theme.components solve different problems: the first one sets props/defaults, the second one sets design tokens.

When theme.inherit=false, parent tokens, algorithms and components are reset. locale, direction and componentSize retain their normal inheritance. hashed, cssVar and zeroRuntime have separate inheritance; inherit=false does not automatically reset them.

theme.useToken when initializing a child component under the desired provider. ConfigProvider in the markup of the same component does not change the context of an already executed script. Therefore the example uses a separate TokenReadout. Read result fields in markup or $derived to maintain reactivity.

theme.getDesignToken performs a static calculation based on the passed settings and does not change the theme of the page. Static calculation shows it separately from the contextual useToken.

Style nonces

If the server sets a Content-Security-Policy with a per-response nonce, pass the same value to csp during SSR and hydration. The library adds it to the <style> elements it creates for themes, CSS class prefixes and dialog scroll locking inside a ShadowRoot.

<script lang="ts">
  import { Button, ConfigProvider } from '@woodger/antd';

  let { nonce }: { nonce: string } = $props();
</script>

<ConfigProvider csp={{ nonce }} prefixCls="docs">
  <Button type="primary">OK</Button>
</ConfigProvider>

A nested provider inherits csp when the prop is omitted or undefined. Passing csp={{}} clears the inherited nonce. Changing the value replaces the style elements and preserves focus. The application sets the policy for bundled stylesheets and style attributes.

Containers, empty states and holders

popupMatchSelectWidth sets the shared popup width for Select, AutoComplete and TreeSelect. A value of true matches the control width, false fits the content, and a number sets the width in px. The control width remains the minimum. An omitted prop or undefined inherits the parent; without a shared setting, true is used. Shared popup width demonstrates inheritance, a nested true reset and local prop precedence.

Cascader uses its local popupMatchSelectWidth. Pagination passes a local false by default, but showSizeChanger settings can override it. Calendar inherits the shared width while retaining its menus in the header. ColorPicker gives its internal Select a local width of 68 px and its own container.

popupOverflow sets the overflow calculation region for Select, TreeSelect, Cascader and AutoComplete: PopupOverflow = 'viewport' | 'scroll'. The default is viewport; an omitted prop or undefined inherits the parent, while an explicit viewport resets scroll. scroll mode uses the document region, while vertical shifting still considers the visible area. It does not select the nearest scroll container.

Popup overflow region demonstrates four controls under a nested provider. Changing the mode preserves DOM, values and focus; coordinates update on the next opening, resize or scroll, rather than on the prop change alone. The setting also affects nested Select controls inside other components. It does not change the popups of Tooltip, DatePicker or Mentions, or the inline CascaderPanel.

GetPopupContainer selects a container from connected consumers; local configuration of the component takes precedence. Getter may receive a missing trigger, so be aware of this in your own code. Use DOM inside the browser callback, and not during SSR initialization. Moving to ShadowRoot by itself does not deliver the CSS there.

Nested lists, table filters, tooltips and dialogs take the parent panel’s layer into account. The Drawer example sets zIndex on the parent, and the Select list opens above the child. getPopupContainer still chooses the DOM container.

GetTargetContainer sets the scrollable area of ​​an HTMLElement or Window for an Affix/Anchor. This is a separate setting, not a popup container. Scroll area and popup container are shown independently.

RenderEmpty is a regular function that returns the text or snippet of an empty state given the consumer name. General empty state shows application to supported components.

Place MessageHolder and NotificationHolder under the provider whose theme and locale they should use. In the container example, getContainer mounts the list outside the provider while keeping its text color. Use ConfigProvider.message for shared message styles.

Set the shared close icon and card styles with ConfigProvider.notification. notification styling example.

ConfigProvider.app specifies the class/style of the App wrapper. Its own record, including {}, replaces the entire parent one; local style App takes precedence. For the general message/notification/modal API, place the App under the ConfigProvider and call useApp when its child component is initialized. This is an alternative to manually connecting individual holders.

Configure static dialogs

Modal.confirm() opens a dialog in a separate root. To share the current theme and language, call ConfigProvider.config({ holderRender }) once when the app mounts. The holderRender snippet receives the dialog content and calls {@render content()} inside your ConfigProvider. By default, the dialog opens in document.body. It keeps the provider’s colors even when you choose a different mount node with getContainer. The static confirmation example uses this setup.

The global configuration also accepts prefixCls, iconPrefixCls and theme. The Modal method captures the wrapper when called and reads the prefixes and theme when rendering. If a section owns the wrapper, pass holderRender: undefined when leaving the section to clear it for future dialogs.

Examples

Size and Availability

General defaults and local exceptions size/disabled.

Нет данных

Locale ConfigProvider

Window buttons use the current provider locale.

Locale

Switch the calendar, pagination and dialog between Russian, English and Chinese.

Direction

LTR and RTL for child controls.

primary: #389e0d; radius: 12; height: 32; background: #ffffff

Theme algorithms

Light/dark theme, compact and reactive theme.useToken.

primary: #389e0d; radius: 12; height: 32; background: #ffffff
primary: #d48806; radius: 12; height: 32; background: #ffffff
primary: #722ed1; radius: 6; height: 32; background: #ffffff

Inheritance and isolation

Nested token overrides and resetting the parent theme via inherit=false.

General and local settings

sample.txt
sample.txt: uploading Waiting mount

Inherited Dragger

Click or drag the file

sample.txt
sample.txt: uploading Waiting mount

Empty nested record

sample.txt
sample.txt: uploading Waiting mount
No requests Expect: 0 No cancellations

Sample.txt - sample band with 42%. New files are processed locally: Click End Requests. In the reset scope, beforeUpload returns false to avoid running the standard XHR.

An empty upload inherits the entire record; an empty nested record replaces it. The classes are accumulated, local CSS lines are applied after the general ones. Progress is merged across fields: an empty local object stores the overall progress. Changing customRequest affects the following files, current requests continue; hiding Upload cancels incomplete ones.

General settings Upload

UploadConfig for Upload and Dragger: inheritance, empty record, local overrides and serverless transport.

Component settings

Button/Input config, priority of local props and replacement of nested record.

General design option

Global variant, component config, Form and local props; nested provider saves component config.

Component tokens

Button tokens are set separately from the general tokens of the neighboring Input.

primary: #d48806; background: #ffffff

Static calculation

theme.getDesignToken calculates the palette and does not change the page context.

General empty state

RenderEmpty return snippet; local empty Table takes precedence.

Popup container

GetPopupContainer provider and explicit local Tooltip override.

Select

TreeSelect

Cascader

AutoComplete

Popup overflow region

Viewport uses the visible area; scroll uses the document region. Compare the modes near the bottom of the window, reopening the control. A nested viewport resets an inherited scroll.

Select

AutoComplete

TreeSelect

Select (240 px)

Shared popup width

Select, AutoComplete and TreeSelect inherit popupMatchSelectWidth. A nested true restores the control width; a local 240 on Select takes precedence.

In the stream

Scroll area

Affix inherits getTargetContainer. Local geometry is isolated from the site menu.

Click the button to compare effects.

Wave Setting

Disable, standard effect and custom showEffect with animation cleanup.

Message context

MessageHolder is located inside the provider; React static functions are not used.

Region suite
Sections inherit a common prefix.
Empty prefixCls inherits suite.
The adjacent area retains ant.
suite; Revealed; Sider: local-panel

Input does not yet inherit the common prefixCls and retains its classes. Supported families are listed in the description above.

General class prefix

App/Layout, local Sider priority, empty prefix and independent neighbor; changing classes saves the draft and collapse.

Applications
1,280
Until 2100
-
  1. Finished
  2. In progress
  3. Waiting
  1. Received
    Application accepted
  2. Verified
    Documents are ready
Independent indicator
1,280
suite; current stage: 1

Local prefixCls Timeline changes its classes. Inner Steps separately inherits suite-steps.

Prefix of indicators and history

Statistic/Timer, QRCode, Steps and Timeline inherit a common prefix. The local Timeline does not change the internal Steps prefix.

week; events: 0
DayWeek

Empty prefixCls of nested provider and Divider inherit suite. Changing classes retains the Segmented selection.

Layout and selection prefix

Divider, Flex and Segmented: Nested Inheritance, Local Precedence and Selected Period Retention.

ApplicationsCount: 5
Tape inherits suite-ribbon.
Ready
New
No applications yet
Loading…
Chart
60%

Check completed

suite; counter: 5; verified

Local Badge changes its namespace, and ScrollNumber inherits separately suite-scroll-number. Ribbon geometry CSS follows a common prefix.

Prefix of statuses and avatars

Avatar/Group, Badge/Ribbon, Tag, Empty, Skeleton and its elements, Spin, Progress and Result. ScrollNumber inherits a common prefix separate from Badge.

suite; in stream; draft: empty

Panel prefix and Affix

Alert, Collapse and fixed Affix. Changing classes preserves the expanded panels, draft, and local scroll area.

suite; number: 30; range: [25, 75]; confirmations: 0

Tooltip Slider inherits a common prefix separate from the scale. Local Popconfirm changes confirmation classes; its external Popover inherits suite-popover.

popup and Slider prefix

Tooltip, Popover, Popconfirm and single/range Slider. Internal Tooltip and Popover inherit a common prefix regardless of the owner.

Parent: var(--base-vars-font-size)

Reset theme: var(--base-vars-font-size)

Explicit prefix: var(--local-vars-font-size)

Without local theme: var(--base-vars-font-size)

The inherited cssVar.prefix is preserved even when inherit=false. Explicit undefined returns the fallback of the current provider - inner.

Prefix and CSS variables

Inheritance namespace, inherit=false, explicit prefix and undefined. Two files: PrefixVariables.svelte and PrefixVariableReadout.svelte.

API

Child components read settings from the nearest ConfigProvider.

Official page themes
ThemeExample or limitation
LocaleReady-to-use component dictionaries.
DirectionDirection of child components.
popupOverflowOverflow calculation regions for Select, TreeSelect, Cascader and AutoComplete; inheritance and an explicit viewport.
popupMatchSelectWidthShared width for Select, AutoComplete and TreeSelect; nested providers and local precedence.
Component sizeSize and disabled with local exceptions.
VariantGeneral design option, component settings and Form priority.
ThemeAlgorithms, general and component tokens, nested topics.
Custom WaveWaveConfig.disabled/showEffect and lifecycle animations.
Static functionConfigProvider.config sets the appearance of static Modal dialogs.
Content Security PolicyPass the nonce from the document policy to component styles.
ConfigProvider.useConfig()Call ConfigProvider.useConfig() during child component initialization and read the reactive componentSize and componentDisabled from the returned object.
Component ConfigPublished component settings.
Component prefixClsGeneral prefix App/Layout, local priority and independent areas.
Display component prefixClsInheritance Statistic/Timer, QRCode, Steps and Timeline; independent prefix of internal Steps.
Layout and selection prefixClsInherit Divider, Flex and Segmented without resetting selection.
Status component prefixClsAvatar/Group, Badge/Ribbon, Tag, Empty, Skeleton, Spin, Progress and Result; independent ScrollNumber.
Panel and Affix prefixClsAlert, Collapse and active Affix; saving the editor and opened panels.
Popup and Slider prefixClsTooltip, Popover, Popconfirm and single/range Slider; independent prefixes of internal popups.
CSS variable prefixInheritance of cssVar.prefix and fallback of the current provider.

General parameters ConfigProvider

PropertyDescriptionTypeDefault
iconPrefixClsCSS class prefix for built-in icons. An empty value inherits the nearest provider's prefix.stringanticon
childrenChild tree to which the context is available.Snippetis required
prefixClsThe base CSS prefix of the connected families listed in the Common Class Prefix section. The remaining families are connected separately. undefined/empty string inherit parent; non-empty local prefixCls of the component takes precedence.stringparent/ant
componentSizeThe total size of the controls that support it. Local size and Compact take precedence.small | medium | largeparent / medium
componentDisabledGeneral disabling of controls; local disabled specifies the meaning.booleanparent / false
variantoutlined, filled, borderless or underlined. Local variant, nearest Form.variant and component config take precedence.Variantparent / outlined
directionDirection of layout and child components.ltr | rtlparent/ltr
localeA ready-to-use @woodger/antd/locale dictionary or partial component settings.Partial<Locale> | AntDesignLocaleparent / ruRU
themeTokens, algorithms and component topic.ThemeConfigparent theme
cspSets the nonce on styles created by the library. Nested providers inherit this setting.CSPConfig—
getPopupContainerContainer supported popup. Callback is called in the browser; triggerNode may be missing.(triggerNode?) => HTMLElement | ShadowRootparent/body
getTargetContainerGeneral Affix/Anchor scroll area. Local target/getContainer takes precedence.() => HTMLElement | Windowparent/window
popupOverflowOverflow calculation region for Select, TreeSelect, Cascader and AutoComplete. undefined inherits the mode; an explicit viewport resets scroll. The DOM container is retained, and coordinates update on the next alignment.PopupOverflowparent / viewport
popupMatchSelectWidthShared popup width for Select, AutoComplete and TreeSelect. undefined inherits the value; a local component prop takes precedence. Cascader uses its own prop.boolean | numberparent / true
renderEmptyProducer of empty state, including snippet. Support and fallback depend on the component.(componentName?) => RenderEmptyContentparent/Empty
virtualShared virtual setting for Tree/DirectoryTree, TreeSelect, Listy, Select and AutoComplete.booleanparent / no common meaning
classProvider div class.string—
styleCSS root after calculated CSS variables.string—

ConfigProvider.config()

PropertyDescriptionTypeDefault
holderRenderWraps the dialog opened by a static method.Snippet<[content: Snippet]>—
prefixClsClass prefix for components in the separate root.stringant
iconPrefixClsClass prefix for the built-in confirmation icon.stringanticon
themeTheme for the separate root of static dialogs.ThemeConfig—

ThemeConfig

PropertyDescriptionTypeDefault
tokenSeed overrides participate in algorithms; aliases overlap the calculated values.Partial<AliasToken>parent / defaultSeed + algorithms
algorithmAlgorithms are executed in array order; default/dark/compact are available.MappingAlgorithm | readonly MappingAlgorithm[]parent/defaultAlgorithm
componentsOverrides selected components. The connection of specific tokens is determined by the implementation of the family.ComponentsConfigparent configuration
inheritfalse resets parent tokens/algorithms/components, but not the entire ConfigProvider.booleantrue
hashedfalse returns an empty hashId. It is not an application's custom CSS isolation.booleantrue
cssVarNamespace CSS variables. The inherited prefix takes precedence over the new prefixCls, the local cssVar.prefix takes precedence over both; explicit undefined returns the fallback of the current provider.{prefix?: string; key?: string}theme/provider prefix; key area
zeroRuntimeThe source theme setting is inherited; the package's published CSS remains required.booleanparent / false
modeCompatible shorthand theme Svelte.light | darkparent/light
primaryCompatible presets. Set an arbitrary color using token.colorPrimary.blue | purple | greenparent/blue
compactCompatible shorthand compact metrics.booleanparent / false

WaveConfig

PropertyDescriptionTypeDefault
disabledDisable wave effect.booleanfalse
showEffectOwn animation; the created resources are released by the owner of the callback.ShowWaveEffectstandard effect
triggerTypeEvent that triggers a wave.click | pointerdown | pointerup | mousedown | mouseupclick

Component settings

upload: UploadConfig sets class/style, classNames/styles, accept, customRequest and progress for Upload/Dragger. The nested upload-record is replaced entirely; local classes are accumulated with general ones, CSS lines are applied after the general ones. Progress is combined by fields. Example shows nested areas and serverless transport.

Nested records set the defaults of the corresponding components. The published keys are listed below; specific options are described on the family page and package types.

KeyPurpose
appclass/style wrapper App. Record replaces the entire parent; local style takes precedence.
layoutOnly class/style containers Layout; sections and Sider do not receive record directly.
statisticclass/style and object or functional classNames/styles Statistic and StatisticTimer.
stepsclass/style and object or functional classNames/styles Steps.
timelineclass/style and object or functional classNames/styles Timeline.
formCaptions, requiredMark, tooltip, class/style, semantic defaults, validateMessages and scrollToFirstError.
buttonAppearance, shape, semantic defaults and autoInsertSpace.
inputvariant, allowClear and semantic defaults.
inputPasswordInputPassword settings.
inputSearchInputSearch settings.
otpInputOTP settings.
textAreaTextArea settings.
inputNumberNumber field settings.
selectShared variant, class/style, classNames/styles, showSearch and icons for Select/AutoComplete. Only Select inherits boolean or object allowClear.
treeTreeConfig: class/style and five semantic slots for Tree/DirectoryTree. TreeSelect does not inherit this configuration.
treeSelectOnly variant of the selection tree.
mentionsField variant, clear button, classes and styles for the root and individual parts of Mentions.
checkboxGeneral class/style and semantic defaults.
radioGeneral class/style and semantic defaults.
switchGeneral class/style and semantic defaults.
sliderScale settings and semantic defaults.
colorPickerPalette and popup settings.
datePickerOnly variant of single DatePicker.
rangePickerRangePicker and TimeRangePicker settings.
timePickerTime settings.
cascaderCascader/Panel settings.
transferTransfer list settings.
rateEvaluation settings.
segmentedOption switch settings.
spacesize, class/style and semantic defaults Space.
dividerSeparator settings.
flexFlex Settings.
masonryMasonry Settings.
splitterSettings for split panels.
affixclass/style of external Affix node.
paginationPagination and semantic defaults settings.
tableShared row keys, scrolling, styling, and expansion toggle.
drawerBackdrop, focus, close button and styling for individual panel elements.
modalBackdrop, focus, alignment, dialog styling, buttons and confirmation icons.
messageShared classes and styles for the message list, icons and text.
notificationShared notification classes, styles and close icon.
tabsTabs and semantic defaults settings.
tooltipTooltip and popup settings.
popoverPopover and popup settings.
popconfirmConfirmation and popup settings.
badgeBadge Settings.
ribbonBadgeRibbon Settings.
avatarAvatar Settings.
cardvariant, class/style and object or functional classNames/styles Card.
cardMetaclass/style and object or functional classNames/styles CardMeta.
descriptionsclass/style and object or functional classNames/styles Descriptions.
anchorclass/style and object or functional classNames/styles Anchor.
tagTag Settings.
typographyText settings and semantic defaults.
calendarCalendar settings.
carouselCarousel Settings.
collapseCollapse and semantic defaults settings.
listyListy settings, including virtual.
tourTour settings; the global popup container is not inherited by it.
floatButtonSettings for a separate floating button.
floatButtonGroupSettings for a group of floating buttons.
qrcodeQRCode settings.
watermarkWatermark settings.
borderBeamclass/style of decorative layers.
spinSpin settings.
progressProgress settings.
uploadUploadConfig: class/style, semantic slots, accept, customRequest and progress for Upload/Dragger. The nested record is replaced entirely.
skeletonSkeleton settings.
emptyEmpty settings.
resultSettings Result.
alertAlert settings.

Semantic DOM

Named semantic slots are not published. ConfigProvider creates div.ant-svelte-theme with dir, theme classes, data-ant-theme, data-ant-primary and CSS variables. class/style refers to this root. The wrapper does not change the semantics of child controls.

The context follows the Svelte component tree. For popup, supported components retain their theme when wrapping the DOM; getPopupContainer itself does not replace the context.

Registration tokens

ConfigProvider does not have its own component tokens. theme.token sets general values, theme.components — overrides of individual families. theme.useToken returns a reactive token/theme/hashId/cssVar object. The values ​​of the current page topic are shown below.

TokenMeaning
colorPrimary#2f54eb
colorPrimaryHover#597ef7
colorBgContainer#ffffff
colorTextrgba(0,0,0,0.88)
fontSize14
lineHeight1.5714285714285714
controlHeight32
borderRadius6
padding16
margin16

FAQ

How is variant selected?

Local prop takes precedence over the nearest Form, component config and general variant. The detailed order and features of the nested Form are described in the general settings section.

How are settings inherited?

Unspecified values are taken from the parent. The passed component config replaces the entire corresponding record; theme and locale have separate partial inheritance rules.

Where to call theme.useToken?

In the child Svelte component under the required ConfigProvider. The provider below in markup does not change the script context of its parent component.

How is getDesignToken different from useToken?

The first one calculates tokens statically, the second one reads the immediate context. Static calculation does not change the page design.

Do I need to switch the Dayjs global locale?

The component dictionary is specified by the provider locale. Localized operations and Day.js plugins outside of controls are configured separately; The date model remains Dayjs.

How do popup and scroll containers work?

GetPopupContainer changes the container of the supported popup, getTargetContainer changes the Affix/Anchor scroll area. Local settings take precedence, callbacks are executed in the browser.

How to use messages and confirmations?

Use App.useApp() for messages and context confirmations. For a standalone dialog, use Modal.confirm() and the static dialog settings.

Are all parameters of the official ConfigProvider already supported?

The API table lists the supported properties.

Are there separate tokens and Semantic DOM slots provider?

There are no own component tokens and classNames/styles. The provider creates a theme wrapper with dir and class/style and passes in common CSS variables and context.