별

Star

뾰족한 별 꼭짓점 수와 안쪽 골의 깊이를 조절하는 별 도형입니다.

다른 이름: StarStar polygon

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Star />
    </Shader>
  )
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script setup lang="ts">
import { Shader, Star } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Star/>
  </Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script>
  import { Shader, Star } from 'shaders/svelte'
</script>

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

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

속성(props) · Star

값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(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 star
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the star
radiusRadius0.40 – 1 (step 0.01)Outer tip radius — distance from center to the pointed tips
sidesPoints53 – 12 (step 1)Number of points on the star
innerRatioInner Ratio0.40.1 – 0.9 (step 0.01)Inner vertex radius as a ratio of outer radius (0.382 = golden-ratio 5-star)
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

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

별 도형은 바깥쪽 꼭짓점과 안쪽 골이 번갈아 이어집니다. 평점 표시부터 반짝임 배지까지, 한눈에 강조점을 만드는 데 익숙한 실루엣입니다.

`sides`는 별의 꼭짓점 수이며 3–12 범위입니다. `radius`는 바깥쪽 끝까지의 거리로 0–1 범위이고, `innerRatio`는 안쪽 꼭짓점의 비율로 0.1–0.9 범위입니다. `rotation`은 0–360도 사이에서 별의 방향을 바꿉니다.

`innerRatio`가 낮으면 안쪽 골이 깊어지고 높으면 별이 통통해집니다. 작은 배지에서는 뾰족한 부분이 복잡해 보일 수 있으니 크기와 대비를 확보하고, `Polygon`과 나란히 두어 실루엣을 구분하세요.

언제 쓰나

즐겨찾기·평점·프로모션 배지처럼 눈에 띄는 강조점에 좋습니다. 별 모양 장식이나 반복 패턴에도 쓸 수 있습니다. 작은 크기에서 세밀한 꼭짓점이 읽히지 않는 UI에는 피하세요.

페이지로 열기 ↗