Skip to content

Commit 7d9c9fb

Browse files
author
Matt Goo
authored
docs: readme updates (material-components#29)
1 parent ab1dd13 commit 7d9c9fb

File tree

12 files changed

+162
-35
lines changed

12 files changed

+162
-35
lines changed

packages/button/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1-
# React Material Icon
1+
# React Button
22

3-
MDC React Material Icon is a component for material icons.
3+
MDC React Button is a component for MDC buttons. Please see [MDC Button](https://github.com/material-components/material-components-web/tree/master/packages/mdc-button).
44

55
## Installation
66

77
```
88
npm install @material/react-button
99
```
1010

11+
## Usage
12+
13+
```js
14+
import React from 'react';
15+
import Button from '@material/react-button';
16+
17+
class MyApp extends React.Component {
18+
render() {
19+
return (
20+
<Button>
21+
Click Me!
22+
</Button>
23+
);
24+
}
25+
}
26+
```
27+
1128
## Props
1229

1330
Prop Name | Type | Description
@@ -19,3 +36,10 @@ stroked | n/a | Enables stroked variant.
1936
icon | Element | Icon to render within root element.
2037
children | String | Text to be displayed within root element.
2138
disabled | n/a | Disables button if true.
39+
40+
## Sass Mixins
41+
42+
Sass mixins may be available to customize various aspects of the Components. Please refer to the
43+
MDC Web repository for more information on what mixins are available, and how to use them.
44+
45+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-button/README.md#sass-mixins)

packages/button/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export class Button extends Component {
1313
icon,
1414
children,
1515
initRipple,
16-
// dismiss warning for converting to a string (for ripple)
1716
unbounded, // eslint-disable-line no-unused-vars
1817
...otherProps
1918
} = this.props;

packages/card/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# React Card
22

3-
MDC React Card is a component for material design cards.
3+
MDC React Card is a component for material design cards. Please see [MDC Cards](https://github.com/material-components/material-components-web/tree/master/packages/mdc-card).
44

55
## Installation
66

@@ -131,3 +131,11 @@ import {CardActionIcons} from '@material/react-card';
131131
<i onClick={ ... }>Icon 2</i>
132132
</CardActionIcons>
133133
```
134+
135+
136+
## Sass Mixins
137+
138+
Sass mixins may be available to customize various aspects of the Components. Please refer to the
139+
MDC Web repository for more information on what mixins are available, and how to use them.
140+
141+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-card/README.md#sass-mixins)

packages/fab/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ npm install @material/react-fab
1212

1313
### JSX Structure
1414

15-
The Fab can be used with the `span`, `i`, `img` or `svg` elements. It can also be used with the
16-
[Material Icon](../material-icon) react component.
15+
The Fab can be used with the `span`, `i`, `img` or `svg` elements. It can also be used with the
16+
[Material Icon](../material-icon) react component.
1717
```html
1818
<Fab>
1919
<span className="material-icons">favorite</span>
@@ -47,7 +47,7 @@ mini | n/a | Enables the mini variant.
4747

4848
## Sass Mixins
4949

50-
Sass mixins may be available to customize various aspects of the components. Please refer to the
50+
Sass mixins may be available to customize various aspects of the components. Please refer to the
5151
MDC Web repository for more information on what mixins are available, and how to use them.
5252

53-
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.34.1/packages/mdc-fab/README.md#advanced-sass-mixins)
53+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-fab/README.md#advanced-sass-mixins)

packages/floating-label/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ MDC React Floating Label is as a React container around MDC Floating Label. Plea
88
npm install @material/react-floating-label
99
```
1010

11-
## Props
12-
13-
Prop Name | Type | Description
14-
--- | --- | ---
15-
className | String | Classes to be applied to the root element.
16-
handleWidthChange | Function | Callback method to pass the width to a parent Component.
17-
float | Boolean | Floats label depending on value passed.
18-
1911
## Usage
2012

2113
### Positioning
@@ -27,6 +19,7 @@ React Floating Label is meant to be used with other Components, specifically inp
2719
To shake the label you'll need to add a _ref_ to the `<FloatingLabel />` element. Using the ref, you can then call `shake()` to start the shake animation. Ex:
2820

2921
```js
22+
import FloatingLabel from '@material/react-floating-label';
3023

3124
class MyComponent extends React.Component {
3225
constructor(props) {
@@ -62,10 +55,17 @@ Label width is set during mount, and is calculated from the `offsetWidth` proper
6255
</FloatingLabel>
6356
```
6457

58+
## Props
59+
60+
Prop Name | Type | Description
61+
--- | --- | ---
62+
className | String | Classes to be applied to the root element.
63+
handleWidthChange | Function | Callback method to pass the width to a parent Component.
64+
float | Boolean | Floats label depending on value passed.
6565

6666
## Sass Mixins
6767

6868
Sass mixins may be available to customize various aspects of the components. Please refer to the
6969
MDC Web repository for more information on what mixins are available, and how to use them.
7070

71-
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.34.1/packages/mdc-fab/README.md#advanced-sass-mixins)
71+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-floating-label/README.md#scss-mixins)

packages/line-ripple/README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
# React Line Ripple
22

3-
MDC React Line Ripple is a component for material icons.
3+
MDC React Line Ripple is a component for MDC Line Ripple. Please see [MDC Line Ripple](https://github.com/material-components/material-components-web/tree/master/packages/mdc-line-ripple).
44

55
## Installation
66

77
```
88
npm install @material/react-line-ripple
99
```
1010

11+
## Usage
12+
13+
```js
14+
import LineRipple from '@material/react-line-ripple';
15+
16+
const MyComponent = () => {
17+
return (
18+
<LineRipple />
19+
);
20+
}
21+
```
22+
1123
## Props
1224

1325
Prop Name | Type | Description
@@ -16,3 +28,10 @@ active | boolean | Activates or deactivates the line ripple state.
1628
className | string | Classes to be applied to the root element.
1729
rippleCenter | number | Sets the center of the ripple animation.
1830
style | object | Inline styles of root element.
31+
32+
## Sass Mixins
33+
34+
Sass mixins may be available to customize various aspects of the components. Please refer to the
35+
MDC Web repository for more information on what mixins are available, and how to use them.
36+
37+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-line-ripple/README.md#sass-mixins)

packages/material-icon/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ MDC React Material Icon is a component for material icons.
88
npm install @material/react-material-icon
99
```
1010

11+
## Usage
12+
13+
```js
14+
import MaterialIcon from '@material/react-material-icon';
15+
16+
const MyComponent = () => {
17+
return (
18+
<MaterialIcon icon='menu' />
19+
);
20+
}
21+
```
22+
1123
## Props
1224

1325
Prop Name | Type | Description

packages/notched-outline/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
# React Notched Outline
22

3-
MDC React Notched Outline is a React Component which uses MDC [MDC Notched Outline](https://github.com/material-components/material-components-web/tree/master/packages/mdc-notched-outline)'s CSS and foundation JavaScript.
3+
MDC React Notched Outline is a component for MDC Notched Outline. Please see [MDC Notched Outline](https://github.com/material-components/material-components-web/tree/master/packages/mdc-notched-outline).
44

55
## Installation
66

77
```
88
npm install @material/react-notched-outline
99
```
1010

11+
## Usage
12+
13+
```js
14+
import NotchedOutline from '@material/react-notched-outline';
15+
16+
const MyComponent = () => {
17+
return (
18+
<NotchedOutline />
19+
);
20+
}
21+
```
22+
1123
## Props
1224

1325
Prop Name | Type | Description
@@ -22,4 +34,4 @@ notchWidth | Number | Width of the notch in the outline.
2234
Sass mixins may be available to customize various aspects of the Components. Please refer to the
2335
MDC Web repository for more information on what mixins are available, and how to use them.
2436

25-
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.34.1/packages/mdc-top-app-bar/README.md)
37+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-notched-outline/README.md#sass-mixins)

packages/ripple/README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
# React Ripple
22

3-
MDC React Ripple is a component for material icons.
3+
MDC React Ripple is a component for MDC Ripple. Please see [MDC Ripple](https://github.com/material-components/material-components-web/tree/master/packages/mdc-ripple).
44

55
## Installation
66

77
```
88
npm install @material/react-ripple
99
```
1010

11-
12-
## Props
13-
14-
Prop Name | Type | Description
15-
--- | --- | ---
16-
unbounded | boolean | Ripple is unbounded if true.
17-
disabled | n/a | Disables ripple if true.
18-
style | object | Inline styles of root element.
19-
className | string | Classes to appear on className attribute of root element.
20-
2111
## Usage
2212

2313
To wrap a component with the ripple HOC, please follow this example:
@@ -57,3 +47,20 @@ const RippleIcon = withRipple(Icon);
5747

5848
Wrap your Icon component with the HOC `withRipple`, which returns a component
5949
with a ripple capable surface.
50+
51+
## Props
52+
53+
Prop Name | Type | Description
54+
--- | --- | ---
55+
unbounded | boolean | Ripple is unbounded if true.
56+
disabled | n/a | Disables ripple if true.
57+
style | object | Inline styles of root element.
58+
className | string | Classes to appear on className attribute of root element.
59+
60+
61+
## Sass Mixins
62+
63+
Sass mixins may be available to customize various aspects of the components. Please refer to the
64+
MDC Web repository for more information on what mixins are available, and how to use them.
65+
66+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-ripple/README.md#sass-apis)

packages/text-field/helper-text/README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
MDC React Text Field Helper Text is a React Component which uses MDC [MDC Text Field Helper Text](https://github.com/material-components/material-components-web/tree/master/packages/mdc-textfield/helper-text/)'s CSS and foundation JavaScript.
44

5+
## Usage
6+
7+
```js
8+
import HelperText from '@material/react-text-field/helper-text/index.js';
9+
10+
const MyComponent = () => {
11+
return (
12+
<HelperText>
13+
Really fun helper text
14+
</HelperText>
15+
);
16+
}
17+
```
18+
519
## Props
620

721
Prop Name | Type | Description
@@ -20,4 +34,4 @@ validation | Boolean | If true, alters the helper text to an error message.
2034
Sass mixins may be available to customize various aspects of the Components. Please refer to the
2135
MDC Web repository for more information on what mixins are available, and how to use them.
2236

23-
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-textfield/icon/README.md)
37+
[Advanced Sass Mixins](https://github.com/material-components/material-components-web/blob/v0.35.0/packages/mdc-textfield/helper-text/README.md#sass-mixins)

0 commit comments

Comments
 (0)