Skip to content

Commit 6486b80

Browse files
committed
Complete button docs
1 parent 484db1e commit 6486b80

File tree

2 files changed

+36
-35
lines changed

2 files changed

+36
-35
lines changed

components/button/readme.md

Lines changed: 25 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,34 @@
11
# Button
22

3-
A button clearly communicates what action will occur when the user touches it. It consists of text, an image, or both, designed in accordance with your app’s color theme.
3+
A [button](https://www.google.com/design/spec/components/buttons.html) clearly communicates what action will occur when the user touches it. It consists of text, an image, or both, designed in accordance with your app’s color theme.
44

55
<!-- example -->
66
```
7-
class Test extends React.Component {
8-
render () {
9-
return (
10-
<div>
11-
<Button label="Flat button" />
12-
<Button kind="raised" label="Raised" />
13-
<Button kind="raised" label="Raised accent" accent icon="favorite" />
14-
<Button className="primary" kind="floating" icon="add" />
15-
<Button mini kind="floating" icon="add" accent />
16-
</div>
17-
);
18-
}
19-
}
20-
21-
return <Test />;
7+
import Button from 'react-toolbox/button';
8+
9+
const TestButtons = () => (
10+
<div>
11+
<Button label="Flat button" />
12+
<Button kind="raised" label="Raised" />
13+
<Button kind="raised" label="Raised accent" accent icon="favorite" />
14+
<Button className="primary" kind="floating" icon="add" />
15+
<Button mini kind="floating" icon="add" accent />
16+
</div>
17+
);
2218
```
2319

2420
## Properties
2521

26-
| Name | Type | Default | Description|
27-
|:- |:-: | :- |:-|
28-
| **className** | String | | Set the class-styles of the Component.|
29-
| **disabled** | Boolean | | If true, component will be disabled.|
30-
| **icon** | String | | Default value using JSON data.|
31-
| **label** | String | | The text string to use for the floating label element.|
32-
| **loading** | Boolean | | If true, component will be disabled and show a loading animation.|
33-
| **ripple** | Boolean | | If true, component will have a ripple effect on click.|
34-
| **type** | String | "flat" | Type of the component, overwrite this property if you need set a different stylesheet.|
35-
36-
## Methods
37-
38-
#### loading
39-
If true, component will be disabled and show a loading animation.
40-
41-
```
42-
input_instance.loading(true);
43-
```
22+
| Name | Type | Default | Description|
23+
|:- |:-: | :- |:-|
24+
| accent | `Bool` | `false` | Indicates if the button should have accent color.|
25+
| className | `String` | `''` | Set a class to style the Component.|
26+
| disabled | `Boolean` | `false` | If true, component will be disabled.|
27+
| icon | `String` | | Value of the icon (See icon component). |
28+
| kind | `String` | `flat` | Type of the component, overwrite this property if you need set a different stylesheet.|
29+
| label | `String` | | The text string to use for the name of the button.|
30+
| loading | `Boolean` | `false` | If true, component will be disabled and show a loading animation.|
31+
| mini | `Boolean` | `false` | To be used with floating button. If true the button will be smaller.|
32+
| onClick | `Function` | | Callback called when the button is clicked.|
33+
| primary | `false` | | If true, component will have the primary color.|
34+
| ripple | `Boolean` | `true` | If true, component will have a ripple effect on click.|
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
return <Button label='Button example loaded' />
1+
const ButtonsTest = () => (
2+
<div>
3+
<Button label="Flat button" />
4+
<Button kind="raised" label="Raised" />
5+
<Button kind="raised" label="Raised accent" accent icon="favorite" />
6+
<Button className="primary" kind="floating" icon="add" />
7+
<Button mini kind="floating" icon="add" accent />
8+
</div>
9+
);
10+
11+
return <ButtonsTest />

0 commit comments

Comments
 (0)