Skip to content

Commit c661a72

Browse files
committed
Add levitate documentation
1 parent 06c3155 commit c661a72

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ component.
2424
| Chrome >= 38 || |
2525
| Edge >= 14 || |
2626
| Firefox >= 16 | ✅‍ | |
27-
| IE 11-10 | ⚠️ | Animations are disabled for compatibility |
27+
| IE 11-10 | ⚠️ | Card flips have no animation |
2828
| IE 9.0 || No toggling of cards |
2929
| Opera >= 30 || |
3030
| Safari >= 6.2.8 || |
31-
| Safari 6.0.5 | ⚠️ | Card flip has no animation |
31+
| Safari 6.0.5 | ⚠️ | Card flips have no animation |
3232

3333

3434
## Getting Started
3535
You can import react-card-flipper into your React app. The following is a bare
3636
bones example.
3737

38+
> **Important:** The `<ReactCardFlipper>` component must have two `<div>` elements, one for the front and one for the back.
39+
3840
```js
3941
import React from 'react';
4042
import ReactDOM from 'react-dom';
@@ -56,26 +58,27 @@ ReactDOM.render(
5658
```
5759

5860
## Props and Options
59-
The `ReactCardFlipper` component has 3 props it accepts that you can use to adjust
61+
The `ReactCardFlipper` component has 4 props it accepts that you can use to adjust
6062
how your card behaves.
6163

62-
| Prop / Option | Accepted Prop(s) | Default |
63-
| ------------- |:---------------------------:|--------:|
64-
| `width` | String (ex: `300px`) | `auto` |
65-
| `height` | String (ex: `600px`) | `auto` |
66-
| `behavior` | String (`click` or `hover`) | `click` |
64+
| Prop / Option | Accepted Prop(s) | Default | Description |
65+
| ------------- |:---------------------------:|:-------:| ----------- |
66+
| `width` | String (ex: `300px`) | `auto` | Card width. |
67+
| `height` | String (ex: `600px`) | `auto` | Card height. |
68+
| `behavior` | String (`click` or `hover`) | `click` | If the card should click to flip, or hover to flip. |
69+
| `levitate` | Boolean | `false` | If the card should "levitate" up on hover. Only applied when `behavior` is `click`. |
6770

6871
#### Example:
6972
```js
7073
render() {
7174
return(
7275
<div>
73-
<ReactCardFlipper width="300px" height="550px" behavior="hover">
76+
<ReactCardFlipper width="300px" height="550px" behavior="click" levitate={true}>
7477
<div>
75-
<h3>Hover me to learn more</h3>
78+
<h3>Click me to learn more</h3>
7679
</div>
7780
<div>
78-
<p>You hovered! Keep that knowledge growing...</p>
81+
<p>You Clicked!</p>
7982
</div>
8083
</ReactCardFlipper>
8184
</div>

ReactCardFlipper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import './ReactCardFlipper.css';
1010
* Width: string (default: auto)
1111
* Height: string (default: auto)
1212
* behavior: click, hover (default: click)
13-
* levitate: boolean (default: false, only works when clicked)
13+
* levitate: boolean (default: false, only works when behavior is set to `click`)
1414
**/
1515

1616
class ReactCardFlipper extends Component {

0 commit comments

Comments
 (0)