Skip to content

docs: add README files for experimental packages #15933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cdk-experimental/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Angular CDK Experimental

This package contains prototypes and experiments in development for Angular CDK. Nothing in
this package is considered stable or production ready. While the package releases with Angular
CDK, breaking changes may occur with any release.
64 changes: 64 additions & 0 deletions src/material-experimental/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Angular Material Experimental

This package contains prototypes and experiments in development for Angular Material. Nothing in
this package is considered stable or production ready. While the package releases with Angular
Material, breaking changes may occur with any release.

## Using the experimental components based on MDC Web
Assuming your application is already up and running using Angular Material, you can add this
component by following these steps:

1. Install Angular Material Experimental & MDC WEB:

```bash
npm i material-components-web @angular/material-experimental
```

2. In your `angular.json`, make sure `node_modules/` is listed as a Sass include path. This is
needed for the Sass compiler to be able to find the MDC Web Sass files.

```json
...
"styles": [
"src/styles.scss"
],
"stylePreprocessorOptions": {
"includePaths": [
"node_modules/"
]
},
...
```

3. Import the `NgModule` for the component you want to use. For example, the checkbox:
```ts
import {MatCheckboxModule} from '@angular/material-experimental/mdc-checkbox';

@NgModule({
declarations: [MyComponent],
imports: [MatCheckboxModule],
})
export class MyModule {}
```

4. Add use the components just as you would the normal Angular Material components. For example,
the checkbox:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant newline.

```html
<mat-checkbox [checked]="isChecked">Check me</mat-checkbox>
```

5. Add the theme and typography mixins to your Sass. These align with the normal Angular Material
mixins except that they are suffixed with `-mdc`. There is currently no pre-built CSS option for
the experimental components. For example, using the checkbox:

```scss
@import '~@angular/material/theming';
@import '~@angular/material-experimental/mdc-checkbox';

$my-primary: mat-palette($mat-indigo);
$my-accent: mat-palette($mat-pink, A200, A100, A400);
$my-theme: mat-light-theme($my-primary, $my-accent);

@include mat-checkbox-theme-mdc($my-theme);
@include mat-checkbox-typography-mdc();
```