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

gitbook-plugin-platform-tabs

v1.0.0

Published

GitBook plugin for platform-specific content tabs (Android, iOS, HarmonyOS) with multi-language code samples support

Downloads

123

Readme

gitbook-plugin-platform-tabs

A GitBook plugin for displaying platform-specific content with tabbed interfaces. Supports Android, iOS, and HarmonyOS with multi-language code samples (Java/Kotlin, Objective-C/Swift, TypeScript/JavaScript).

Features

  • Single-level platform tabs: Switch between Android, iOS, and HarmonyOS content
  • Two-level code sample tabs: Platform tabs with nested language tabs for code examples
  • Mintlify-inspired design: Clean, modern UI with smooth transitions
  • Responsive: Works on desktop and mobile devices
  • Print-friendly: All content visible when printing

Installation

npm install gitbook-plugin-platform-tabs

Usage

Configuration

Add the plugin to your book.json:

{
  "plugins": ["platform-tabs"],
  "pluginsConfig": {
    "platform-tabs": {
      "defaultPlatform": "Android",
      "platforms": ["Android", "iOS", "HarmonyOS"]
    }
  }
}

Single-level Platform Tabs

Use the platformtabs block to display platform-specific content:

<!-- platformtabs id="unique-id" -->
<!-- platform:Android -->
Android specific content here...
<!-- /platform -->
<!-- platform:iOS -->
iOS specific content here...
<!-- /platform -->
<!-- platform:HarmonyOS -->
HarmonyOS specific content here...
<!-- /platform -->
<!-- /platformtabs -->

Two-level Code Sample Tabs

Use the codesample block for code examples with platform and language tabs:

<!-- codesample id="method-example" -->
<!-- platform:Android -->
<!-- lang:Java -->
```java
// Java code example
// Kotlin code example
// Objective-C code example
// Swift code example

### Liquid Tag Syntax (Alternative)

You can also use Liquid tag syntax:

```markdown
{% platformtabs id="my-tabs" %}
{% platform "Android" %}
Android content
{% endplatform %}
{% platform "iOS" %}
iOS content
{% endplatform %}
{% endplatformtabs %}
{% codesample id="code-example" %}
{% platform "Android" %}
{% lang "Java" %}
```java
// Java code

{% endlang %} {% lang "Kotlin" %}

// Kotlin code

{% endlang %} {% endplatform %} {% endcodesample %}


## Styling

The plugin includes built-in CSS with a Mintlify-inspired design. The styles include:

- Platform tab headers with icons (Font Awesome)
- Language tab pills for code samples
- Responsive layout for mobile devices
- Print styles for offline reading

Font Awesome icons are used:
- Android: `fa-android` (green)
- iOS: `fa-apple` (black)
- HarmonyOS: `fa-mobile` (red)

## Example Output

### Platform Tabs

┌─────────────────────────────────────────────────────────┐ │ [Android] [iOS] [HarmonyOS] │ ├─────────────────────────────────────────────────────────┤ │ Android specific content here... │ │ │ └─────────────────────────────────────────────────────────┘


### Code Sample Tabs

┌─────────────────────────────────────────────────────────┐ │ [Android] [iOS] [HarmonyOS] │ ├─────────────────────────────────────────────────────────┤ │ [ Java ] [ Kotlin ] │ │ ───────────────────────────────────────────────────────│ │ java │ │ // Java code example │ │ │ └─────────────────────────────────────────────────────────┘


## Development

### Project Structure

gitbook-plugin-platform-tabs/ ├── index.js # Main plugin file ├── package.json # NPM package configuration ├── README.md # This file ├── assets/ │ ├── platform-tabs.js # Client-side JavaScript │ └── platform-tabs.css # Styles └── utils/ └── defined.js # Utility functions


### Building

```bash
npm install

Testing in Local GitBook

To test the plugin in your GitBook project:

cd /path/to/your/gitbook-project
npm install /path/to/gitbook-plugin-platform-tabs

Then add it to your book.json plugins list.

License

MIT