촉감이 느껴지는 누름 효과의 좋아요 또는 즐겨찾기 토글: 포인터 아래에서 글리프가 가라앉았다가 채워지면서 원래 크기 이상으로 튀어 오르고, 고리와 불꽃 왕관이 한 번 퍼져 나갑니다. 바뀐 카운터 자릿수는 고정된 자리에서 위나 아래로 굴러가며 Intl로 서식이 적용됩니다.
카테고리
마이크로 인터랙션
유형
Web Component (<mv-like>)
상태
안정
Keywords
like, heart, favorite, star, wishlist, upvote, toggle, burst, counter, social
When to use
Posts, comments or products need a like, favorite or upvote toggle with a live counter
A product grid or detail page needs a compact icon-only wishlist heart
A social feed wants expressive feedback when a user hearts or stars an item
Avoid when
Users should give a graded score rather than a binary like → use Rating instead
The toggle is a neutral setting such as bold or mute in a toolbar → use Toggle instead
Liked (reflected as aria-pressed on the inner button).
count
number
Displayed counter (omitted = icon-only button). Steps by one on each toggle and never goes below 0.
label
string
Like (star: Favorite)
Accessible name; the formatted counter is appended: “Like (2,381)”.
icon
heart | star
heart
Glyph.
locale
BCP 47
en-US
Number formatting of the counter (Intl.NumberFormat).
disabled
boolean
Disables the button.
data-variant
outline
Outlined pill on a solid background.
data-size
lg
Larger.
Properties
Name
유형
Description
strings
Partial<{ like, favorite }>
Default accessible names for the heart and star when label is not set. English defaults.
Methods
Name
Description
toggle(force?)
Toggles like a click: plays the feedback, steps the counter, emits mv-change. Setting pressed or count directly updates silently.
Events
Name
Description
mv-change
After a toggle; detail = { pressed, count } (count is null without a counter).
CSS classes
Name
Description
mv-like-button
The generated <button> (data-icon-only without a counter); hosts may resize or restyle it.
mv-like-icon / -glyph / -ring / -burst / -count
Generated parts (all aria-hidden).
CSS variables
Name
Default
Description
--mv-like-color
rose (star: gold)
Liked color: fill, ring, long sparks and pressed tint.
--mv-like-spark-color
amber (star: copper)
Color of the short sparks.
Accessibility
A real toggle <button> with aria-pressed; its accessible name carries the formatted counter (Intl, en-US by default). The glyph, ring, sparks and visual counter are aria-hidden and ignore the pointer. Setting pressed or count programmatically updates the state without replaying the burst. Reduced motion: no press sink, pop, burst or digit roll, only the fill, color and number change. Forced colors: system colors (ButtonText, Highlight) draw the outline and the liked fill; the burst is hidden.