링

Ring

중심선 반지름과 띠 두께를 조절하는 도넛형 고리입니다.

다른 이름: RingAnnulusDonut

WebGPU 를 지원하는 브라우저에서 움직입니다

이 기기에서는 데모를 그리지 못해 정지 화면을 보여 줍니다

React
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, Ring } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Ring />
    </Shader>
  )
}
Vue
<!-- 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
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script>
  import { Shader, Ring } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Ring />
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, Ring } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Ring />
    </Shader>
  )
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'

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

속성(props) · Ring

값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(MIT)입니다.

이름값기본값범위·선택지설명(원문)
originOrigin코드에서 지정center—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

모든 컴포넌트 공통: blendMode · opacity · visible · maskSource/maskType · boundingBox · id

링은 중심이 비어 있는 원형 띠입니다. 진행 표시, 표적, 행성 궤도처럼 가운데 공간을 남겨 두면서 원형 경계를 강조할 때 유용합니다.

`radius`는 띠 중심선까지의 거리로 0–1 범위입니다. `thickness`는 띠의 반쪽 두께이며 0.005–0.3 범위라서 전체 띠 폭은 그 두 배입니다. `softness`는 0–0.1 범위에서 안쪽과 바깥쪽 가장자리를 함께 부드럽게 하고, `strokeThickness`는 0–0.1 범위입니다.

`thickness`는 전체 폭이 아니라 반쪽 폭이므로 넓이를 예상할 때 두 배로 생각하세요. `Circle`을 안쪽에 겹치면 테두리 링처럼 보이고, 여러 링은 진행 상태나 동심원 표현에 어울립니다.

언제 쓰나

진행 표시·표적·궤도 장식처럼 중앙을 비워 둔 원형 강조에 좋습니다. 원형 테두리를 반복하는 배경에도 쓸 수 있습니다. 내부를 채운 원이 필요한 경우에는 Circle을 쓰세요.

페이지로 열기 ↗