Use cases
mushaf.js draws the page; your app brings the data. These demos show common patterns, each running live with the code you need next to it. They come from building Qur'an memorization tracking for a real app, simplified to the essentials.
Memorization tracker
Paint a student’s progress on the page: memorized, review and homework ranges, plus the exact words they slipped on.
highlightRange · batchHighlights · style: colorOpen demo →Assigning ranges
A teacher taps a first and a last word to hand out the next lesson. Store it as two integers and draw it anywhere.
startSelection · onSelectionChange · wordPositionOpen demo →Recitation follow-along
Move a cursor through the page word by word, the way an audio player would, and let readers tap to jump.
highlightWord · highlightAyah · keysOpen demo →Bookmarks
Tap an ayah to bookmark it with a colour tag. Highlights follow the reader across pages; the list jumps back.
onAyahClick · goToAyah · clearHighlight(key)Open demo →Want to poke at everything at once? Open the Playground.