Ring

링

A donut-shaped ring with adjustable center radius and band thickness.

Also known as: RingAnnulusDonut

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, Ring } from 'shaders/react'

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Ring />
    </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: 'Ring',
    }
  ]
}, { disableTelemetry: true })

Props · Ring

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 ring
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the ring
radiusRadius0.30 – 1 (step 0.01)Distance from center to the ring's midline in UV space
thicknessThickness0.070.005 – 0.3 (step 0.005)Half-width of the ring band — total ring width is twice this value
softnessSoftness00 – 0.1 (step 0.001)Edge softness for antialiasing (applied to both inner and outer ring edges)
strokeThicknessStroke Thickness00 – 0.1 (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 ring 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 ring is a circular band with an open center. It is useful for emphasizing a circular boundary while leaving the middle clear, as in a progress indicator, target, or orbit.

`radius` measures the distance to the band's midline from 0 to 1. `thickness` is half the band width from 0.005 to 0.3, so the full band is twice that value. `softness` softens both inner and outer edges from 0 to 0.1, and `strokeThickness` ranges from 0 to 0.1.

`thickness` is the half-width rather than the full width, so account for both sides when judging the band. Layer a `Circle` inside it for an outlined disk, or use several rings for progress or concentric-circle graphics.

When to use

Use it for circular emphasis with an open center, such as a progress indicator, target, or orbit accent. It also works for repeating ring backgrounds. Use Circle when the center needs to be filled.

Open as page ↗