@@ -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
3535You can import react-card-flipper into your React app. The following is a bare
3636bones example.
3737
38+ > ** Important:** The ` <ReactCardFlipper> ` component must have two ` <div> ` elements, one for the front and one for the back.
39+
3840``` js
3941import React from ' react' ;
4042import 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
6062how 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
7073render () {
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>
0 commit comments