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

@bernierllc/platform-selector-ui

v1.2.0

Published

Social media platform selector UI component with multi-select and platform-specific validation feedback

Downloads

378

Readme

@bernierllc/platform-selector-ui

Social media platform selector UI component with multi-select and platform-specific validation feedback.

Features

  • Multi-Platform Support: Twitter, LinkedIn, Facebook, Instagram, Mastodon, and Bluesky
  • Character Count Validation: Real-time validation against platform-specific character limits
  • Multi-Select: Select multiple platforms simultaneously
  • Visual Feedback: Clear indication of selected platforms and validation status
  • Theming: Support for light and dark themes
  • Accessibility: Full keyboard navigation support

Installation

npm install @bernierllc/platform-selector-ui

Peer Dependencies

This package requires the following peer dependencies:

{
  "react": "^18.0.0",
  "react-dom": "^18.0.0",
  "@tamagui/core": "^1.0.0",
  "tamagui": "^1.0.0"
}

Usage

Basic Usage

import React, { useState } from 'react';
import { PlatformSelector } from '@bernierllc/platform-selector-ui';

function MyComponent() {
  const [content, setContent] = useState('');
  const [selectedPlatforms, setSelectedPlatforms] = useState<string[]>([]);

  return (
    <div>
      <textarea
        value={content}
        onChange={(e) => setContent(e.target.value)}
        placeholder="Enter your content..."
      />
      <PlatformSelector
        content={content}
        selectedPlatforms={selectedPlatforms}
        onSelectionChange={setSelectedPlatforms}
      />
    </div>
  );
}

With Dark Theme

<PlatformSelector
  content={content}
  selectedPlatforms={selectedPlatforms}
  onSelectionChange={setSelectedPlatforms}
  theme="dark"
/>

Without Selection Callback

<PlatformSelector
  content={content}
  selectedPlatforms={['twitter', 'linkedin']}
/>

API

PlatformSelector Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | content | string | Yes | - | The content to validate against platform character limits | | selectedPlatforms | string[] | No | [] | Initially selected platforms | | onSelectionChange | (platforms: string[]) => void | No | - | Callback when platform selection changes | | theme | 'light' \| 'dark' | No | 'light' | Theme for the component |

Platform IDs

The following platform IDs are supported:

  • twitter - Twitter (280 characters)
  • linkedin - LinkedIn (3000 characters)
  • facebook - Facebook (63206 characters)
  • instagram - Instagram (2200 characters)
  • mastodon - Mastodon (500 characters)
  • bluesky - Bluesky (300 characters)

Platform Character Limits

| Platform | Character Limit | |----------|-----------------| | Twitter | 280 | | LinkedIn | 3000 | | Facebook | 63206 | | Instagram | 2200 | | Mastodon | 500 | | Bluesky | 300 |

Types

export interface PlatformSelectorProps {
  content: string;
  selectedPlatforms?: string[];
  onSelectionChange?: (platforms: string[]) => void;
  theme?: 'light' | 'dark';
}

export interface PlatformInfo {
  id: string;
  name: string;
  icon: string;
  maxCharacters: number;
  isValid: boolean;
  validationMessage?: string;
}

export interface ValidationResult {
  isValid: boolean;
  characterCount: number;
  maxCharacters: number;
  message?: string;
}

Examples

Social Media Publishing Form

import React, { useState } from 'react';
import { PlatformSelector } from '@bernierllc/platform-selector-ui';

function SocialPublishingForm() {
  const [content, setContent] = useState('');
  const [selectedPlatforms, setSelectedPlatforms] = useState<string[]>([]);

  const handlePublish = () => {
    console.log('Publishing to:', selectedPlatforms);
    console.log('Content:', content);
  };

  return (
    <div>
      <h1>Publish to Social Media</h1>
      <textarea
        value={content}
        onChange={(e) => setContent(e.target.value)}
        placeholder="What's on your mind?"
        rows={5}
      />
      <PlatformSelector
        content={content}
        selectedPlatforms={selectedPlatforms}
        onSelectionChange={setSelectedPlatforms}
      />
      <button
        onClick={handlePublish}
        disabled={selectedPlatforms.length === 0}
      >
        Publish
      </button>
    </div>
  );
}

Character Count Monitoring

import React, { useState } from 'react';
import { PlatformSelector } from '@bernierllc/platform-selector-ui';

function CharacterCountMonitor() {
  const [content, setContent] = useState('');

  return (
    <div>
      <input
        type="text"
        value={content}
        onChange={(e) => setContent(e.target.value)}
        placeholder="Type something..."
      />
      <p>Character count: {content.length}</p>
      <PlatformSelector
        content={content}
        selectedPlatforms={['twitter', 'mastodon', 'bluesky']}
      />
    </div>
  );
}

Dependencies

This package uses the following BernierLLC packages for platform constraints:

  • @bernierllc/social-media-content-type-twitter
  • @bernierllc/social-media-content-type-linkedin
  • @bernierllc/social-media-content-type-facebook
  • @bernierllc/social-media-content-type-instagram
  • @bernierllc/social-media-content-type-mastodon
  • @bernierllc/social-media-content-type-bluesky

License

MIT

Copyright

Copyright (c) 2025 Bernier LLC