Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ant-design/pro-provider

Package Overview
Dependencies
Maintainers
7
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ant-design/pro-provider

@ant-design/pro-provider

  • 2.14.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created

What is @ant-design/pro-provider?

@ant-design/pro-provider is a package that provides context and hooks for managing global settings and configurations in Ant Design Pro applications. It helps in managing themes, locales, and other global states efficiently.

What are @ant-design/pro-provider's main functionalities?

ConfigProvider

The ConfigProvider component allows you to set global configurations such as theme and locale for your application. This ensures that all child components have access to these settings.

import { ConfigProvider } from '@ant-design/pro-provider';

const App = () => (
  <ConfigProvider
    value={{
      theme: 'dark',
      locale: 'en-US',
    }}
  >
    <YourComponent />
  </ConfigProvider>
);

useIntl

The useIntl hook provides internationalization support, allowing you to format messages based on the current locale.

import { useIntl } from '@ant-design/pro-provider';

const MyComponent = () => {
  const intl = useIntl();
  return <div>{intl.formatMessage({ id: 'welcome' })}</div>;
};

useTheme

The useTheme hook allows you to access the current theme and apply conditional styling based on the theme.

import { useTheme } from '@ant-design/pro-provider';

const ThemedComponent = () => {
  const theme = useTheme();
  return <div style={{ backgroundColor: theme === 'dark' ? '#000' : '#fff' }}>Themed Content</div>;
};

Other packages similar to @ant-design/pro-provider

Keywords

FAQs

Package last updated on 20 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc