Materialize Bridge Docs
v1
v1
  • Intro
  • 1. About this application
    • 1.1 Introduction
    • 1.2 Navigation guide
    • 1.3 Components catalog
    • 1.4 Internal Structure
    • 1.5 Installation
    • 1.6 Project status
    • 1.7 Color switcher
  • 2. Installation
    • Webpack, Aurelia-CLI (Webpack)
    • JSPM
    • Aurelia-CLI (require)
    • Fuse-box 2.x
  • 3. App developers tutorial
    • 3.1 Introduction
    • 3.2 Setup
    • 3.3 Select component
    • 3.4 Button component
    • 3.5 Slider component
    • 3.6 Collapsible component
    • 3.7 What you need to know
  • 4. App developers notes
    • 4.1 On bundling
    • 4.2 Using your own SASS with JSPM
  • 5. Contributing (bridge developers notes)
    • Cloning and running the code
    • Creating samples
  • 6. About Aurelia
    • 5.1 Key Features
  • 7. About Materialize
    • 7.1 Integrated with Aurelia
    • 7.2 Why choose Materialize
Powered by GitBook
On this page
  • Getting the plugin
  • You are done!
  1. 2. Installation

Webpack, Aurelia-CLI (Webpack)

Previous2. InstallationNextJSPM

Last updated 7 years ago

Getting the plugin

In your project install the plugin via npm with the following command:

npm install --save aurelia-validation aurelia-typed-observable-plugin tslib
npm install --save aurelia-materialize-bridge materialize-css@next @types/materialize-css
  1. Make sure you use . In order to do so open your index.html and locate the element with the attribute aurelia-app:

    <body aurelia-app="main">

    For Material Design icons include this in your index.html head section:

     <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  2. Update main.js in your src folder with following content:

    import {PLATFORM} from 'aurelia-pal';  
    import 'materialize-css';
    
    export function configure(aurelia) {
      aurelia.use
        .standardConfiguration()
        .developmentLogging()
        // Install and configure the plugin
        .plugin(PLATFORM.moduleName('aurelia-materialize-bridge'), b => b.useAll());
    
      return aurelia.start().then(a => a.setRoot());
    }

    Note: The above shows how to use all available controls at once. If you choose to pick which you'd like to use, you can use single components like this:

    .plugin(PLATFORM.moduleName('aurelia-materialize-bridge'), bridge => {
     bridge
       .useButton()
       .useCollapsible()
       .useModal()
       .useTabs();
    });

    At the end of this page is a full list of currently available options.

  3. Import css:

    <require from="materialize-css/dist/css/materialize.css"></require>

You are done!

It is now possible to drop some custom-elements into your DOM. See the other pages on this website for detailed information on how to do this.

As described above, here is a full list of currently available options:

aurelia.use.plugin(PLATFORM.moduleName('aurelia-materialize-bridge'), bridge => {
  bridge
    .useAutoComplete()
    .useBadge()
    .useBox()
    .useBreadcrumbs()
    .useButton()
    .useAutoButtonWaves(true)
    .useCard()
    .useCarousel()
    .useCharacterCounter()
    .useCheckbox()
    .useChip()
    .useCollapsible()
    .useCollection()
    .useColors()
    .useDatePicker()
    .useDropdown()
    .useFab()
    .useFile()
    .useFooter()
    .useInput()
    .useLookup()
    .useModal()
    .useNavbar()
    .usePagination()
    .useParallax()
    .useProgress()
    .usePushpin()
    .useRadio()
    .useRange()
    .useScrollSpy()
    .useSelect()
    .useSidenav()
    .useSlider()
    .useSwitch()
    .useTabs()
    .useTapTarget()
    .useTimePicker()
    .useTooltip()
    .useWaitCursor()
    .useWaves()
    .useWell();
});

. And the for it.

Now you might want to do our , based on Aurelia Skeleton navigation.

manual bootstrapping
Look here for a working example
source
app developers tutorial