-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add recipies and
transition
prop examples
- Loading branch information
Showing
9 changed files
with
137 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Canvas, Meta, Story } from '@storybook/blocks'; | ||
|
||
import { ReactCompareSlider, ReactCompareSliderImage } from 'react-compare-slider'; | ||
|
||
<Meta title="Docs/Transition" component={ReactCompareSlider} /> | ||
|
||
# Using `transition` | ||
|
||
The `transition` property applies a CSS transition when the slider is moved. The shorthand CSS | ||
property syntax is used **without** the `transition-property` value. The library sets which property | ||
to apply the transition to internally. | ||
|
||
You may notice that the slider sometimes moves immediately to the new position, this is because the | ||
transition only applies to `pointerdown` events to ensure the dragging movement of the slider is smooth. | ||
This means the transition will be cancelled if `pointerdown` is followed by a `pointermove` event. | ||
|
||
```jsx | ||
<ReactCompareSlider | ||
transition="0.25s cubic-bezier(.17,.67,.83,.67)" | ||
/> | ||
``` | ||
|
||
<Canvas> | ||
<Story id="demos--transition" /> | ||
</Canvas> | ||
|
||
## Live Examples | ||
|
||
Checkout the [Transition example](/story/demos--transition). |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters