
Security News
Potemkin Understanding in LLMs: New Study Reveals Flaws in AI Benchmarks
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
react-compare-slider
Advanced tools
A slider component to compare any two React components in landscape or portrait orientation. It supports custom images, videos... and everything else.
picture
, canvas
, iframe
etc.)yarn add react-compare-slider
# OR
npm install react-compare-slider
You may use ReactCompareSliderImage
to render images or use your own custom
components.
import { ReactCompareSlider, ReactCompareSliderImage } from 'react-compare-slider';
<ReactCompareSlider
itemOne={<ReactCompareSliderImage src="..." srcSet="..." alt="Image one" />}
itemTwo={<ReactCompareSliderImage src="..." srcSet="..." alt="Image two" />}
/>
See the Images docs for more information and demos.
Prop | Type | Required | Default value | Description |
---|---|---|---|---|
handle | ReactNode | undefined | Custom handle component | |
itemOne | ReactNode | ✓ | undefined | First component to show in slider |
itemTwo | ReactNode | ✓ | undefined | Second component to show in slider |
onPositionChange | function | undefined | Callback on position change, returns current position as argument (position) => { ... } | |
position | number | 50 | Initial percentage position of divide (0-100 ) | |
portrait | boolean | false | Whether to use portrait orientation |
See the API docs for more information.
The library supports all types of React components; custom components can apply
the same base styles as ReactCompareSliderImage
by using the
styleFitContainer
CSS utility.
See the styleFitContainer docs for more information.
See the Handles docs for more information.
Bootstrapped with TSDX.
FAQs
A slider component to compare any two React components in landscape or portrait orientation. It supports custom images, videos... and everything else.
The npm package react-compare-slider receives a total of 36,123 weekly downloads. As such, react-compare-slider popularity was classified as popular.
We found that react-compare-slider demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.