|
1 | 1 | # Button
|
2 | 2 |
|
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. |
4 | 4 |
|
5 | 5 | <!-- example -->
|
6 | 6 | ```
|
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 | +); |
22 | 18 | ```
|
23 | 19 |
|
24 | 20 | ## Properties
|
25 | 21 |
|
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.| |
0 commit comments