Heart

하트

A filled heart silhouette with adjustable size and orientation.

Also known as: HeartHeart shape

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
import { Shader, Heart } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Heart />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<script setup lang="ts">
import { Shader, Heart } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Heart/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<script>
  import { Shader, Heart } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Heart />
</Shader>
Solid
// Renders only in browsers with WebGPU.
import { Shader, Heart } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Heart />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'Heart',
    }
  ]
}, { disableTelemetry: true })

Props · Heart

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
originOriginSet in codecenter—Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.
colorColor#ffffff—Fill color of the heart
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the heart
radiusSize0.320 – 1 (step 0.01)Size of the heart (fit radius)
rotationRotation00 – 360 (step 1)Rotation in degrees
softnessSoftness00 – 0.1 (step 0.001)Edge softness for antialiasing
strokeThicknessStroke Thickness00 – 0.2 (step 0.005)Stroke thickness. Zero means no stroke.
strokeColorStroke Color#000000—Color of the stroke outline
strokePositionStroke Positioncenteroutside · center · insidePosition of the stroke relative to the shape edge
colorSpaceColor Blendinglinearlinear · oklch · oklab · hsl · hsv · lchColor space for blending fill and stroke colors

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

A heart is a familiar silhouette in like buttons, cards, and celebratory decoration. It appears as a filled shape of its own on the canvas.

`radius` sets the heart's fit radius from 0 to 1. Move it with `center`, and use `rotation` from 0 to 360 degrees to change its orientation. `softness` controls edge softness from 0 to 0.1.

There is no prop for changing its width and height independently, so place it with size and rotation instead of trying to alter its proportions. Layer it with `Flower` or `Crescent` for a decorative backdrop, while keeping enough outline and color contrast for small UI.

When to use

Use it for likes and favorites, celebration cards, or expressive decoration. It can also overlap with other shapes as a background motif. Avoid it when the interface needs a neutral or technical visual language.

Open as page ↗