This example shows how to use the Leaflet SplitMap slider with ipyleaflet.
from ipyleaflet import (
Map, TileLayer, SplitMapControl
)
center = [34.6252978589571, -77.34580993652344]
zoom = 10
m = Map(center=center, zoom=zoom)
m
left = TileLayer(url='https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png')
right = TileLayer(url='https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png')
control = SplitMapControl(left_layer=left, right_layer=right)
m.add_control(control)