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

@senkenmaru/theme

v0.1.0

Published

Senkenmaru theme configuration for Unistyles + SenkenmaruProvider

Downloads

120

Readme

@senkenmaru/theme

senkenmaru の Unistyles v3 設定と Provider。

インストール

bun add @senkenmaru/theme react-native-unistyles

前提: React 19+ / React Native 0.78+ / New Architecture 有効

使い方(最小)

// app/_layout.tsx
import { SenkenmaruProvider } from '@senkenmaru/theme';

export default function Root({ children }) {
  return <SenkenmaruProvider>{children}</SenkenmaruProvider>;
}

SenkenmaruProvider が初回レンダー時に Unistyles を設定します(冪等)。

使い方(詳細)

初期テーマを指定

<SenkenmaruProvider initialTheme="dark">
  {children}
</SenkenmaruProvider>

OS のダーク/ライト設定に追従

<SenkenmaruProvider adaptiveThemes>
  {children}
</SenkenmaruProvider>

Provider を使わず設定したい場合

import { configureSenkenmaru } from '@senkenmaru/theme';

configureSenkenmaru({ adaptiveThemes: true });

プラットフォーム別セットアップ

Expo

app.json で New Architecture を有効化:

{
  "expo": {
    "newArchEnabled": true
  }
}

babel.config.js に Unistyles Babel プラグインを追加:

module.exports = (api) => {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [['react-native-unistyles/plugin', { root: 'app' }]],
  };
};

Vite SPA(Web 専用)

vite.config.ts@vitejs/plugin-react に Unistyles plugin を追加し、react-nativereact-native-web のエイリアスを設定。apps/examples/vite-spa/vite.config.ts を参考に。

加えて、Web 環境では entry で 互換 CSS を読み込んでください

// src/main.tsx の先頭
import '@senkenmaru/theme/web.css';

web.css は senkenmaru を Web で動かすための最小限の調整(OS color-scheme 対応、ブラウザ既定 focus outline の無効化など)を含みます。Native 環境では不要(CSS は無視される)。

Next.js は現在対応外(Unistyles v3 の Babel plugin が SWC ベースの Next.js と相性悪い)。

提供されるもの

  • SenkenmaruProvider — 推奨の設定エントリ
  • configureSenkenmaru(options) — Provider を使わない場合の関数
  • lightTheme / darkTheme — 生の theme オブジェクト(カスタム theme 派生用)
  • breakpoints — レスポンシブブレイクポイント定義
  • web.css — Web 環境向けの互換 CSS(@senkenmaru/theme/web.css で import)
  • 型: SemanticTheme / SenkenmaruThemeName / ConfigureOptions

デザイントークン

本パッケージ内の tokens/ に 3 層セマンティック (primitive / semantic / component) で定義されています。SemanticTheme 型と lightTheme / darkTheme を直接 import すれば外部からも参照可能。詳細はルートの AGENTS.md を参照。