Import maticonmodule from angular material icon.
Mat raised button with icon.
The default background color for mat button and mat raised button matches the theme s background color.
Follow the following steps to update the angular application we created in angular 6 project setup chapter.
According to the material design spec button text has to be.
When you want to perform an action in webpage use button and use an anchor tag to navigate to other pages.
Specifies an button s icon.
Angular material button module matbuttonmodule mat button mat raised button mat icon button mat fab mat mini fab enhances the user experience of normal buttons button and anchor a tags by following material design principles.
The icon is set to 18px to meet legibility requirements.
In this chapter we will showcase the configuration required to draw a button control using angular material.
There are 7 types of buttons mentioned on angular material design official website.
Stop propagation of the onclick event.
To add an icon add an element with the mdc button icon class inside the button element and set the attribute aria hidden true.
The mat button an angular directive is used to create a button with material styling and animations.
We have to import maticonmodule from angular material modules.
Mat icon is part of angular material module called maticonmodule we can use font ligature as an icon by putting the ligature text in mat icon component.
Contained buttons can place icons next to text labels to both clarify an action and call attention to a button.
Buttons can be colored in terms of the current theme using the color property to set the background color to primary accent or warn by default only fabs floating action button are colored.
The primary button type is raised button type provided by angular material design when we talk about high click through rate ctr then there is no best option available option then the raised button in material design.
For example mat icon home mat icon displays home icon.
Button has outlined style.
The icon is set to 18px to meet legibility requirements.
Ui component infrastructure and material design components for mobile and desktop angular web applications.