Skip to content
daisyBlazor

Mask

Clips its content into a daisyUI mask shape: squircle, circle, heart, star, hexagon and more. Use it for avatars, artwork and decorative badges; Half clips one half for ratings.
Layout.mask
Cover · <Mask>
A
No.1

Examples

Shapes

Every MaskShape value; give the mask a size and a background or an image.

Squircle
Circle
Hexagon
Star
Star2
Triangle
Heart
Diamond
Pentagon
Hexagon2
Decagon
Triangle2
Triangle3
Triangle4
website/Examples/Layout/MaskShapesExample.razor Source

Around content

Any content can be clipped, such as initials for team avatars.

AS
Ana Silva
TB
Tom Becker
PN
Priya Nair
website/Examples/Layout/MaskContentExample.razor Source

Half masks

Half 1 and 2 keep the left or right half of the shape, which is how half-star scores are built.

3.5 / 5
website/Examples/Layout/MaskHalfExample.razor Source

Playground

Pro
Shape MaskShape
<Mask
      Shape="MaskShape.Heart"
      Class="grid size-40 place-items-center bg-primary font-display text-xl font-bold text-primary-content">
    Pro
</Mask>

API

<Mask>

DaisyBlazor

Parameters

  • Half int?
    = null

    Optional half-mask modifier. Pass 1 to apply mask-half-1 (left/top half) or 2 for mask-half-2 (right/bottom half). Any other value is ignored.

  • Shape MaskShape
    = MaskShape.Squircle

    Geometric shape used to clip the content.

  • Class string
    = null

    Extra CSS classes merged onto the .mask element.

  • Style string
    = null

    Inline CSS style applied to the .mask element.

Content

  • ChildContent RenderFragment

    Content to clip — typically an <img> element.

Something went wrong while running the docs. Reload