Skip to content
mushaf.js

The Mushaf, as a component.

Render the Mushaf in your web app and interact with everything on the page: words, ayahs, surahs and more.

Get startedOpen the playground
pages 1–2
Tap any word, or an ayah marker ۝
Render

Pages look exactly like the printed Mushaf, in the browser.

Interact

Click a word, an ayah, a surah or a juz marker and get its details.

Highlight

Colour anything on the page, from one word to a whole range.

Select

Let users pick a range by tapping where it starts and ends.

Get started in three steps ​

1. Install

bash
npm install mushaf.js

2. Add a container

html
<link rel="stylesheet" href="node_modules/mushaf.js/dist/mushaf.min.css" />
<div id="mushaf"></div>

3. Render a page

js
import { Mushaf } from 'mushaf.js'

const mushaf = new Mushaf({
  container: '#mushaf',
  onWordClick: (word) => mushaf.highlightWord(word.surah, word.ayah, word.word),
})

await mushaf.init()
await mushaf.renderPage(1)

That's it. Page data and fonts come from cdn.mushafjs.com, so there is nothing to host. Read the guide →

What you can build ​