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

@scriba-editor/react

v0.1.1

Published

React wrapper for the Scriba editor: <ScribaEditor value onChange> and useScriba().

Readme

@scriba-editor/react

L'editor Scriba come componente React (18 e 19).

pnpm add @scriba-editor/react @scriba-editor/themes

Uso

import { useState } from 'react'
import { ScribaEditor } from '@scriba-editor/react'
import '@scriba-editor/themes/scriba.css'

export function Nota() {
  const [html, setHtml] = useState('<p>Ciao</p>')
  return <ScribaEditor value={html} onChange={(v) => setHtml(v as string)} />
}

Il contenuto (value, setContent) è input non fidato: passa sempre dal parser dello schema in un documento inerte. L'HTML salvato va comunque ripassato da @scriba-editor/sanitize-server sul server prima di salvarlo o mostrarlo.

Proprietà

| Proprietà | Default | Significato | | ----------- | ---------------------------- | --------------------------------------------------------------------------------------------- | | value | null | Il contenuto (HTML o JSON). Un valore cambiato dall'esterno sostituisce il documento. | | onChange | — | Chiamata a ogni modifica dell'utente, con il contenuto nel formato scelto. | | format | 'html' | 'html' o 'json'. | | schema | basicSchema | Lo schema (letto alla creazione). | | plugins | — | Plugin aggiuntivi (letti alla creazione). | | editable | true | false: sola lettura (si può cambiare in ogni momento). | | label | "Editor di testo formattato" | Nome accessibile dell'area di scrittura. | | locale | 'it' | Lingua ('it', 'en') o un oggetto di messaggi (fr, de, es da @scriba-editor/i18n). | | toolbar | true | Mostra la toolbar predefinita. | | nodeViews | — | Viste personalizzate dei nodi atomici (lette alla creazione). | | className | — | Classe aggiuntiva del contenitore. |

Ref e hook

Il ref del componente espone getContent(), setContent(content), focus(), view e state.

Per un'interfaccia tutta tua c'è l'hook:

import { useRef } from 'react'
import { useScriba } from '@scriba-editor/react'

function Editor() {
  const place = useRef<HTMLDivElement>(null)
  const scriba = useScriba(place, { content: '<p>Ciao</p>', onChange: console.log })
  return <div ref={place} />
}

Lo schema, i plugin e il formato vengono letti quando l'editor viene creato (al montaggio); editable, label e onChange seguono le proprietà. Funziona con StrictMode.