Back to Cropperjs

CropperGrid

docs/api/cropper-grid.md

2.1.11.7 KB
Original Source

CropperGrid

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

Examples

Basic

:::live-demo

html
<cropper-grid></cropper-grid>

:::

:::tip The default height of this element is 0. :::

Custom rows and columns

:::live-demo

html
<cropper-grid rows="4" columns="18" theme-color="#39f" style="height: 10rem;"></cropper-grid>

:::

Within CropperCanvas

:::live-demo

html
<cropper-canvas style="background-color: #39f;">
  <cropper-grid bordered covered></cropper-grid>
</cropper-canvas>

:::

Within CropperSelection

:::live-demo

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

:::

Properties

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

NameTypeDefaultOptionsDescription
rowsnumber3-Indicates the number of the rows.
columnsnumber3-Indicates the number of the columns.
borderedbooleanfalse-Indicates whether this element is bordered.
coveredbooleanfalse-Indicates whether this element covers its parent element.
slottablebooleanfalse-Indicates whether this element is slottable.
themeColorstring"rgba(238, 238, 238, 0.5)"-Indicates the color of the element.

Slots

There are no available slots in this element.

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

html
<cropper-grid slottable></cropper-grid>