@rmwc/provider
Advanced tools
Comparing version 14.0.4 to 14.0.5
{ | ||
"name": "@rmwc/provider", | ||
"version": "14.0.4", | ||
"version": "14.0.5", | ||
"description": "RMWC Provider component", | ||
@@ -36,5 +36,5 @@ "main": "./index.js", | ||
"dependencies": { | ||
"@rmwc/base": "14.0.4", | ||
"@rmwc/types": "14.0.4" | ||
"@rmwc/base": "14.0.5", | ||
"@rmwc/types": "14.0.5" | ||
} | ||
} |
# Provider | ||
> A component that provides global configuration for RMWC. | ||
A component that provides global configuration for RMWC. | ||
- Module **@rmwc/provider** | ||
You can wrap your top level App component with RMWC provider to set global configuration options. Just pass the options in as props. | ||
```js | ||
```jsx | ||
` | ||
import React from 'react'; | ||
import \* as ReactDOM from 'react-dom'; | ||
import * as ReactDOM from 'react-dom'; | ||
import App from './App'; // your main app component | ||
import { RMWCProvider } from '@rmwc/provider'; | ||
// This example disables ripples globally by default | ||
ReactDOM.render( | ||
<RMWCProvider | ||
// Globally disable ripples | ||
ripple\={false} | ||
ripple={false} | ||
// Global options for icons | ||
// Takes the same options as the icon component | ||
icon\={{ | ||
icon={{ | ||
basename: 'material-icons' | ||
}} | ||
// Global options for typography | ||
// allows mapping of a defaultTag or specific classes | ||
// See the Typography docs for more info | ||
typography\={{ | ||
typography={{ | ||
defaultTag: 'div', | ||
headline1: 'h1' | ||
}} | ||
// Global options for tooltips | ||
// Takes most of the options for tooltips | ||
// See the Tooltip docs for more info | ||
tooltip\={{ | ||
tooltip={{ | ||
align: 'right' | ||
}} | ||
\> | ||
> | ||
<App /> | ||
</RMWCProvider\>, | ||
</RMWCProvider>, | ||
document.getElementById('root'), | ||
); | ||
` | ||
@@ -78,1 +51,14 @@ ``` | ||
## RMWCProvider | ||
A provider for setting global options in RMWC. | ||
### Props | ||
| Name | Type | Description | | ||
|------|------|-------------| | ||
| `children` | `ReactNode` | Children to render | | ||
| `icon` | `Partial<IconOptions>` | Global options for icons | | ||
| `ripple` | `boolean` | Enable / Disable interaction ripples globally | | ||
| `tooltip` | `Partial<TooltipOptions>` | Global tooltip options | | ||
| `typography` | `Partial<TypographyOptions>` | Global typography options | | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6427
64
+ Added@rmwc/base@14.0.5(transitive)
+ Added@rmwc/types@14.0.5(transitive)
- Removed@rmwc/base@14.0.4(transitive)
- Removed@rmwc/types@14.0.4(transitive)
Updated@rmwc/base@14.0.5
Updated@rmwc/types@14.0.5