JGuang

ConfigProvider

ConfigProvider · Ant Design Mobile

Preview
npm install antd-mobile@5.43.0

ConfigProvider

Configure locale messages and custom icons globally.

Install

npm install antd-mobile@5.43.0

antd-mobile is for mobile web, not React Native or Mini Programs. React 19 projects must register createRoot with unstableSetRender at the entry, or imperative APIs such as Toast and Dialog cannot render. Switch dark mode with <html data-prefers-color-scheme="dark">.

Examples come from the official Ant Design Mobile repository (MIT) at the commit published as npm 5.43.0. Presentation helpers such as DemoBlock are JGuang rewrites, not antd-mobile APIs.

Configure locale messages and custom icons globally.

When to use

  • You want to use other languages than English
  • You want to use your own icon set instead of antd-mobile-icons

Demos

ConfigProvider

Props

NameDescriptionTypeDefault
localeLocale messagesLocalezh-CN
checkListCheckList config{ activeIcon?: ReactNode }-
collapseCollapse config{ arrowIcon?: ReactNode | ((active: boolean) => ReactNode) }-
dropdownDropdown config{ arrowIcon?: ReactNode }-
formForm config{ helpIcon?: ReactNode }-
inputInput config{ clearIcon?: ReactNode }-
listList config{ arrowIcon?: ReactNode }-
navBarNavBar config{ backIcon?: ReactNode }-
noticeBarNoticeBar config{ icon?: ReactNode, closeIcon?: ReactNode }-
popupPopup config{ closeIcon?: ReactNode }-
resultResult config{ successIcon?: ReactNode, errorIcon?: ReactNode, infoIcon?: ReactNode, waitingIcon?: ReactNode, warningIcon?: ReactNode }-
searchBarSearchBar config{ searchIcon?: ReactNode }-