Arc

부채꼴

A pie-sector wedge with adjustable radius and aperture angle.

Also known as: ArcPie sectorWedge

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

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

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

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

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

Props · Arc

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 arc
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the arc
radiusSize0.380 – 1 (step 0.01)Radius of the pie sector
apertureAperture2700 – 360 (step 1)Aperture angle of the wedge in degrees (360 = full circle)
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 pie sector is bounded by part of a circle and two edges that meet at its center. Use it to show an angular segment, like a pie-chart slice or a radial highlight.

`radius` sets the sector radius from 0 to 1. `aperture` is the opening angle from 0 to 360 degrees, with 360 making a full circle. Turn the opening with `rotation` from 0 to 360 degrees, and soften its boundary with `softness` from 0 to 0.1.

This shape is a filled wedge reaching the center, not a thin curved arc. For a narrow circular band, use a thin `Ring` or compose separate line shapes, and check layer order when it overlaps a `Circle`.

When to use

Use it for pie-chart slices, radial progress segments, or angular highlights. It creates an open-ended color block that reaches the center. Avoid it when you only need a thin curved line with an empty center.

Open as page ↗