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

budoux-components

v0.2.0

Published

BudouX components for React, Vue, and Astro frameworks

Readme

BudouX Components

BudouX components for React, Vue, and Astro frameworks. This package provides easy-to-use components that automatically apply BudouX (the machine learning powered line break organizer) to Japanese text.

Features

  • 🚀 Easy to integrate with React, Vue, and Astro
  • 🎯 Automatically applies natural line breaks to Japanese text
  • 📦 Zero configuration required
  • 🎨 Customizable CSS classes
  • 🔧 TypeScript support

Installation

npm install budoux-components

Usage

The components wrap Japanese text segments with <span class="whitespace-nowrap"> tags to prevent unnatural line breaks. This works seamlessly with Tailwind CSS or you can define your own CSS:

.whitespace-nowrap {
  white-space: nowrap;
}

React

import BudouX from 'budoux-components/react';

function App() {
  return (
    <div>
      {/* Using text prop */}
      <BudouX text="こんにちは、世界!" />
      
      {/* Using children */}
      <BudouX>
        <span>こんにちは、世界!</span>
        日本語のテキストを自然に改行します。
      </BudouX>
      
      {/* Custom class name */}
      <BudouX text="カスタムクラス" className="no-wrap" />
    </div>
  );
}

Vue

<template>
  <div>
    <!-- Using text prop -->
    <BudouX text="こんにちは、世界!" />
    
    <!-- Using slot -->
    <BudouX>日本語のテキストを自然に改行します。</BudouX>
    
    <!-- Custom class name -->
    <BudouX text="カスタムクラス" :class-name="'no-wrap'" />
  </div>
</template>

<script>
import BudouX from 'budoux-components/vue';

export default {
  components: {
    BudouX
  }
}
</script>

Astro

---
import BudouX from 'budoux-components/astro';
---

<!-- Using text prop -->
<BudouX text="こんにちは、世界!" />

<!-- Using slot content -->
<BudouX>
  <span>こんにちは、世界!</span>
  日本語のテキストを自然に改行します。
</BudouX>

<!-- Custom class name -->
<BudouX text="カスタムクラス" class="no-wrap" />

How it works

BudouX uses machine learning to determine the most natural places to break Japanese text. The components analyze your text and wrap segments with <span> elements that prevent line breaks within each segment.

For example:

<!-- Input -->
<BudouX text="今日は天気がいいですね。" />

<!-- Output -->
<span class="whitespace-nowrap">今日は</span>
<span class="whitespace-nowrap">天気が</span>
<span class="whitespace-nowrap">いいですね。</span>

API

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | text | string | undefined | Text content to apply BudouX | | className | string | 'whitespace-nowrap' | CSS class for wrapper spans | | class (Astro) | string | 'whitespace-nowrap' | CSS class for wrapper spans |

Children / Slots

All components support children/slot content. When using children, the component will preserve HTML structure while applying BudouX to text nodes.

Development

Setup

# Clone the repository
git clone https://github.com/ideamans/budoux-components.git
cd budoux-components

# Install dependencies
npm install

# Build
npm run build

# Test
npm test

# E2E Test (automatically sets up on first run)
npm run test:e2e

About E2E Tests

When running E2E tests, the following setup is performed automatically:

  1. Install example directory dependencies
  2. Build components (if dist directory doesn't exist)
  3. Install Playwright browsers (first time only)

To run setup manually:

node scripts/setup-e2e.js

Playwright MCP Server

This project includes Playwright MCP (Model Context Protocol) server, which enables AI assistants to perform browser automation tasks.

Configuration is located at .mcp/config.json.

Requirements

  • Node.js >= 18.x
  • React >= 16.8.0 (for React component)
  • Vue >= 3.0.0 (for Vue component)

License

Apache License 2.0