Zoom controls read the viewer from context. Every change eases (unless smoothZoom is off) and keeps the page centred, or the point under the cursor once pages are wider than the view.
Anatomy
Usage
Zoom.In and Zoom.Out are disabled at the ends of zoomSteps, at the viewer’s minZoom / maxZoom, and while zoomLocked is set; Zoom.Mode exposes data-active and aria-pressed. For a slider, bind it to the viewer: bind:value={() => viewer.zoom, (z) => viewer.zoomTo(z)}.
API reference
Zoom.In
Renders a <button> (or your element via child) and accepts its HTML attributes.
No props of its own besides ref, child and children.
data-pdf-zoom-inZoom.Out
Renders a <button> (or your element via child) and accepts its HTML attributes.
No props of its own besides ref, child and children.
data-pdf-zoom-outZoom.Mode
Renders a <button> (or your element via child) and accepts its HTML attributes.
data-activedata-pdf-zoom-modeZoom.Select
Renders a <select> (or your element via child) and accepts its HTML attributes.
data-pdf-zoom-select