npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quran.ws/tajwid-react

v0.1.0

Published

React components for rendering Quranic text with its tajweed rulings marked.

Downloads

180

Readme

@quran.ws/tajwid-react

npm install @quran.ws/tajwid-react @quran.ws/tajwid-rules @quran.ws/tajwid-annotations
import corpus from '@quran.ws/tajwid-rules'
import annotations from '@quran.ws/tajwid-annotations'
import { TajweedText, TajweedLegend } from '@quran.ws/tajwid-react'
import { unpack } from '@quran.ws/tajwid'

<TajweedText text={ayahText} corpus={corpus} spans={unpack(annotations, corpus, '2:255')} />
<TajweedLegend corpus={corpus} />

Pass spans in production. The Quran is a fixed text, so there is no reason to run a matching engine in the browser — look the ayah up in @quran.ws/tajwid-annotations instead. If you leave spans out, the component analyses the text itself, which is what a playground or an arbitrary passage needs.

What it does that dangerouslySetInnerHTML would not

The text is never altered. Characters are emitted exactly as given, and React escapes them on output, so what reaches the DOM is what you passed in.

The word does not come apart where the colour changes. A browser shapes each element on its own, so a coloured stretch is drawn without seeing its neighbours: عَلَيۡهِمۡ becomes عَ لَيۡهِ مۡ. Every cut is bridged with a zero-width joiner where the letters either side join, and pushed past the marks written on the letter it lands on. Both belong to the drawing: nothing reaches the offsets or the text. clusterEnd and bridgeJoins are exported from @quran.ws/tajwid for anyone rendering this some other way — see docs/rendering.md.

Waqf marks keep the colour around them. They tell the reciter where to pause; they are not part of the letter the ruling is about.

Every coloured stretch carries its ruling in aria-label. Colour alone says nothing to a reader who cannot see it — a serious flaw in something meant to teach recitation.

Colour is keyed by topic, not by hukum. There are an order of magnitude more ahkam than topics, and past roughly a dozen colours readers stop being able to tell them apart. TOPIC_COLORS therefore carries one colour per topic, and a test holds it equal to the corpus's topic list.

Render <TajweedLegend />. It iterates the corpus, so it is right whatever the topics are. The corpus says nothing outside them; colour without a legend suggests the colouring is complete when it is not — see docs/coverage.md.

Props

| Prop | | |---|---| | text | the ayah text, unmodified | | corpus | pass @quran.ws/tajwid-rules | | spans | precomputed spans; leave out to analyse on the fly | | options | engine options when spans is left out (only, school) | | colors | override the palette, keyed by topic id | | overlapping | show every ruling rather than only the topmost | | onSpanClick | called with the span; makes each mark focusable |

MIT.