0.0.10 • Published 3 years ago

@lcap-ui/provider v0.0.10

Weekly downloads
15
License
-
Repository
-
Last release
3 years ago

Provider

A component that provides global configuration for LCAP.

  • Module @lcap-ui/provider

You can wrap your top level App component with LCAP provider to set global configuration options. Just pass the options in as props.

  `
  import React from 'react';
  import * as ReactDOM from 'react-dom';
  import App from './App'; // your main app component
  import { LCAPProvider } from '@lcap-ui/provider';

  // This example disables ripples globally by default
  ReactDOM.render(
    <LCAPProvider
      // Globally disable ripples
      ripple={false}
      // Global options for icons
      // Takes the same options as the icon component
      icon={{
        basename: 'material-icons'
      }}
      // Global options for typography
      // allows mapping of a defaultTag or specific classes
      // See the Typography docs for more info
      typography={{
        defaultTag: 'div',
        headline1: 'h1'
      }}
      // Global options for tooltips
      // Takes most of the options for tooltips
      // See the Tooltip docs for more info
      tooltip={{
        align: 'right'
      }}
    >
      <App />
    </LCAPProvider>,
    document.getElementById('root'),
  );
`

LCAPProvider

A provider for setting global options in LCAP.

Props

NameTypeDescription
childrenReact.ReactNodeChildren to render
iconPartial<IconOptions>Global options for icons
rippleundefined \| false \| trueEnable / Disable interaction ripples globally
tooltipPartial<TooltipOptions>Global tooltip options
typographyPartial<TypographyOptions>Global typography options