HomeLabHire Me
ml-ui111 components

Get started

IntroductionInstallation

UI

Dots

Dot AccordionDot CalendarDot CheckboxDot CodeDot CommandDot ContentsDot CountdownDot CrossingDot FuseDot GaugeDot InstallDot KnobDot LogosDot MenuDot PaginationDot PasswordDot Price RangeDot PricingDot ProgressDot QueueDot RatingDot Reading ProgressDot SelectDot SignupDot SliderDot StatusDot StepperDot SwitchDot TabsDot ToastDot TooltipFlip-Dot CounterLED Marquee

Dither

Dither AvatarDither BannerDither CompareDither GlobeDither PortraitDither SkeletonDither TrailDither UploadDot CookiesDot DialogDot KeysDot ReceiptDot VariantsLenticular Card

More

Pollen TrailSplit-FlapTheme Toggle

Text

Dither RotatorDot TypeEnigma TextInk Print

Data viz

Dots

Contribution FieldDot BarsDot ChartDot Waffle

Dither

Dither DensityDither MapDither Stack

Media

Dots

Dot EqualizerDot WaveformVoice Note

Dither

Dither Scrubber

AI

Agent StepsAnswer VersionsCitation ChipConfidence GlassContext MeterDiffusion ImageDiffusion TextDither MaskDoc ReaderDot DictationGenerate ButtonGhost TextModel PickerPrompt BarResponse ActionsRevising TextSpoken ReplyThinking OrbThinking TraceToken MeterToken StreamWord Alternatives

Useful

Arrival TimeBest ShotCareer LineForgiving SearchGesture PadHeard AsHonest PinImage PaletteLikeness GridNear Miss SearchRain DropsSoft CorrectSpending SortSticker LiftTaste Ledger

Backgrounds

ButterfliesDandelionsDuck PondFirefliesKoi PondLight WellMarigoldsTrain WindowWhite Blossom

ml-ui / UI

Dither Compare

Two pictures one over the other with a divider you drag across. The pictures stay exactly as they are, so the comparison is honest; only the seam is dithered, each cell in a narrow band showing one picture or the other at its blue-noise threshold, so the boundary reads as a stipple rather than a hard edge. The handle is a dotted line and a grip of dots. Drag anywhere, click to jump, or use the arrow keys; it nudges itself once when it first comes into view, to say it moves.

Needs: None. Canvas 2D.

Demo photos by Linh Nguyen and Kenneth Thewissen on Unsplash

Customize

Props

PropTypeDefaultDescription
beforestringrequiredThe picture on the left.
afterstringrequiredThe picture on the right.
altstringrequiredWhat the two show, for screen readers.
labels[string, string]–Names in the corners.
defaultPositionnumber0.5Where the divider starts, 0 to 1.
onChange(position: number) => void–Called as the divider moves.
aspectnumber1.5Width over height.
cellnumber3Size of one dither cell in the seam, in px.
seamnumber28How wide the dithered seam is, in px.
classNamestring–Class on the comparison.
styleCSSProperties–Style on the comparison.
← Dither BannerDither Globe →