The CropperCrosshair element is used to display a crosshair overlay within a cropper interface. It can be used as a standalone element or nested within other components like CropperCanvas or CropperSelection.
Basic Usage
To render a default crosshair, use the <cropper-crosshair> tag.
Customizing Color
You can change the crosshair color using the theme-color attribute.
Positioning within Components
- Within
CropperCanvas: Use the centered property to ensure the crosshair is centered relative to the canvas. - Within
CropperSelection: Use the centered property to ensure the crosshair is centered relative to the selection area.
<!-- Basic -->
<cropper-crosshair></cropper-crosshair>
<!-- Custom color -->
<cropper-crosshair theme-color="#39f"></cropper-crosshair>
<!-- Within CropperCanvas -->
<cropper-canvas style="background-color: #39f;">
<cropper-crosshair centered></cropper-crosshair>
</cropper-canvas>
<!-- Within CropperSelection -->
<cropper-selection width="160" height="90" style="background-color: #39f;">
<cropper-crosshair centered></cropper-crosshair>
</cropper-selection>