Back to Cropperjs

CropperCrosshair

docs/api/cropper-crosshair.md

2.1.11.4 KB
Original Source

CropperCrosshair

The CropperCrosshair interface provides properties and methods for manipulating the layout and presentation of <cropper-crosshair> elements.

Examples

Basic

:::live-demo

html
<cropper-crosshair></cropper-crosshair>

:::

Custom color

:::live-demo

html
<cropper-crosshair theme-color="#39f"></cropper-crosshair>

:::

Within CropperCanvas

:::live-demo

html
<cropper-canvas style="background-color: #39f;">
  <cropper-crosshair centered></cropper-crosshair>
</cropper-canvas>

:::

Within CropperSelection

:::live-demo

html
<cropper-selection width="160" height="90" style="background-color: #39f;">
  <cropper-crosshair centered></cropper-crosshair>
</cropper-selection>

:::

Properties

Inherits properties from its parent, CropperElement, and implements the following properties:

NameTypeDefaultOptionsDescription
centeredbooleanfalse-Indicates whether this element is centered.
slottablebooleanfalse-Indicates whether this element is slottable.
themeColorstring"rgba(238, 238, 238, 0.5)"-Indicates the color of the crosshair.

Slots

There are no available slots in this element.

You can enable the default slot by setting the slottable property to true:

html
<cropper-crosshair slottable></cropper-crosshair>