Convert Figma logo to code with AI

angular logocomponents

Component infrastructure and Material Design components for Angular

24,317
6,722
24,317
2,103

Top Related Projects

Modular and customizable Material Design UI components for the web

39,623

🐉 Vue Component Framework

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

An enterprise-class UI design language and React UI library

10,152

The Most Complete Angular UI Component Library

Angular powered Bootstrap

Quick Overview

Angular Material is a UI component library for Angular applications, providing a set of reusable, well-tested, and accessible components. It implements Google's Material Design specification and is developed and maintained by the Angular team at Google, ensuring seamless integration with Angular applications.

Pros

  • Comprehensive set of pre-built, customizable components
  • Follows Material Design guidelines for consistent and modern UI
  • Excellent documentation and community support
  • Seamless integration with Angular framework

Cons

  • Learning curve for developers new to Material Design concepts
  • Can be opinionated in terms of design, which may not fit all project requirements
  • Performance overhead for smaller applications that don't need all components
  • Regular updates may require occasional migration efforts

Code Examples

  1. Using a Material button:
import { MatButtonModule } from '@angular/material/button';

@Component({
  selector: 'app-button-example',
  template: '<button mat-raised-button color="primary">Click me!</button>',
  standalone: true,
  imports: [MatButtonModule],
})
export class ButtonExampleComponent {}
  1. Implementing a Material form field with input:
import { MatInputModule } from '@angular/material/input';
import { MatFormFieldModule } from '@angular/material/form-field';

@Component({
  selector: 'app-input-example',
  template: `
    <mat-form-field>
      <mat-label>Enter your name</mat-label>
      <input matInput placeholder="John Doe">
    </mat-form-field>
  `,
  standalone: true,
  imports: [MatInputModule, MatFormFieldModule],
})
export class InputExampleComponent {}
  1. Creating a Material dialog:
import { MatDialogModule } from '@angular/material/dialog';

@Component({
  selector: 'app-dialog-example',
  template: '<button (click)="openDialog()">Open Dialog</button>',
  standalone: true,
  imports: [MatDialogModule],
})
export class DialogExampleComponent {
  constructor(public dialog: MatDialog) {}

  openDialog() {
    this.dialog.open(DialogContentComponent);
  }
}

@Component({
  selector: 'app-dialog-content',
  template: '<h2 mat-dialog-title>Dialog Title</h2><p>Dialog content goes here.</p>',
  standalone: true,
  imports: [MatDialogModule],
})
export class DialogContentComponent {}

Getting Started

  1. Install Angular Material:

    ng add @angular/material
    
  2. Import desired modules in your component:

    import { MatButtonModule } from '@angular/material/button';
    import { MatInputModule } from '@angular/material/input';
    
    @Component({
      // ...
      imports: [MatButtonModule, MatInputModule],
    })
    export class MyComponent {}
    
  3. Use Material components in your template:

    <button mat-raised-button color="primary">Click me!</button>
    <mat-form-field>
      <input matInput placeholder="Enter text">
    </mat-form-field>
    

Competitor Comparisons

Modular and customizable Material Design UI components for the web

Pros of Material Components Web

  • Framework-agnostic, can be used with any JavaScript framework or vanilla JS
  • Closer to the Material Design specification, providing a more authentic Material Design experience
  • Lighter weight and potentially better performance due to less abstraction

Cons of Material Components Web

  • Less integration with Angular-specific features and ecosystem
  • May require more manual setup and configuration for Angular projects
  • Potentially steeper learning curve for developers already familiar with Angular Components

Code Comparison

Material Components Web:

<button class="mdc-button">
  <span class="mdc-button__ripple"></span>
  <span class="mdc-button__label">Button</span>
</button>

Angular Components:

<button mat-button>Button</button>

The Material Components Web example requires more markup but offers more granular control over the button's structure. The Angular Components version is more concise and integrates seamlessly with Angular's template syntax.

Both libraries provide comprehensive Material Design implementations, but they cater to different use cases. Material Components Web offers flexibility across various frameworks, while Angular Components provides a more integrated experience for Angular developers. The choice between them depends on project requirements, developer expertise, and the desired level of Angular integration.

39,623

🐉 Vue Component Framework

Pros of Vuetify

  • Larger ecosystem with more pre-built components and layouts
  • Easier learning curve for developers new to Vue.js
  • More flexible theming system with built-in Material Design support

Cons of Vuetify

  • Potentially larger bundle size due to comprehensive component library
  • Less granular control over individual component styles
  • May require more configuration for highly customized designs

Code Comparison

Vuetify component usage:

<template>
  <v-btn color="primary" @click="handleClick">
    Click me
  </v-btn>
</template>

Angular Components usage:

<button mat-raised-button color="primary" (click)="handleClick()">
  Click me
</button>

Both libraries offer similar component-based approaches, but Vuetify tends to use more Vue-specific syntax and directives, while Angular Components align closely with Angular's template syntax.

Vuetify provides a more opinionated structure with its v-prefixed components, whereas Angular Components often use attributes to define component types. This difference reflects the underlying framework philosophies, with Vue.js favoring a more flexible approach and Angular emphasizing a more structured development experience.

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.

Pros of Material-UI

  • Larger ecosystem with more third-party components and extensions
  • More comprehensive documentation and examples
  • Better theming capabilities with a more flexible customization system

Cons of Material-UI

  • Steeper learning curve due to its extensive API and features
  • Larger bundle size, which may impact initial load times
  • Less tight integration with the framework (React) compared to Angular Components

Code Comparison

Material-UI (React):

import Button from '@mui/material/Button';

function App() {
  return <Button variant="contained">Hello World</Button>;
}

Angular Components:

import { MatButtonModule } from '@angular/material/button';

@Component({
  template: '<button mat-raised-button>Hello World</button>',
  imports: [MatButtonModule],
})
export class AppComponent {}

Both libraries provide similar component APIs, but Material-UI uses React's component-based approach, while Angular Components integrates more closely with Angular's template syntax and module system.

Material-UI offers a wider range of customization options out of the box, but Angular Components benefits from tighter framework integration. The choice between them often depends on the preferred framework (React vs Angular) and specific project requirements.

An enterprise-class UI design language and React UI library

Pros of Ant Design

  • Larger ecosystem with more components and design resources
  • Better documentation and examples
  • More flexible theming system

Cons of Ant Design

  • Steeper learning curve due to more complex API
  • Larger bundle size
  • Less integration with Angular-specific features

Code Comparison

Ant Design (React):

import { Button } from 'antd';

const MyComponent = () => (
  <Button type="primary">Click me</Button>
);

Angular Components:

import { MatButtonModule } from '@angular/material/button';

@Component({
  template: '<button mat-button color="primary">Click me</button>',
  imports: [MatButtonModule],
})
export class MyComponent {}

Summary

Ant Design offers a more comprehensive UI library with extensive documentation and theming options, making it suitable for large-scale projects. However, it comes with a steeper learning curve and larger bundle size. Angular Components, while more limited in scope, provides tighter integration with Angular and a simpler API. The choice between the two depends on project requirements, team expertise, and performance considerations.

10,152

The Most Complete Angular UI Component Library

Pros of PrimeNG

  • Offers a wider range of pre-built UI components, including complex ones like data tables and charts
  • Provides a comprehensive theming system with multiple built-in themes and easy customization
  • Includes a set of ready-to-use templates and layouts for rapid application development

Cons of PrimeNG

  • May have a steeper learning curve due to its extensive component library and features
  • Can potentially increase bundle size if not properly optimized, especially when using many components
  • Less tightly integrated with Angular's core ecosystem compared to Angular Material

Code Comparison

PrimeNG button example:

<p-button label="Click me" icon="pi pi-check" (onClick)="handleClick()"></p-button>

Angular Material button example:

<button mat-raised-button color="primary" (click)="handleClick()">
  <mat-icon>check</mat-icon>
  Click me
</button>

Both libraries offer similar functionality, but PrimeNG tends to use more declarative syntax with custom elements, while Angular Material often relies on directives and Angular's template syntax. PrimeNG's approach may be more intuitive for some developers, especially those coming from other component libraries.

Angular powered Bootstrap

Pros of ng-bootstrap

  • Lightweight and focused specifically on Bootstrap integration
  • Easier learning curve for developers familiar with Bootstrap
  • More frequent updates and releases

Cons of ng-bootstrap

  • Smaller community and less comprehensive documentation
  • Limited to Bootstrap-specific components and functionality
  • Less extensive set of components compared to Angular Material

Code Comparison

ng-bootstrap:

import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

@NgModule({
  imports: [NgbModule],
  // ...
})
export class AppModule { }

components:

import { MatButtonModule } from '@angular/material/button';

@NgModule({
  imports: [MatButtonModule],
  // ...
})
export class AppModule { }

Summary

ng-bootstrap is ideal for projects that heavily rely on Bootstrap and want to maintain consistency with its design principles. It offers a smoother transition for developers already familiar with Bootstrap.

components (Angular Material) provides a more comprehensive set of components and tools, with deeper integration into the Angular ecosystem. It's better suited for larger, more complex applications that require a wide range of UI components and customization options.

The choice between the two depends on project requirements, team expertise, and design preferences. ng-bootstrap is great for Bootstrap-centric projects, while components offers a more robust and versatile solution for Angular applications.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Official components for Angular

npm version Build status Gitter

The Angular team builds and maintains both common UI components and tools to help you build your own custom components. The team maintains several npm packages.

PackageDescriptionDocs
@angular/cdkLibrary that helps you author custom UI components with common interaction patternsDocs
@angular/materialMaterial Design UI components for Angular applicationsDocs
@angular/google-mapsAngular components built on top of the Google Maps JavaScript APIDocs
@angular/youtube-playerAngular component built on top of the YouTube Player APIDocs

Quick links

Documentation, demos, and guides | Frequently Asked Questions | Community Google group | Contributing | StackBlitz Template

Getting started

See our Getting Started Guide if you're building your first project with Angular Material.

Contributing

If you'd like to contribute, please follow our contributing guidelines. Please see our help wanted label for a list of issues with good opportunities for contribution. You can also use the good first issue label to find issues if you are just starting to contribute to the project.

About the team

The Angular Components team is part of the Angular team at Google. The team includes both Google employees and community contributors from around the globe.

Our team has two primary goals:

  • Build high-quality UI components that developers can drop into existing applications
  • Provide tools that help developers build their own custom components with common interaction patterns

What do we mean by "high-quality" components?

  • Internationalized and accessible so that all users can use them.
  • Straightforward APIs that don't confuse developers.
  • Behave as expected across a wide variety of use-cases without bugs.
  • Behavior is well-tested with both unit and integration tests.
  • Customizable within the bounds of the Material Design specification.
  • Performance cost is minimized.
  • Code is clean and well-documented to serve as an example for Angular developers.

Browser and screen reader support

The Angular Components team supports the most recent two versions of all major browsers: Chrome (including Android), Firefox, Safari (including iOS), and Edge.

We aim for great user experience with the following screen readers:

  • Windows: NVDA and JAWS with FF / Chrome.
  • macOS: VoiceOver with Safari / Chrome.
  • iOS: VoiceOver with Safari
  • Android: Android Accessibility Suite (formerly TalkBack) with Chrome.
  • Chrome OS: ChromeVox with Chrome.

NPM DownloadsLast 30 Days