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.