@sefaria/web-components
v0.1.0-alpha.0
Published
Declarative Sefaria web components backed by corrected client payloads and safe text transforms.
Keywords
Readme
Created/edited by GitHub Copilot; pending human review.
@sefaria/web-components
Five browser-standard custom elements that show Sefaria texts, each loading by a reference or rendering data you supply.
A community-driven project with Sefaria backing and support. The toolkit is experimental; names and APIs may change.
Install
Public npm release 0.1.0-alpha.0 is prepared but remains pending hosted qualification. After release, installation is anonymous and needs no GitHub token. Types are included; no @types package is needed. Install and status › Packages owns current availability and exact-version installation guidance.
Elements
Import the package root once to register every element: import "@sefaria/web-components";. Each element loads by sref. Text Segment, Bilingual Segment and Source Card can also render data you supply through their data property.
<sefaria-text-segment>: one passage in one edition<sefaria-bilingual-segment>: one passage in its primary edition with a translation<sefaria-source-card>: a source with its text and attribution<sefaria-connections-panel>: the commentaries and other texts connected to a reference<sefaria-reader>: a passage with its connected texts, and navigation between them
First success
import "@sefaria/web-components";
// Importing the package root registers every element.
const card = document.createElement("sefaria-source-card");
card.setAttribute("sref", "Micah 6:8");
document.body.append(card);Next steps
For maintainers: IMPLEMENTATION.md.
