Sticker

Content

색 배경 위에 아이콘을 얹는 장식 배지.

용도

상호작용 없이 아이콘을 색상 면 위에 장식적으로 강조할 때 사용합니다.

import

import

import { Sticker } from '@mildang/design-system/Sticker';

예제를 복사해 쓸 때 필요한 준비

• 아이콘은 DS 패키지에 없어 @mildang/icons 를 별도로 설치해야 합니다.

사용 가이드

권장 사항

구분내용
권장배치 맥락에 맞춰 circle/rounded를 명시적으로 고릅니다.
권장배경과 아이콘의 의미에 맞는 role을 사용합니다(예: 오류 상태는 critical).
지양클릭·호버 등 인터랙션이 필요한 자리에 Sticker를 사용하지 않습니다. IconButton으로 대체합니다.
지양의미와 무관하게 기본값(neutral)을 그대로 두지 않습니다.

모양

circle 은 프로필·알림처럼 홀로 뜨는 자리, rounded 는 목록 앞머리처럼 사각 카드와 맞물리는 자리입니다.

변형·옵션

size는 배경 면과 아이콘을 함께 조정하는 5단계(xs~xl) 스케일입니다. 아이콘 크기를 따로 지정하면 면 안에서 중심이 어긋나므로 icon 자체에는 크기를 지정하지 않습니다.

크기

면과 아이콘이 함께 커지는 5단계를 비교합니다. 아이콘 크기를 따로 주면 면 안에서 중심이 어긋납니다.

API 참조

Sticker Props

PropTypeDefault설명
bg

"brand.surface.base" | "brand.surface.high" | "brand.surface.highest" | "brand.surface.low" | "critical.surface.base" | "critical.surface.high" | "info.surface.base" | "info.surface.high" | "neutral.surface.base" | "neutral.surface.high" | "neutral.surface.highest" | "neutral.surface.low" | "neutral.surface.transparent" | "positive.surface.base" | "positive.surface.high" | "positive.surface.low" | "primary.surface.base" | "primary.surface.high" | "primary.surface.highest" | "primary.surface.low" | "warning.surface.base" | "warning.surface.high"

-배경색. {role}.surface.* 시맨틱 토큰만. 기본 neutral.surface.high.
color

"brand.icon.base" | "critical.icon.base" | "info.icon.base" | "inverse.icon.base" | "neutral.icon.base" | "neutral.icon.low" | "positive.icon.base" | "primary.icon.base" | "warning.icon.base"

-아이콘색. {role}.icon.* 시맨틱 토큰만. 기본 neutral.icon.base.
icon

ReactNode

-표시할 아이콘. 보통 @mildang/icons 아이콘(width/height="1em")을 넘기며, size 가 아이콘 px 을 자동으로 맞춤. 미지정 시 아무것도 렌더하지 않음.
size

"xs" | "sm" | "md" | "lg" | "xl"

md면과 아이콘이 함께 커지는 5단계(xs~xl) 스케일. 아이콘 크기를 따로 지정하면 면 안에서 중심이 어긋남.
variant

"circle" | "rounded"

circlecircle 은 완전한 원형이고, rounded 는 크기별로 반경이 달라지는 둥근 사각형임.
className

string

-루트 요소에 추가되는 className.
style

CSSProperties

-루트 요소에 병합되는 인라인 스타일.

예제