New:Socket for Asana Is Now Available.Learn more
Get Started

@braccato/core

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@braccato/core

Synchronized lyrics web component with word-by-word animations

Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
1K
232.03%
Maintainers
1
Weekly downloads
 
Created
Source

@braccato/core

<braccato-lyrics> web component for synchronized lyrics rendering with word-by-word animations. Built with Lit, extracted from the Better Lyrics rendering engine.

Install

npm i @braccato/core

Usage

<audio id="player" src="song.mp3" controls></audio>
<braccato-lyrics source="#player" src="lyrics.ttml"></braccato-lyrics>

<script type="module">
  import "@braccato/core";
</script>

The source attribute accepts a CSS selector for any <audio> or <video> element. The src attribute fetches and parses a lyrics file (TTML, LRC, SRT, QRC, or plain text are auto-detected).

For manual control, set lyrics, currentTime, and playing directly instead.

Properties

PropertyAttributeTypeDefaultDescription
sourcesourcestring | nullnullCSS selector for the media element to sync with
srcsrcstring | nullnullURL to a lyrics file (auto-detected format)
lyricsLyric[][]Parsed lyric data (set directly for manual control)
currentTimecurrent-timenumber0Playback position in ms (ignored when source is set)
playingplayingbooleanfalseWhether playback is active (ignored when source is set)
scrollModescroll-mode'internal' | 'external''internal'Scroll container ownership
dirdir'auto' | 'ltr' | 'rtl''auto'Text direction

Events

EventDetailDescription
braccato:line-click{ time, lineIndex }User clicked a lyric line
braccato:word-click{ time, lineIndex, wordIndex }Alt+click on a word (rich sync)
braccato:lyrics-loaded{ syncType, lineCount }Lyrics injected into the DOM
braccato:scroll-state{ userScrolling }Scroll state changed
braccato:error{ error }Fetch or parse error (when using src)

CSS Custom Properties

braccato-lyrics {
  --braccato-font-family: system-ui, sans-serif;
  --braccato-font-size: 3rem;
  --braccato-font-weight: 600;
  --braccato-active-color: white;
  --braccato-inactive-opacity: 0.3;
  --braccato-glow-color: rgba(255, 255, 255, 0.5);
  --braccato-timing-offset: 0.115s;
  --braccato-richsync-timing-offset: 0.150s;
}

See the full documentation for all properties and framework examples.

Keywords

lyrics

FAQs

Package last updated on 06 Jun 2026

Related posts