Skip to content

Issue with Button Directive Naming: matButton vs mat-button #31297

Closed
@tiagoHRTN

Description

@tiagoHRTN

Describe the problem that you experienced

Hi team,

I'm currently working with Angular Material and noticed a possible inconsistency between the documentation and actual usage of the button directive.

In the documentation, it mentions that we should use matButton on elements, but in practice, it only works if I use mat-button (with a hyphen). When I try using matButton, Angular throws an error saying the directive is not recognized.

I believe this might be confusing for new users and could lead to unnecessary debugging. Could the docs be updated to clarify that the correct usage in templates is mat-button, not matButton?

Thanks for the amazing work on Angular!

Best regards,

Tiago M. Rodrigues

Enter the URL of the topic with the problem

No response

Describe what you were looking for in the documentation

https://material.angular.dev/components/button/overview

Describe the actions that led you to experience the problem

We had an issue when trying to style a button using Angular Material. Nothing was working until we found an example that used mat-button with a hyphen. Using matButton (as shown in some places) didn’t work.

Describe what you want to experience that would fix the problem

No response

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here


If the problem is browser-specific, please specify the device, OS, browser, and version


Provide any additional information here in as much as detail as you can


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions