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.
<script lang="ts">
import { Button, Checkbox, ConfigProvider, Input, RadioGroup } from '@woodger/antd';
import type { ComponentSize } from '@woodger/antd';
let size = $state<ComponentSize>('medium');
let disabled = $state(false);
let value = $state(("Documentation"));
</script>
<style>
.settings {
display: grid;
gap: 16px;
margin-bottom: 24px;
}
.controls {
display: grid;
gap: 16px;
}
.actions {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
</style>
<div class="settings">
<RadioGroup aria-label={("Total size of ConfigProvider")} bind:value={size}
options={(['small', 'medium', 'large'])} />
<Checkbox bind:checked={disabled}>{("Disable nested controls")}</Checkbox>
</div>
<ConfigProvider componentSize={size} componentDisabled={disabled}>
<div class="controls">
<Input aria-label={("General settings field")} bind:value />
<div class="actions">
<Button type="primary">{("General size button")}</Button>
<Button size="small" disabled={false}>{("Local exception")}</Button>
</div>
</div>
</ConfigProvider>
Locale
Switch the calendar, pagination and dialog between Russian, English and Chinese.
<script lang="ts">
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn.js';
import zhCN from '@woodger/antd/locale/zh_CN';
import { Button, ConfigProvider, DatePicker, Empty, Modal, Pagination, RadioGroup, enUS, ruRU }
from '@woodger/antd';
const locales = { ru: ruRU, en: enUS, zh: zhCN };
let language = $state<keyof typeof locales>('ru');
let open = $state(false);
</script>
<style>
.settings { margin-bottom: 24px; }
.controls {
display: grid;
gap: 16px;
}
</style>
<div class="settings">
<RadioGroup aria-label={("Language ConfigProvider")} bind:value={language}
options={([
{ value: 'ru', label: "Russian" },
{ value: 'en', label: 'English' },
{ value: 'zh', label: '简体中文' }
])} />
</div>
<ConfigProvider locale={locales[language]}>
<div class="controls">
<DatePicker aria-label={("Date with provider locale")}
defaultPickerValue={dayjs('2026-11-06')} />
<Pagination total={30} aria-label={("Pagination with provider locale")} />
<Empty image="simple" />
<Button onclick={() => { open = true; }}>{("Open window with locale")}</Button>
</div>
<Modal title={("Locale ConfigProvider")} bind:open>
<p>{("Window buttons use the current provider locale.")}</p>
</Modal>
</ConfigProvider>
Direction
LTR and RTL for child controls.
<script lang="ts">
import { ConfigProvider, Input, Pagination, RadioGroup } from '@woodger/antd';
let direction = $state<'ltr' | 'rtl'>('ltr');
</script>
<style>
.settings { margin-bottom: 24px; }
.controls {
display: grid;
gap: 16px;
}
</style>
<div class="settings">
<RadioGroup aria-label={("Direction ConfigProvider")} bind:value={direction}
options={(['ltr', 'rtl'])} />
</div>
<ConfigProvider {direction}>
<div class="controls">
<Input aria-label={("Field with provider direction")} defaultValue="Svelte" />
<Pagination total={50} aria-label={("Pagination with provider direction")} />
</div>
</ConfigProvider>
Theme algorithms
Light/dark theme, compact and reactive theme.useToken.
Theme.svelte<script lang="ts"> import { Button, Checkbox, ConfigProvider, Input, theme } from '@woodger/antd'; import TokenReadout from './TokenReadout.svelte'; let dark = $state(false); let compact = $state(false); const algorithms = $derived([ dark ? theme.darkAlgorithm : theme.defaultAlgorithm, ...(compact ? [theme.compactAlgorithm] : []) ]); </script> <style> .settings { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; } .surface { display: grid; gap: 16px; padding: 16px; border-radius: 8px; background: var(--ant-color-bg-container); } </style> <div class="settings"> <Checkbox bind:checked={dark}>{("Provider dark algorithm")}</Checkbox> <Checkbox bind:checked={compact}>{("Compact provider algorithm")}</Checkbox> </div> <ConfigProvider theme={{ inherit: false, mode: dark ? 'dark' : 'light', algorithm: algorithms, token: { colorPrimary: '#389e0d', borderRadius: 12 } }}> <div class="surface"> <Input aria-label={("Thematic provider field")} defaultValue="Собственная тема" /> <Button type="primary">{("Apply theme")}</Button> </div> <TokenReadout /> </ConfigProvider>TokenReadout.svelte<script lang="ts"> import { theme } from '@woodger/antd'; let { label = "Nested provider tokens" }: { label?: string } = $props(); const result = theme.useToken(); </script> <style> output { display: block; margin-top: 16px; overflow-wrap: anywhere; font-size: 12px; } </style> <output aria-label={(label)}> primary: {(result.token.colorPrimary)}; radius: {(result.token.borderRadius)}; height: {(result.token.controlHeight)}; background: {(result.token.colorBgContainer)} </output>
Inheritance and isolation
Nested token overrides and resetting the parent theme via inherit=false.
Nested.svelte<script lang="ts"> import { Button, ConfigProvider } from '@woodger/antd'; import TokenReadout from './TokenReadout.svelte'; </script> <style> .layers { display: grid; gap: 24px; } </style> <ConfigProvider theme={{ inherit: false, token: { colorPrimary: '#389e0d', borderRadius: 12 } }}> <div class="layers"> <div> <Button type="primary">{("Parent theme")}</Button> <TokenReadout label={("Parent tokens")} /> </div> <ConfigProvider theme={{ token: { colorPrimary: '#d48806' } }}> <Button type="primary">{("Legacy theme")}</Button> <TokenReadout label={("Legacy tokens")} /> </ConfigProvider> <ConfigProvider theme={{ inherit: false, token: { colorPrimary: '#722ed1' } }}> <Button type="primary">{("Isolated theme")}</Button> <TokenReadout label={("Isolated tokens")} /> </ConfigProvider> </div> </ConfigProvider>TokenReadout.svelte<script lang="ts"> import { theme } from '@woodger/antd'; let { label = "Nested provider tokens" }: { label?: string } = $props(); const result = theme.useToken(); </script> <style> output { display: block; margin-top: 16px; overflow-wrap: anywhere; font-size: 12px; } </style> <output aria-label={(label)}> primary: {(result.token.colorPrimary)}; radius: {(result.token.borderRadius)}; height: {(result.token.controlHeight)}; background: {(result.token.colorBgContainer)} </output>
General and local settings
Inherited Dragger
Empty nested record
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.
ProviderUpload.svelte<script lang="ts"> import { Button, Checkbox, ConfigProvider, Input, type UploadConfig, type UploadProps, type UploadRequestOptions } from '@woodger/antd'; import ProviderUploadScope from './ProviderUploadScope.svelte'; let localRequest = $state(false); let localStyles = $state(true); let clearAccept = $state(false); let wide = $state(false); let mounted = $state(true); let progressMode = $state('inherit'); let draft = $state(("Note next to provider")); let requests = $state<string[]>([]); let aborted = $state<string[]>([]); let pending = $state.raw<{ source: string; options: UploadRequestOptions; active: boolean; }[]>([]); function transport(source: string): NonNullable<UploadProps['customRequest']> { return options => { const job = { source, options, active: true }; pending = [...pending, job]; requests.push(`${source}: ${options.file.name}`); options.onProgress?.({ percent: 30 }); return { abort: () => { job.active = false; pending = pending.filter(entry => entry !== job); aborted.push(`${source}: ${options.file.name}`); } }; }; } const providerRequest = transport('provider'); const ownRequest = transport('local'); const shared = $derived<UploadConfig>({ accept: '.txt', class: 'provider-upload-record', classNames: { root: 'provider-upload-root', item: 'provider-upload-item' }, styles: { root: ` display: block; min-width: 0; padding: 12px; border: 1px solid var(--ant-color-primary); border-radius: 8px; `, item: 'min-height:36px', trigger: 'padding-top:6px' }, style: 'padding-top:10px', progress: { size: [-1, wide ? 7 : 5], showInfo: true, strokeColor: '#d46b08' }, customRequest: providerRequest }); const localProgress = $derived.by<UploadProps['progress']>(() => { if (progressMode === 'empty') { return {}; } if (progressMode === 'hide') { return { showInfo: false }; } if (progressMode === 'thick') { return { size: [-1, 9] }; } return undefined; }); const local = $derived<UploadConfig>({ accept: clearAccept ? '' : undefined, customRequest: localRequest ? ownRequest : undefined, classNames: localStyles ? { root: 'local-upload-root', item: 'local-upload-item' } : {}, styles: localStyles ? { root: 'padding-top:8px', trigger: 'padding-top:14px' } : {}, progress: localProgress }); function complete() { const jobs = pending; pending = []; for (const job of jobs) { if (!job.active) { continue; } job.active = false; job.options.onSuccess?.({ source: job.source }); } } </script> <style> .example, .scopes { display: grid; gap: 20px; min-width: 0; } .controls { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; } label { display: grid; gap: 6px; min-width: 0; } select { max-width: 100%; padding: 4px 8px; border: 1px solid var(--ant-color-border); border-radius: 6px; background: var(--ant-color-bg-container); color: var(--ant-color-text); font: inherit; } p { margin: 0; } output { overflow-wrap: anywhere; } </style> <div class="example"> <div class="controls"> <Checkbox bind:checked={localRequest} >{("Local customRequest first Upload")}</Checkbox> <Checkbox bind:checked={localStyles} >{("Local styles of the first Upload")}</Checkbox> <Checkbox bind:checked={clearAccept}>{("Empty local accept")}</Checkbox> <Checkbox bind:checked={wide}>{("Increase overall progress")}</Checkbox> <Checkbox bind:checked={mounted}>{("Show Upload with settings")}</Checkbox> <label>{("Local progress of the first Upload\n ")}<select bind:value={progressMode} > <option value="inherit" >{("Inherit")}</option> <option value="empty" >{("Empty object")}</option> <option value="hide"> {("Without label")} </option> <option value="thick"> {("Thickness 9px")} </option> </select> </label> </div> <Input aria-label={("Note next to ConfigProvider.upload")} bind:value={draft} /> <ConfigProvider upload={shared}> {#if mounted} <div class="scopes"> <ProviderUploadScope id="local" title={("General and local settings")} overrides={local} /> <ConfigProvider> <ProviderUploadScope id="inherited" title={("Inherited Dragger")} dragger /> </ConfigProvider> <ConfigProvider upload={{}}> <ProviderUploadScope id="reset" title={("Empty nested record")} manual /> </ConfigProvider> </div> {/if} </ConfigProvider> <Button disabled={pending.length === 0} onclick={complete} >{("End requests")}</Button> <output aria-label={("Requests ConfigProvider.upload")}>{(requests.join('; ') || ("No requests"))}</output> <output aria-label={("Pending Upload requests")} >{("Expect: ")}{(pending.length)}</output> <output aria-label={("Canceled Upload requests")}>{(aborted.join('; ') || ("No cancellations"))}</output> <p> {("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.")} </p> <p> {("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.")} </p> </div>ProviderUploadScope.svelte<script lang="ts"> import { untrack } from 'svelte'; import { Button, Upload, UploadDragger, type UploadConfig, type UploadFile } from '@woodger/antd'; let { id, title, overrides = {}, manual = false, dragger = false }: { id: string; title: string; overrides?: UploadConfig; manual?: boolean; dragger?: boolean; } = $props(); let files = $state.raw<UploadFile[]>(untrack(() => [ { uid: `${id}-sample`, name: 'sample.txt', status: 'uploading', percent: 42, 'aria-label': `Progress sample: ${title}` } ])); let root = $state<HTMLSpanElement>(); let input = $state<HTMLInputElement>(); </script> <style> section { display: grid; gap: 12px; min-width: 0; padding: 12px; border: 1px solid var(--ant-color-border-secondary); border-radius: 8px; } h4, p { margin: 0; } .widget { min-width: 0; padding-bottom: 24px; } output { overflow-wrap: anywhere; } </style> <section aria-label={(title)}> <h4>{(title)}</h4> <div class="widget"> {#if dragger} <UploadDragger {...overrides} fileList={(files)} bind:nativeElement={root} bind:inputElement={input} beforeUpload={() => manual ? false : undefined} onChange={info => { files = info.fileList; }}> <p>{("Click or drag the file")}</p> </UploadDragger> {:else} <Upload {...overrides} fileList={(files)} bind:nativeElement={root} bind:inputElement={input} beforeUpload={() => manual ? false : undefined} onChange={info => { files = info.fileList; }}> <Button>{("Select file")}</Button> </Upload> {/if} </div> <output aria-label={("Files: " + String((title)) + "")}> {files.map(file => `${file.name}: ${file.status ?? "without sending"}`).join('; ')} </output> <output aria-label={("DOM: " + String((title)) + "")}>{(root && input ? "Connected" : "Waiting mount")}</output> </section>
Component settings
Button/Input config, priority of local props and replacement of nested record.
<script lang="ts">
import { Button, ConfigProvider, Input } from '@woodger/antd';
let value = $state(("Can be cleaned"));
</script>
<style>
.controls {
display: grid;
gap: 16px;
}
</style>
<ConfigProvider button={{ class: 'provider-button', style: 'font-weight: 700' }}
input={{ variant: 'filled', allowClear: true }}>
<div class="controls">
<Button>{("General Button settings")}</Button>
<Button style="font-weight: 400">{("Local Style Button")}</Button>
<Input aria-label={("Input with common variant")} bind:value />
<ConfigProvider button={{ class: 'nested-provider-button' }}>
<div class="controls">
<Button>{("Nested settings")}</Button>
<Input
aria-label={("Input inherits neighboring setting")}
defaultValue="filled сохранён"
/>
</div>
</ConfigProvider>
</div>
</ConfigProvider>
General design option
Global variant, component config, Form and local props; nested provider saves component config.
<script lang="ts">
import {
Checkbox,
ConfigProvider,
Form,
Input,
RadioGroup,
Select,
createForm
} from '@woodger/antd';
import type { Variant } from '@woodger/antd';
let variant = $state<Variant>('filled');
let local = $state(false);
const form = createForm({ initialValues: {} });
const options = [{ value: 'anna', label: "Anna" }, { value: 'boris', label: "Boris" }];
</script>
<style>
.settings, .examples {
display: grid;
gap: 20px;
}
.settings { margin-bottom: 24px; }
label {
display: grid;
gap: 8px;
}
</style>
<div class="settings">
<RadioGroup aria-label={("General variant ConfigProvider")} bind:value={variant}
options={(['outlined', 'filled', 'borderless', 'underlined'])}
style="
display: flex;
flex-wrap: wrap;
gap: 8px;
" />
<Checkbox bind:checked={local}>{("Local outlined inside Form")}</Checkbox>
</div>
<ConfigProvider {variant} select={{ variant: 'underlined' }}>
<div class="examples">
<label>{("General variant\n ")}<Input aria-label={("General variant Input")} defaultValue="Наследует провайдер" />
</label>
<label>{("Component setup\n ")}<Select
options={(options)}
defaultValue="anna"
aria-label={("Component variant Select")}
/>
</label>
<Form {form} variant="borderless" aria-label={("Priority Form variant")}>
<div class="examples">
<Input aria-label={("Variant from Form")} defaultValue="Form имеет приоритет" />
<Select options={(options)} defaultValue="anna" variant={local
? 'outlined'
: undefined}
aria-label={("Local variant Select")} />
</div>
</Form>
<ConfigProvider variant="filled">
<Select options={(options)} defaultValue="anna" aria-label={("Legacy config Select")} />
</ConfigProvider>
</div>
</ConfigProvider>
Component tokens
Button tokens are set separately from the general tokens of the neighboring Input.
<script lang="ts">
import { Button, ConfigProvider, Input } from '@woodger/antd';
</script>
<style>
.controls {
display: grid;
gap: 16px;
}
</style>
<ConfigProvider theme={{
components: {
Button: {
defaultBg: '#fff7e6',
defaultColor: '#874d00',
defaultBorderColor: '#d48806'
}
}
}}>
<div class="controls">
<Button>{("Button Tokens")}</Button>
<Input
aria-label={("Input without Button tokens")}
defaultValue="Сохраняет свою тему"
/>
</div>
</ConfigProvider>
Static calculation
theme.getDesignToken calculates the palette and does not change the page context.
<script lang="ts">
import { Button, Checkbox, theme } from '@woodger/antd';
let dark = $state(false);
const token = $derived(theme.getDesignToken({
token: { colorPrimary: '#d48806' },
algorithm: dark ? theme.darkAlgorithm : theme.defaultAlgorithm
}));
</script>
<style>
.controls {
display: grid;
gap: 16px;
}
output {
display: block;
margin-top: 16px;
overflow-wrap: anywhere;
font-size: 12px;
}
</style>
<div class="controls">
<Checkbox bind:checked={dark}>{("Calculate dark palette")}</Checkbox>
<Button type="primary">{("Page topic")}</Button>
</div>
<output aria-label={("Static calculation of tokens")}>
primary: {(token.colorPrimary)}; background: {(token.colorBgContainer)}
</output>
Member |
|---|
Provider general empty state |
Member |
|---|
| Local empty state Table |
General empty state
RenderEmpty return snippet; local empty Table takes precedence.
<script lang="ts">
import { ConfigProvider, Empty, Table } from '@woodger/antd';
const columns = [{ key: 'name', title: "Member", dataIndex: 'name' as const }];
const rows: { name: string }[] = [];
</script>
<style>
.tables {
display: grid;
gap: 16px;
}
</style>
{#snippet empty()}
<Empty image="simple" description={("Provider general empty state")} />
{/snippet}
{#snippet localEmpty()}{("Local empty state Table")}{/snippet}
<ConfigProvider renderEmpty={() => empty}>
<div class="tables">
<Table columns={(columns)} dataSource={(rows)} pagination={(false)} caption={("General empty state Table")} />
<Table columns={(columns)} dataSource={(rows)} pagination={(false)} caption={("Local empty state Table")}
empty={localEmpty} />
</div>
</ConfigProvider>
Popup container
GetPopupContainer provider and explicit local Tooltip override.
<script lang="ts">
import { Button, ConfigProvider, Tooltip } from '@woodger/antd';
let host = $state<HTMLDivElement>();
function popupContainer() {
return host ?? document.body;
}
</script>
<style>
.host {
position: relative;
min-height: 160px;
padding: 16px;
border: 1px dashed var(--ant-color-border);
border-radius: 8px;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
</style>
<div class="host" bind:this={host} data-provider-popup-host>
<ConfigProvider getPopupContainer={popupContainer}>
<div class="controls">
<Tooltip trigger="click" title={("Popup inside a given container")}>
<Button>{("Popup in a container")}</Button>
</Tooltip>
<Tooltip trigger="click" title={("Local popup inside body")}
getPopupContainer={() => document.body}>
<Button>{("Your own popup")}</Button>
</Tooltip>
</div>
</ConfigProvider>
</div>
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.
<script lang="ts">
import {
AutoComplete,
Cascader,
Checkbox,
ConfigProvider,
RadioGroup,
Select,
TreeSelect,
type PopupOverflow
} from '@woodger/antd';
const options = ['Button', 'Input', 'Select', 'TreeSelect'].map(value => ({
value,
label: value
}));
const treeData = options.map(option => ({ value: option.value, title: option.label }));
let overflow = $state<PopupOverflow>('viewport');
let reset = $state(false);
</script>
<style>
.settings {
display: grid;
gap: 12px;
margin-bottom: 16px;
}
.scroll-area {
height: 240px;
overflow: auto;
border: 1px dashed var(--ant-color-border);
border-radius: var(--ant-border-radius);
}
.fields {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));
gap: 16px;
padding: 16px;
}
.field { min-width: 0; }
p { margin: 0 0 8px; }
.scroll-area:focus-visible {
outline: 2px solid var(--ant-color-primary);
outline-offset: 2px;
}
</style>
<div class="settings">
<RadioGroup
aria-label={("Popup overflow region")}
options={['viewport', 'scroll']}
bind:value={overflow}
/>
<Checkbox bind:checked={reset}>
{("Nested provider: viewport")}
</Checkbox>
</div>
<ConfigProvider popupOverflow={overflow}>
<ConfigProvider popupOverflow={reset ? 'viewport' : undefined}>
<div
class="scroll-area"
role="region"
aria-label={("popupOverflow example area")}
tabindex="0"
>
<div class="fields">
<div class="field">
<p>Select</p>
<Select
aria-label={("Select with popupOverflow")}
{options}
style="
width: 100%;
min-width: 0;
"
placeholder={("Choose a component")}
/>
</div>
<div class="field">
<p>TreeSelect</p>
<TreeSelect
aria-label={("TreeSelect with popupOverflow")}
{treeData}
style="
width: 100%;
min-width: 0;
"
placeholder={("Choose a component")}
/>
</div>
<div class="field">
<p>Cascader</p>
<Cascader
aria-label={("Cascader with popupOverflow")}
{options}
style="
width: 100%;
min-width: 0;
"
placeholder={("Choose a component")}
/>
</div>
<div class="field">
<p>AutoComplete</p>
<AutoComplete
aria-label={("AutoComplete with popupOverflow")}
{options}
style="
width: 100%;
min-width: 0;
"
placeholder={("Enter a component name")}
/>
</div>
</div>
</div>
</ConfigProvider>
</ConfigProvider>
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.
<script lang="ts">
import {
AutoComplete,
Checkbox,
ConfigProvider,
RadioGroup,
Select,
TreeSelect
} from '@woodger/antd';
const widths = [true, false, 320].map(value => ({ value, label: String(value) }));
const options = [
{ value: 'button', label: 'Button' },
{ value: 'settings', label: "Component settings and localization" }
];
const treeData = options.map(option => ({ value: option.value, title: option.label }));
let width = $state<boolean | number>(true);
let reset = $state(false);
</script>
<style>
.settings {
display: grid;
gap: 12px;
margin-bottom: 16px;
}
.fields {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));
gap: 16px;
}
.field { min-width: 0; }
p { margin: 0 0 8px; }
</style>
<div class="settings">
<RadioGroup
aria-label={("Shared popup width")}
options={widths}
bind:value={width}
/>
<Checkbox bind:checked={reset}>
{("Nested provider: true")}
</Checkbox>
</div>
<ConfigProvider popupMatchSelectWidth={width}>
<ConfigProvider popupMatchSelectWidth={reset ? true : undefined}>
<div class="fields">
<div class="field">
<p>Select</p>
<Select
aria-label={("Select with shared popup width")}
options={(options)}
style="
width: 100%;
min-width: 0;
"
placeholder={("Choose a component")}
/>
</div>
<div class="field">
<p>AutoComplete</p>
<AutoComplete
aria-label={("AutoComplete with shared popup width")}
options={(options)}
style="
width: 100%;
min-width: 0;
"
placeholder={("Enter a component name")}
/>
</div>
<div class="field">
<p>TreeSelect</p>
<TreeSelect
aria-label={("TreeSelect with shared popup width")}
treeData={(treeData)}
style="
width: 100%;
min-width: 0;
"
placeholder={("Choose a component")}
/>
</div>
<div class="field">
<p>Select (240 px)</p>
<Select
aria-label={("Select with local popup width")}
options={(options)}
popupMatchSelectWidth={240}
style="
width: 100%;
min-width: 0;
"
placeholder={("Choose a component")}
/>
</div>
</div>
</ConfigProvider>
</ConfigProvider>
Scroll area
Affix inherits getTargetContainer. Local geometry is isolated from the site menu.
<script lang="ts">
import { Affix, Button, ConfigProvider } from '@woodger/antd';
let area = $state<HTMLDivElement>();
let affixed = $state(false);
const offset = 16;
</script>
<style>
.frame {
transform: translate(0);
isolation: isolate;
overflow: hidden;
border-radius: 8px;
background: var(--ant-color-fill-quaternary);
}
.scroll {
height: 180px;
overflow: auto;
}
.frame :global(.provider-affix-fixed) { top: 16px !important; }
output {
display: block;
margin-top: 16px;
}
</style>
<div class="frame">
<div class="scroll" bind:this={area} role="region" aria-label={("General provider scroll area")}
tabindex="0">
<ConfigProvider getTargetContainer={() => area ?? window}>
<div style="height: 56px"></div>
<Affix offsetTop={offset} rootClassName="provider-affix-fixed"
onChange={next => { affixed = Boolean(next); }}>
<Button>{("General target Affix")}</Button>
</Affix>
<div style="height: 360px"></div>
</ConfigProvider>
</div>
</div>
<output aria-label={("General assignment ConfigProvider")}>{(affixed ? "Fixed" : "In the stream")}</output>
Wave Setting
Disable, standard effect and custom showEffect with animation cleanup.
<script lang="ts">
import { onDestroy } from 'svelte';
import { Button, ConfigProvider, type ShowWaveEffect } from '@woodger/antd';
let effect = $state(("Click the button to compare effects."));
const animations = new Set<Animation>();
const holders = new Set<HTMLElement>();
function playAnimation(node: HTMLElement, frames: Keyframe[], cleanup = () => {}) {
const animation = node.animate(frames, { duration: 500, easing: 'ease-out' });
animations.add(animation);
const finish = () => {
animations.delete(animation);
cleanup();
};
void animation.finished.then(finish, finish);
}
const showInsetEffect: ShowWaveEffect = (node, { component, event }) => {
if (component !== 'Button') {
return;
}
effect = ("Internal wave");
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
return;
}
const rect = node.getBoundingClientRect();
const x = event.detail === 0 ? rect.width / 2 : event.clientX - rect.left;
const y = event.detail === 0 ? rect.height / 2 : event.clientY - rect.top;
const diameter = Math.hypot(rect.width, rect.height) * 2;
const holder = document.createElement('span');
holder.setAttribute('aria-hidden', 'true');
holder.style.cssText = `
position: absolute;
inset: 0;
overflow: hidden;
border-radius: inherit;
pointer-events: none;
z-index: 1;
`;
const dot = document.createElement('span');
dot.style.cssText = `
position: absolute;
left: ${x}px;
top: ${y}px;
width: ${diameter}px;
height: ${diameter}px;
border-radius: 50%;
background: rgba(255,255,255,0.65);
pointer-events: none;
`;
holder.append(dot);
node.append(holder);
holders.add(holder);
playAnimation(dot, [
{
transform: 'translate(-50%, -50%) scale(0)',
opacity: 1
},
{
transform: 'translate(-50%, -50%) scale(1)',
opacity: 0
}
], () => {
holder.remove();
holders.delete(holder);
});
};
const showShakeEffect: ShowWaveEffect = (node, { component }) => {
if (component !== 'Button') {
return;
}
effect = ("Shaking");
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
return;
}
for (const animation of node.getAnimations()) {
if (animations.has(animation)) animation.cancel();
}
playAnimation(node, [0, -12, 12, -5, 5, 0].map(angle => ({
transform: `rotate(${angle}deg)`
})));
};
onDestroy(() => {
for (const animation of animations) animation.cancel();
for (const holder of holders) holder.remove();
animations.clear();
holders.clear();
});
</script>
<style>
.row {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
}
output {
display: block;
margin-top: 16px;
color: var(--ant-color-text-secondary);
font-size: 12px;
}
</style>
<div class="row">
<ConfigProvider wave={{ disabled: true }}>
<Button type="primary" onclick={() => { effect = ("Wave disabled"); }}>
{("Without wave")}
</Button>
</ConfigProvider>
<ConfigProvider>
<Button
type="primary"
onclick={() => { effect = ("Standard wave"); }}
>{("Standard")}</Button>
</ConfigProvider>
<ConfigProvider wave={{ showEffect: showInsetEffect }}>
<Button type="primary">{("Internal wave")}</Button>
</ConfigProvider>
<ConfigProvider wave={{ showEffect: showShakeEffect }}>
<Button type="primary">{("Shaking")}</Button>
</ConfigProvider>
</div>
<output aria-label={("Wave effect")}>{effect}</output>
Message context
MessageHolder is located inside the provider; React static functions are not used.
<script lang="ts">
import { onDestroy } from 'svelte';
import { Button, ConfigProvider, MessageHolder, createMessage } from '@woodger/antd';
const message = createMessage();
let container = $state<HTMLDivElement>();
onDestroy(() => message.destroy());
</script>
<div bind:this={container}>
<ConfigProvider theme={{ token: { colorText: '#874d00' } }}>
<MessageHolder {message} top={240} id="provider-context-messages"
getContainer={() => container} />
<Button onclick={() => message.info(("Message from ConfigProvider context"))}>
{("Message with context")}
</Button>
</ConfigProvider>
</div>
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.
<script lang="ts">
import {
App, Checkbox, ConfigProvider, Input, Layout, LayoutContent,
LayoutFooter, LayoutHeader, LayoutSider
} from '@woodger/antd';
let custom = $state(true);
let localSider = $state(true);
let collapsed = $state(false);
let draft = $state('');
const prefix = $derived(custom ? 'suite' : 'ant');
</script>
<style>
.example, .scopes {
display: grid;
gap: 16px;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.preview {
min-width: 0;
overflow: hidden;
border: 1px solid var(--ant-color-border-secondary);
border-radius: 8px;
isolation: isolate;
transform: translate(0);
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("Prefix suite")}</Checkbox>
<Checkbox bind:checked={localSider}>{("Your prefixCls panel")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} theme={{
token: { motion: false }, components: {
Layout: {
headerHeight: 44, headerPadding: '0 12px',
headerBg: 'var(--ant-color-fill-secondary)', footerPadding: '12px'
}
}
}}>
<div class="scopes">
<div class="preview" role="region" aria-label={("Common Prefix Area")}>
<App aria-label={("App common prefix")}>
<Layout aria-label={("Common Prefix Layout")} style="min-height: 220px">
<LayoutSider
prefixCls={localSider ? 'local-panel' : ''}
width={96}
collapsedWidth={48}
theme="light"
collapsible
bind:collapsed
collapseLabel={("Collapse common prefix panel")}
expandLabel={("Expand common prefix panel")}
styles={{ body: `
padding: 12px;
overflow-wrap: anywhere;
` }}
>{("Menu")}</LayoutSider>
<Layout style="min-width: 0">
<LayoutHeader
style="
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>{("Region ")}{prefix}</LayoutHeader>
<LayoutContent style="
padding: 12px;
min-width: 0;
">
<Input
bind:value={draft}
aria-label={("Draft general prefix")}
placeholder={("Draft")}
/>
</LayoutContent>
<LayoutFooter>{("Sections inherit a common prefix.")}</LayoutFooter>
</Layout>
</Layout>
</App>
</div>
<div class="preview">
<ConfigProvider prefixCls="">
<Layout aria-label={("Legacy layout")} style="padding: 12px">{("\n Empty prefixCls inherits ")}{prefix}.
</Layout>
</ConfigProvider>
</div>
</div>
</ConfigProvider>
<ConfigProvider prefixCls="ant">
<div class="preview">
<App aria-label={("Standard App nearby")}>
<Layout aria-label={("Standard Layout next")}>
<LayoutContent
style="padding: 12px"
>{("The adjacent area retains ant.")}</LayoutContent>
</Layout>
</App>
</div>
</ConfigProvider>
<output aria-label={("Common prefix status")}>
{prefix}; {(collapsed ? "Collapsed" : "Revealed")};
Sider: {(localSider ? 'local-panel' : prefix + '-layout-sider')}
</output>
<p>
{("Input does not yet inherit the common prefixCls and retains its classes. Supported families are listed in the description above.")}
</p>
</div>
- Finished
- In progress
- Waiting
- ReceivedApplication accepted
- VerifiedDocuments are ready
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.
<script lang="ts">
import {
Checkbox,
ConfigProvider,
QRCode,
Statistic,
StatisticTimer,
Steps,
Timeline
} from '@woodger/antd';
let custom = $state(true);
let localTimeline = $state(false);
let current = $state(1);
const prefix = $derived(custom ? 'suite' : 'ant');
const items = [{ title: "Data" }, { title: "Check" }, { title: "Ready" }];
</script>
<style>
.example, .scope {
display: grid;
gap: 20px;
min-width: 0;
}
.controls, .metrics {
display: flex;
flex-wrap: wrap;
gap: 16px;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("General prefix of suite indicators")}</Checkbox>
<Checkbox bind:checked={localTimeline}>{("Custom Timeline prefix")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} theme={{ token: { motion: false } }}>
<div class="scope">
<div class="metrics">
<Statistic title={("Applications")} value={1280} aria-label={("Common prefix indicator")} />
<StatisticTimer type="countdown" title={("Until 2100")} value={4102444800000}
format={("D [day] HH:mm:ss")} aria-label={("Common Prefix Timer")} />
</div>
<QRCode type="svg" value="https://woodger.org/ant-design" size={128}
aria-label={("Common Prefix QR Code")} />
<Steps items={(items)} {current} onChange={value => { current = value; }}
aria-label={("Common Prefix Stages")} />
<Timeline prefixCls={localTimeline ? 'local-history' : ''} items={([
{ title: "Received", content: "Application accepted" },
{ title: "Verified", content: "Documents are ready" }
])} aria-label={("History of the common prefix")} />
</div>
</ConfigProvider>
<ConfigProvider prefixCls="ant">
<Statistic title={("Independent indicator")} value={1280} aria-label={("Standard indicator nearby")} />
</ConfigProvider>
<output aria-label={("Indicator Prefix Status")}>{prefix}{("; current stage: ")}{current}</output>
<p>{("Local prefixCls Timeline changes its classes. Inner Steps separately inherits ")}{prefix}-steps.</p>
</div>
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.
<script lang="ts">
import { Checkbox, ConfigProvider, Divider, Flex, Segmented } from '@woodger/antd';
let custom = $state(true);
let localSegmented = $state(false);
let value = $state('week');
let changes = $state(0);
const prefix = $derived(custom ? 'suite' : 'ant');
const options = [{ label: "Day", value: 'day' }, { label: "Week", value: 'week' }];
</script>
<style>
.example {
display: grid;
gap: 16px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("General suite layout prefix")}</Checkbox>
<Checkbox
bind:checked={localSegmented}
>{("Local prefixCls Segmented")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix}>
<Divider prefixCls="" titlePlacement="start" aria-label={("Common prefix separator")}>
{("Period")}
</Divider>
<ConfigProvider prefixCls="">
<Flex orientation="vertical" gap="small" align="start" aria-label={("Common Prefix Layout")}>
<Segmented
options={(options)}
bind:value
prefixCls={localSegmented ? 'local-period' : ''}
name="prefix-period"
aria-label={("Common prefix period")}
onChange={() => { changes += 1; }}
/>
<output aria-label={("Select period with prefix")}>{value}{("; events: ")}{changes}</output>
</Flex>
</ConfigProvider>
</ConfigProvider>
<ConfigProvider prefixCls="ant">
<Flex
gap="small"
wrap
aria-label={("Standard side by side arrangement")}
><span>{("Day")}</span><span>{("Week")}</span></Flex>
</ConfigProvider>
<p>{("Empty prefixCls of nested provider and Divider inherit ")}{prefix}{(". Changing classes retains the Segmented selection.")}</p>
</div>
Check completed
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.
<script lang="ts">
import {
Avatar, AvatarGroup, Badge, BadgeRibbon, Button, CheckableTag, CheckableTagGroup,
Checkbox, ConfigProvider, Empty, Progress, Result, Skeleton, SkeletonAvatar,
SkeletonButton, SkeletonImage, SkeletonInput, SkeletonNode, Spin, Tag
} from '@woodger/antd';
let custom = $state(true);
let localBadge = $state(false);
let count = $state(5);
let checked = $state(true);
const prefix = $derived(custom ? 'suite' : 'ant');
</script>
<style>
.example, .scope {
display: grid;
gap: 20px;
min-width: 0;
}
.row, .controls {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 16px;
}
.badge-anchor {
display: inline-block;
padding: 12px;
border-radius: 6px;
background: var(--ant-color-fill-secondary);
}
.ribbon-content {
min-height: 72px;
padding: 36px 12px 12px;
border: 1px solid var(--ant-color-border-secondary);
border-radius: 6px;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("General prefix of suite statuses")}</Checkbox>
<Checkbox bind:checked={localBadge}>{("Local prefixCls Badge")}</Checkbox>
<Button
onclick={() => { count += 1; }}
>{("Increment counter with prefix")}</Button>
</div>
<ConfigProvider prefixCls={prefix}>
<div class="scope">
<div class="row">
<Avatar aria-label={("Common prefix avatar")}>W</Avatar>
<AvatarGroup aria-label={("Common prefix group")} items={([
{ key: 'anna', label: "Anna", text: "A" },
{ key: 'ivan', label: "Ivan", text: "AND" }
])} />
<Badge prefixCls={localBadge ? 'local-counter' : ''} {count}
aria-label={("Common prefix counter")}>
<span class="badge-anchor">
{("Applications")}
</span>
</Badge>
</div>
<BadgeRibbon text={("Ready")}>
<div class="ribbon-content">{("Tape inherits ")}{prefix}-ribbon.</div>
</BadgeRibbon>
<div class="row">
<Tag>{("New")}</Tag>
<CheckableTag
{checked}
onChange={next => { checked = next; }}
>{("Verified")}</CheckableTag>
</div>
<CheckableTagGroup role="group" aria-label={("General Prefix Categories")}
options={(["Code", "Layout"])} defaultValue="Код" />
<Empty image="simple" description={("No applications yet")} />
<Skeleton loading avatar paragraph={false} />
<div class="row">
<SkeletonAvatar /><SkeletonButton /><SkeletonInput style="width: 120px" />
<SkeletonImage /><SkeletonNode>{("Chart")}</SkeletonNode>
</div>
<Spin />
<Progress percent={60} />
<Result status="success" title={("Check completed")} styles={{
root: 'padding: 12px'
}} />
</div>
</ConfigProvider>
<ConfigProvider
prefixCls="ant"
><Avatar
aria-label={("Standard avatar nearby")}
>W</Avatar></ConfigProvider>
<output aria-label={("Status prefix status")}>
{prefix}{("; counter: ")}{count}; {(checked ? "verified" : "not verified")}
</output>
<p>{("Local Badge changes its namespace, and ScrollNumber inherits separately ")}{prefix}{("-scroll-number. Ribbon geometry CSS follows a common prefix.")}</p>
</div>
Panel prefix and Affix
Alert, Collapse and fixed Affix. Changing classes preserves the expanded panels, draft, and local scroll area.
<script lang="ts">
import { Affix, Alert, Button, Checkbox, Collapse, ConfigProvider, Input } from '@woodger/antd';
let custom = $state(true);
let localCollapse = $state(false);
let area = $state<HTMLDivElement>();
let affixed = $state(false);
let draft = $state('');
const prefix = $derived(custom ? 'suite' : 'ant');
</script>
<style>
.example, .scope {
display: grid;
gap: 16px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
.frame {
transform: translate(0);
isolation: isolate;
overflow: hidden;
border-radius: 8px;
background: var(--ant-color-fill-quaternary);
}
.scroll {
height: 144px;
overflow: auto;
}
.frame :global(.prefix-structure-fixed) { top: 8px !important; }
output { overflow-wrap: anywhere; }
</style>
{#snippet editor()}
<Input
bind:value={draft}
aria-label={("Draft panel with prefix")}
placeholder={("Draft")}
/>
{/snippet}
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("Common prefix for suite panels")}</Checkbox>
<Checkbox
bind:checked={localCollapse}
>{("Local prefixCls Collapse")}</Checkbox>
<Button onclick={() => { if (area) area.scrollTop = area.scrollTop ? 0 : 96; }}>
{("\n Scroll Affix with prefix\n ")}
</Button>
</div>
<ConfigProvider prefixCls={prefix} iconPrefixCls={custom ? 'suite-icon' : undefined}>
<div class="scope">
<Alert title={("Panels inherit a common prefix")} showIcon />
<Collapse
prefixCls={localCollapse ? 'local-panels' : ''}
aria-label={("Common Prefix Panels")}
defaultActiveKey={['draft']}
items={([
{ key: 'draft', label: "Editor", children: editor },
{
key: 'note',
label: "Note",
children: "Changing classes preserves the opened panels."
}
])}
/>
<div class="frame">
<div class="scroll" bind:this={area} role="region" aria-label={("Affix container with prefix")} tabindex="0">
<div style="height: 40px"></div>
<Affix target={() => area ?? null} offsetTop={8} rootClassName="prefix-structure-fixed"
onChange={next => { affixed = Boolean(next); }}>
<Button>{("Action Affix")}</Button>
</Affix>
<div style="height: 320px"></div>
</div>
</div>
</div>
</ConfigProvider>
<output aria-label={("Panel prefix status")}>
{prefix}; {(affixed ? "fixed" : "in stream")}{("; draft: ")}{(draft
|| ("empty"))}
</output>
</div>
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.
<script lang="ts">
import {
Button,
Checkbox,
ConfigProvider,
Input,
Popconfirm,
Popover,
Slider,
Tooltip
} from '@woodger/antd';
let custom = $state(true);
let local = $state(false);
let tips = $state(false);
let draft = $state('');
let value = $state(30);
let range = $state<number[]>([25, 75]);
let confirmations = $state(0);
const prefix = $derived(custom ? 'suite' : 'ant');
</script>
<style>
.example, .scope {
display: grid;
gap: 24px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
{#snippet content()}
<Input
bind:value={draft}
aria-label={("Draft popup with prefix")}
placeholder={("Draft")}
/>
{/snippet}
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("Common prefix for popup suite")}</Checkbox>
<Checkbox bind:checked={local}>{("Popup and Slider local prefixes")}</Checkbox>
<Checkbox
bind:checked={tips}
>{("Show Slider tooltips with prefix")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix}>
<div class="scope">
<div class="controls">
<Tooltip prefixCls={local ? 'local-tip' : ''} title={("Common prefix hint")}
trigger="click" classNames={{ root: 'prefix-tooltip-popup' }}>
<Button>{("Tooltip with common prefix")}</Button>
</Tooltip>
<Popover prefixCls={local ? 'local-card' : ''} title={("Common Prefix Card")}
content={(content)} trigger="click" classNames={{
root: 'prefix-popover-popup'
}}>
<Button>{("Popover with common prefix")}</Button>
</Popover>
<Popconfirm prefixCls={local ? 'local-confirm' : ''} title={("Confirm prefix change?")}
okText={("Confirm")} cancelText={("Cancel")}
classNames={{ root: 'prefix-popconfirm-popup' }}
onConfirm={() => { confirmations += 1; }}>
<Button>{("Popconfirm with common prefix")}</Button>
</Popconfirm>
</div>
<Slider prefixCls={local ? 'local-slider' : ''} bind:value
aria-label={("Slider number of common prefix")} tooltip={({
open: tips
})} />
<Slider prefixCls={local ? 'local-range' : ''} range bind:value={range}
ariaLabelForHandle={["Start of common prefix range", "End of common prefix range"]}
tooltip={({ open: tips })} />
</div>
</ConfigProvider>
<output aria-label={("Popup prefix status")}>
{prefix}{("; number: ")}{value}{("; range: [")}{range.join(', ')}{("]; confirmations: ")}{confirmations}
</output>
<p>{("Tooltip Slider inherits a common prefix separate from the scale. Local Popconfirm changes confirmation classes; its external Popover inherits ")}{prefix}-popover.</p>
</div>
Parent:
Reset theme:
Explicit prefix:
Without local theme:
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.
PrefixVariables.svelte<script lang="ts"> import { Checkbox, ConfigProvider } from '@woodger/antd'; import PrefixVariableReadout from './PrefixVariableReadout.svelte'; let clear = $state(false); </script> <style> .example, .scopes { display: grid; gap: 12px; } p { margin: 0; } </style> <div class="example"> <Checkbox bind:checked={clear} >{("Clear inherited variable prefix")}</Checkbox> <ConfigProvider prefixCls="suite" theme={{ cssVar: { prefix: 'base-vars' }, token: { fontSize: 16 } }}> <div class="scopes"> <PrefixVariableReadout name="Родитель" /> <ConfigProvider prefixCls="inner" theme={{ inherit: false, cssVar: clear ? { prefix: undefined } : {} }}> <PrefixVariableReadout name="Сброс темы" /> </ConfigProvider> <ConfigProvider prefixCls="inner" theme={{ cssVar: { prefix: 'local-vars' } }}> <PrefixVariableReadout name="Явный prefix" /> </ConfigProvider> <ConfigProvider prefixCls="without-theme"> <PrefixVariableReadout name="Без локальной темы" /> </ConfigProvider> </div> </ConfigProvider> <p> {("The inherited cssVar.prefix is preserved even when inherit=false. Explicit undefined returns the fallback of the current provider - inner.")} </p> </div>PrefixVariableReadout.svelte<script lang="ts"> import { theme } from '@woodger/antd'; let { name }: { name: string } = $props(); const current = theme.useToken(); </script> <style> p { margin: 0; padding: 8px 12px; border-radius: 6px; background: var(--ant-color-bg-container); overflow-wrap: anywhere; } code { font-size: 12px; } </style> <p>{(name)}: <code><output aria-label={("CSS variables: " + String((name)) + "")} >{(String(current.cssVar.fontSize))}</output></code></p>
API
Child components read settings from the nearest ConfigProvider.
| Theme | Example or limitation |
|---|---|
| Locale | Ready-to-use component dictionaries. |
| Direction | Direction of child components. |
| popupOverflow | Overflow calculation regions for Select, TreeSelect, Cascader and AutoComplete; inheritance and an explicit viewport. |
| popupMatchSelectWidth | Shared width for Select, AutoComplete and TreeSelect; nested providers and local precedence. |
| Component size | Size and disabled with local exceptions. |
| Variant | General design option, component settings and Form priority. |
| Theme | Algorithms, general and component tokens, nested topics. |
| Custom Wave | WaveConfig.disabled/showEffect and lifecycle animations. |
| Static function | ConfigProvider.config sets the appearance of static Modal dialogs. |
| Content Security Policy | Pass 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 Config | Published component settings. |
| Component prefixCls | General prefix App/Layout, local priority and independent areas. |
| Display component prefixCls | Inheritance Statistic/Timer, QRCode, Steps and Timeline; independent prefix of internal Steps. |
| Layout and selection prefixCls | Inherit Divider, Flex and Segmented without resetting selection. |
| Status component prefixCls | Avatar/Group, Badge/Ribbon, Tag, Empty, Skeleton, Spin, Progress and Result; independent ScrollNumber. |
| Panel and Affix prefixCls | Alert, Collapse and active Affix; saving the editor and opened panels. |
| Popup and Slider prefixCls | Tooltip, Popover, Popconfirm and single/range Slider; independent prefixes of internal popups. |
| CSS variable prefix | Inheritance of cssVar.prefix and fallback of the current provider. |
General parameters ConfigProvider
| Property | Description | Type | Default |
|---|---|---|---|
iconPrefixCls | CSS class prefix for built-in icons. An empty value inherits the nearest provider's prefix. | string | anticon |
children | Child tree to which the context is available. | Snippet | is required |
prefixCls | The 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. | string | parent/ant |
componentSize | The total size of the controls that support it. Local size and Compact take precedence. | small | medium | large | parent / medium |
componentDisabled | General disabling of controls; local disabled specifies the meaning. | boolean | parent / false |
variant | outlined, filled, borderless or underlined. Local variant, nearest Form.variant and component config take precedence. | Variant | parent / outlined |
direction | Direction of layout and child components. | ltr | rtl | parent/ltr |
locale | A ready-to-use @woodger/antd/locale dictionary or partial component settings. | Partial<Locale> | AntDesignLocale | parent / ruRU |
theme | Tokens, algorithms and component topic. | ThemeConfig | parent theme |
csp | Sets the nonce on styles created by the library. Nested providers inherit this setting. | CSPConfig | — |
getPopupContainer | Container supported popup. Callback is called in the browser; triggerNode may be missing. | (triggerNode?) => HTMLElement | ShadowRoot | parent/body |
getTargetContainer | General Affix/Anchor scroll area. Local target/getContainer takes precedence. | () => HTMLElement | Window | parent/window |
popupOverflow | Overflow 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. | PopupOverflow | parent / viewport |
popupMatchSelectWidth | Shared popup width for Select, AutoComplete and TreeSelect. undefined inherits the value; a local component prop takes precedence. Cascader uses its own prop. | boolean | number | parent / true |
renderEmpty | Producer of empty state, including snippet. Support and fallback depend on the component. | (componentName?) => RenderEmptyContent | parent/Empty |
virtual | Shared virtual setting for Tree/DirectoryTree, TreeSelect, Listy, Select and AutoComplete. | boolean | parent / no common meaning |
class | Provider div class. | string | — |
style | CSS root after calculated CSS variables. | string | — |
ConfigProvider.config()
| Property | Description | Type | Default |
|---|---|---|---|
holderRender | Wraps the dialog opened by a static method. | Snippet<[content: Snippet]> | — |
prefixCls | Class prefix for components in the separate root. | string | ant |
iconPrefixCls | Class prefix for the built-in confirmation icon. | string | anticon |
theme | Theme for the separate root of static dialogs. | ThemeConfig | — |
ThemeConfig
| Property | Description | Type | Default |
|---|---|---|---|
token | Seed overrides participate in algorithms; aliases overlap the calculated values. | Partial<AliasToken> | parent / defaultSeed + algorithms |
algorithm | Algorithms are executed in array order; default/dark/compact are available. | MappingAlgorithm | readonly MappingAlgorithm[] | parent/defaultAlgorithm |
components | Overrides selected components. The connection of specific tokens is determined by the implementation of the family. | ComponentsConfig | parent configuration |
inherit | false resets parent tokens/algorithms/components, but not the entire ConfigProvider. | boolean | true |
hashed | false returns an empty hashId. It is not an application's custom CSS isolation. | boolean | true |
cssVar | Namespace 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 |
zeroRuntime | The source theme setting is inherited; the package's published CSS remains required. | boolean | parent / false |
mode | Compatible shorthand theme Svelte. | light | dark | parent/light |
primary | Compatible presets. Set an arbitrary color using token.colorPrimary. | blue | purple | green | parent/blue |
compact | Compatible shorthand compact metrics. | boolean | parent / false |
WaveConfig
| Property | Description | Type | Default |
|---|---|---|---|
disabled | Disable wave effect. | boolean | false |
showEffect | Own animation; the created resources are released by the owner of the callback. | ShowWaveEffect | standard effect |
triggerType | Event that triggers a wave. | click | pointerdown | pointerup | mousedown | mouseup | click |
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.
| Key | Purpose |
|---|---|
| app | class/style wrapper App. Record replaces the entire parent; local style takes precedence. |
| layout | Only class/style containers Layout; sections and Sider do not receive record directly. |
| statistic | class/style and object or functional classNames/styles Statistic and StatisticTimer. |
| steps | class/style and object or functional classNames/styles Steps. |
| timeline | class/style and object or functional classNames/styles Timeline. |
| form | Captions, requiredMark, tooltip, class/style, semantic defaults, validateMessages and scrollToFirstError. |
| button | Appearance, shape, semantic defaults and autoInsertSpace. |
| input | variant, allowClear and semantic defaults. |
| inputPassword | InputPassword settings. |
| inputSearch | InputSearch settings. |
| otp | InputOTP settings. |
| textArea | TextArea settings. |
| inputNumber | Number field settings. |
| select | Shared variant, class/style, classNames/styles, showSearch and icons for Select/AutoComplete. Only Select inherits boolean or object allowClear. |
| tree | TreeConfig: class/style and five semantic slots for Tree/DirectoryTree. TreeSelect does not inherit this configuration. |
| treeSelect | Only variant of the selection tree. |
| mentions | Field variant, clear button, classes and styles for the root and individual parts of Mentions. |
| checkbox | General class/style and semantic defaults. |
| radio | General class/style and semantic defaults. |
| switch | General class/style and semantic defaults. |
| slider | Scale settings and semantic defaults. |
| colorPicker | Palette and popup settings. |
| datePicker | Only variant of single DatePicker. |
| rangePicker | RangePicker and TimeRangePicker settings. |
| timePicker | Time settings. |
| cascader | Cascader/Panel settings. |
| transfer | Transfer list settings. |
| rate | Evaluation settings. |
| segmented | Option switch settings. |
| space | size, class/style and semantic defaults Space. |
| divider | Separator settings. |
| flex | Flex Settings. |
| masonry | Masonry Settings. |
| splitter | Settings for split panels. |
| affix | class/style of external Affix node. |
| pagination | Pagination and semantic defaults settings. |
| table | Shared row keys, scrolling, styling, and expansion toggle. |
| drawer | Backdrop, focus, close button and styling for individual panel elements. |
| modal | Backdrop, focus, alignment, dialog styling, buttons and confirmation icons. |
| message | Shared classes and styles for the message list, icons and text. |
| notification | Shared notification classes, styles and close icon. |
| tabs | Tabs and semantic defaults settings. |
| tooltip | Tooltip and popup settings. |
| popover | Popover and popup settings. |
| popconfirm | Confirmation and popup settings. |
| badge | Badge Settings. |
| ribbon | BadgeRibbon Settings. |
| avatar | Avatar Settings. |
| card | variant, class/style and object or functional classNames/styles Card. |
| cardMeta | class/style and object or functional classNames/styles CardMeta. |
| descriptions | class/style and object or functional classNames/styles Descriptions. |
| anchor | class/style and object or functional classNames/styles Anchor. |
| tag | Tag Settings. |
| typography | Text settings and semantic defaults. |
| calendar | Calendar settings. |
| carousel | Carousel Settings. |
| collapse | Collapse and semantic defaults settings. |
| listy | Listy settings, including virtual. |
| tour | Tour settings; the global popup container is not inherited by it. |
| floatButton | Settings for a separate floating button. |
| floatButtonGroup | Settings for a group of floating buttons. |
| qrcode | QRCode settings. |
| watermark | Watermark settings. |
| borderBeam | class/style of decorative layers. |
| spin | Spin settings. |
| progress | Progress settings. |
| upload | UploadConfig: class/style, semantic slots, accept, customRequest and progress for Upload/Dragger. The nested record is replaced entirely. |
| skeleton | Skeleton settings. |
| empty | Empty settings. |
| result | Settings Result. |
| alert | Alert 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.
| Token | Meaning |
|---|---|
colorPrimary | #2f54eb |
colorPrimaryHover | #597ef7 |
colorBgContainer | #ffffff |
colorText | rgba(0,0,0,0.88) |
fontSize | 14 |
lineHeight | 1.5714285714285714 |
controlHeight | 32 |
borderRadius | 6 |
padding | 16 |
margin | 16 |
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.