Zoom Controls provide buttons to let the user zoom in and out of the current view, as well as show the current level of zoom.
Usage
accessibleText is deprecated in SWAN 3.24. This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system and remove this prop.
children prop in ZoomControlsValue is deprecated in SWAN v3.24, instead pass numeric zoom value to the value prop
The preview has been updated.
Disabled
Use disabled on Zoom Control button when its action is at its boundary (e.g., max or min zoom)
The preview has been updated.
Accessibility
If you’re not using SWAN’s i18n system, ZoomControls requires you to set some accessibility props for a11y compliance:
- The
accessibleTextprop is required on sub componentsZoomControlsIn,ZoomControlsOutandZoomControlsValue. These should be set to localized text that describes the button to the user e.g. "Zoom in", "Zoom out" and some text for the current zoom value "Current zoom level: 100%" respectively.