Mask
Mask crops the content of the element to common shapes.
Examples
Squircle
The mask can crop the shape of squircle.
Code
vue
<template>
<base-mask shape="squircle" src="https://placehold.co/150" />
</template>Diamond
The mask can crop the shape of diamond.
Code
vue
<template>
<base-mask shape="diamond" src="https://placehold.co/150" />
</template>Reuleaux Triangle
The mask can crop the shape of reuleaux triangle.
Code
vue
<template>
<base-mask shape="reuleaux-triangle" src="https://placehold.co/150" />
</template>Heart
The mask can crop the shape of heart.
Code
vue
<template>
<base-mask shape="heart" src="https://placehold.co/150" />
</template>Octagon
The mask can crop the shape of octagon.
Code
vue
<template>
<base-mask shape="octagon" src="https://placehold.co/150" />
</template>Hexagon
The mask can crop the shape of hexagon.
Code
vue
<template>
<base-mask shape="hexagon" src="https://placehold.co/150" />
<base-mask shape="hexagon-2" src="https://placehold.co/150" />
</template>Star
The mask can crop the shape of star.
Code
vue
<template>
<base-mask shape="star" src="https://placehold.co/150" />
<base-mask shape="star-2" src="https://placehold.co/150" />
</template>Mask API
Types
ts
export type BaseMaskShapeType =
| 'squircle'
| 'diamond'
| 'reuleaux-triangle'
| 'hexagon'
| 'hexagon-2'
| 'heart'
| 'octagon'
| 'star'
| 'star-2'Props
| Name | Type | Default | Description |
|---|---|---|---|
| src | string | Image source is required. | |
| shape | BaseMaskShapeType | Image masking shape. |