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

@mideind/netskrafl-react

v3.4.8

Published

React UI for Netskrafl

Readme

netskrafl-react

A React front end for Netskrafl, packaged as a React component library.

Components

This library provides two main components:

  • Netskrafl - The full multiplayer crossword game
  • GataDagsins - A daily crossword riddle ("Riddle of the Day")

Both components are responsive and mobile-friendly.

Installation

npm install @mideind/netskrafl-react

Requires React 18+. This package is distributed as ESM only.

If using Next.js, add the package to transpilePackages in next.config.ts:

transpilePackages: ['@mideind/netskrafl-react'],

Usage

Import the component, its styles, and optionally the props type:

import { Netskrafl } from '@mideind/netskrafl-react';
import type { INetskraflProps } from '@mideind/netskrafl-react';
import '@mideind/netskrafl-react/style.css';

function App() {
    const props: INetskraflProps = {
        state: {
            serverUrl: 'https://your-netskrafl-server.is',
            userEmail: '[email protected]',
            userNick: 'User',
            userFullname: 'Example User',
            token: 'jwt-auth-token',
            plan: 'friend',
            hasPaid: true,
            // Firebase configuration
            projectId: 'netskrafl',
            firebaseApiKey: '...',
            firebaseAppId: '...',
            firebaseSenderId: '...',
            databaseUrl: 'https://your-netskrafl.firebaseio.com',
            measurementId: '...',
            // Optional
            loginMethod: 'myapp',
            subscriptionUrl: '/subscribe',
        },
        tokenExpired: async () => {
            // Called when the auth token expires.
            // Fetch a new JWT and return it, or return undefined on failure.
            const res = await fetch('/api/token', { method: 'POST' });
            const data = await res.json();
            return data.jwt;
        },
    };
    return <Netskrafl {...props} />;
}

For Gáta Dagsins, the usage is identical except for the component name:

import { GataDagsins } from '@mideind/netskrafl-react';
import '@mideind/netskrafl-react/style.css';

function App() {
    return <GataDagsins state={{ /* same shape */ }} tokenExpired={...} />;
}

Props

Both components accept INetskraflProps:

| Prop | Type | Description | |------|------|-------------| | state | Partial<GlobalState> | Configuration and user state (see below) | | tokenExpired | () => Promise<string \| undefined> | Optional callback invoked when the auth token expires; should return a fresh JWT |

State fields

The state prop is a partial GlobalState object. Commonly used fields:

| Field | Type | Description | |-------|------|-------------| | serverUrl | string | Base URL of the Netskrafl backend server | | userEmail | string | User's email address | | userNick | string | User's short display name | | userFullname | string | User's full display name | | token | string | JWT authentication token for API requests | | plan | string | Subscription plan identifier (e.g. 'friend') | | hasPaid | boolean | Whether the user has an active subscription | | loginMethod | string | Identifies the host application (e.g. 'malstadur') | | subscriptionUrl | string | URL to redirect users for subscription management | | projectId | string | Firebase project ID | | firebaseApiKey | string | Firebase API key | | firebaseAppId | string | Firebase app ID | | firebaseSenderId | string | Firebase messaging sender ID | | databaseUrl | string | Firebase Realtime Database URL | | measurementId | string | Firebase Analytics measurement ID | | movesUrl | string | URL of the moves microservice | | movesAccessKey | string | Access key for the moves microservice | | locale | string | UI language ('is' for Icelandic, 'en_US' for English) | | runningLocal | boolean | Set to true in development environments | | userGroupId | string? | Optional group identifier for Gáta Dagsins leaderboards |

All fields are optional (the state is Partial<GlobalState>), but the components need at minimum serverUrl, userEmail, token, and the Firebase configuration fields to function.

Features

  • Drag-and-drop tile placement with touch support
  • Click-to-select tile placement
  • Keyboard tile placement (type letters to place tiles)
  • Real-time game updates via Firebase
  • Mobile-responsive design
  • Pinch-to-zoom on mobile (pinch to zoom out, spread to zoom in)
  • Double-tap to zoom out on mobile
  • Auto-zoom when placing tiles on the board

Architecture

The components are written in TypeScript. They assume that the containing application handles user authentication and subscription status.

The code uses a hybrid React-Mithril architecture: the components are React wrappers around Mithril UI code. Modifying the components requires familiarity with both frameworks, though Mithril is straightforward and arguably simpler than React.

The components communicate with the Netskrafl backend server via a JSON API over HTTPS, and use Firebase for real-time updates.

Backend

The Netskrafl backend server code is available at github.com/mideind/Netskrafl. The backend is written in Python using the Flask web framework.

Development

# Install dependencies
npm install

# Run rollup in watch mode
npm run watch

# Run Storybook for development/testing
npm run storybook

# Build for production
npm run rollup

# Build CSS only (faster, for CSS-only changes)
npm run css

# Type-check
npx tsc --noEmit

# Lint
npx @biomejs/biome check src/

License

Copyright © 2026 Miðeind ehf. Original author: Vilhjálmur Þorsteinsson.

Released under the CC-BY-NC 4.0 license. See the LICENSE file for details.