2.10.0 • Published 1 year ago

@vonrehberg.consulting/mgt-components v2.10.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Microsoft Graph Toolkit Web Components

npm

The Microsoft Graph Toolkit (mgt) web components package is a collection of web components powered by Microsoft Graph. The components are functional, work automatically with Microsoft Graph, and work with any web framework and on all modern browsers.

Note: If you are building with React, you might find @vonrehberg.consulting/mgt-react useful as well.

See docs for full documentation

Components

You can explore components and samples with the playground powered by storybook.

The Toolkit currently includes the following components:

The components work best when used with a provider. The provider handles authentication and the requests to the Microsoft Graph APIs used by the components.

Get started

The components can be used on their own, but they are at their best when they are paired with an authentication provider. This example illustrates how to use the components alongside a provider (MsalProvider in this case).

  1. Install the packages

    npm install @vonrehberg.consulting/mgt-element @vonrehberg.consulting/mgt-components @vonrehberg.consulting/mgt-msal-provider
  2. Use components in your code

    <script type="module">
      import {Providers} from '@vonrehberg.consulting/mgt-element';
      import {MsalProvider} from '@vonrehberg.consulting/mgt-msal-provider';
    
      // import the components
      import '@vonrehberg.consulting/mgt-components';
    
      // initialize the auth provider globally
      Providers.globalProvider = new MsalProvider({clientId: 'clientId'});
    </script>
    
    <mgt-login></mgt-login>
    <mgt-person person-query="Bill Gates" person-card="hover"></mgt-person>
    <mgt-agenda group-by-day></mgt-agenda>

Sea also