Skip to content

Frameworks

<quran-madina-html> is a standard web component, so it works in any framework that renders HTML. Three frameworks get a dedicated package, because they can't use the tag directly or gain a lot from one:

  • React: @tarekeldeeb/quran-madina-react, a component that loads the library for you, for React on the web and, through Capacitor, on iOS and Android.
  • React Native: @tarekeldeeb/quran-madina-react-native, a component that shows the tag in a WebView on iOS and Android, sized to the text, online or offline.
  • Flutter: quran_madina_flutter, a widget for Android, iOS, macOS and the web.

The others use the tag as it is, with a line or two of setup:

Framework Setup Page
Vue, Nuxt mark the tag as a custom element in the compiler options Vue
Angular CUSTOM_ELEMENTS_SCHEMA on the component Angular
Svelte, SvelteKit none Svelte
Astro load the script with is:inline Astro
SolidJS, Preact, Lit, Alpine, plain JavaScript none: write the tag, or create it with document.createElement HTML

Next.js is React: use the React component in a client component ("use client"). WordPress sites use the plugin, with a block and a shortcode.

Setting values from code

Every attribute is also a property: tag.aya = 256 is the same as tag.setAttribute("aya", "256"), and either re-renders the tag. true sets an empty attribute, and null or false removes it. Frameworks that pass values as properties (Vue, Svelte, Angular's [aya]) rely on this, which needs library 2.1.2 or later.