How to use the @material/tabs/dist/mdc.tabs.MDCTabFoundation function in @material/tabs

To help you get started, we’ve selected a few @material/tabs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gutenye / react-mc / src / Tabs / Tab.js View on Github external
getDefaultFoundation() {
    // prettier-ignore
    return new MDCTabFoundation({
      addClass: helper.addClass('rootProps', this),
      removeClass: helper.removeClass('rootProps', this),
      registerInteractionHandler: helper.registerHandler('rootProps', this),
      deregisterInteractionHandler: helper.registerHandler('rootProps', this),
      getOffsetWidth: () => this.root_.offsetWidth,
      getOffsetLeft: () => this.root_.offsetLeft,
      notifySelected: () => {
        const tab = this
        this.props.onSelected_({detail: {tab}})
        this.props.onSelected(tab)
      }
    })
  }