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

@molecule/app-bias-indicator-solid

v1.1.2

Published

Political-bias / source-credibility indicator (left/right scale + reliability tier) for news article headers

Readme

@molecule/app-bias-indicator-solid

Solid political-bias / source-credibility indicator.

Exports BiasIndicator — left/right scale with marker plus optional reliability dot/chip — for news-aggregator article headers and dense article lists (compact variant). It is the Solid counterpart of @molecule/app-bias-indicator-react: same props and the same DOM for the same input.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

import { BiasIndicator } from '@molecule/app-bias-indicator-solid'

export function ArticleHeader() {
  return <BiasIndicator bias={-0.4} reliability={0.8} sourceLabel="Reuters" />
}

Type

feature

Installation

npm install @molecule/app-bias-indicator-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

BiasIndicatorProps

Props accepted by the {@link BiasIndicator} component.

interface BiasIndicatorProps {
  /**
   * Bias scalar from `-1` (far left) through `0` (center) to `+1`
   * (far right). Values are clamped before rendering.
   */
  bias: number
  /**
   * Optional source-credibility / reliability score from `0` (lowest /
   * disputed) to `1` (highest). When omitted, no reliability indicator
   * is rendered.
   */
  reliability?: number
  /**
   * Compact variant collapses the scale to a single coloured dot —
   * useful for dense lists. Defaults to `false`.
   */
  compact?: boolean
  /** Optional source name (e.g. `'Reuters'`). Renders as a small caption. */
  sourceLabel?: JSX.Element
  /** Extra classes to merge onto the root element. */
  className?: string
  /** `data-mol-id` for AI-agent / E2E selectors. */
  dataMolId?: string
}

Types

ReliabilityTier

Reliability tier — drives the colour + label of the optional dot/chip. Mapped from a 0..1 reliability score by reliabilityToTier.

type ReliabilityTier = 'high' | 'medium' | 'low' | 'disputed'

BiasBucket

Bias bucket — drives the bias-marker hue and the screen-reader label. Derived from a -1..1 bias scalar by biasToBucket.

type BiasBucket = 'far-left' | 'left' | 'center' | 'right' | 'far-right'

Functions

clamp(value, min, max)

Clamp a number into the inclusive [min, max] range.

function clamp(value: number, min: number, max: number): number
  • value — Value to clamp.
  • min — Lower bound.
  • max — Upper bound.

Returns: The clamped value.

biasToBucket(bias)

Map a -1..1 bias scalar into a coarse five-bucket label used for accessibility and colouring. Boundaries: <= -0.6 far-left, <= -0.2 left, < 0.2 center, < 0.6 right, otherwise far-right.

function biasToBucket(bias: number): BiasBucket
  • bias — Bias scalar (clamped to [-1, 1] first).

Returns: The bias bucket.

reliabilityToTier(reliability)

Map a 0..1 reliability score into a four-tier label. Boundaries: >= 0.75 high, >= 0.5 medium, >= 0.25 low, otherwise disputed.

function reliabilityToTier(reliability: number): ReliabilityTier
  • reliability — Reliability scalar (clamped to [0, 1] first).

Returns: The reliability tier.

biasToPercent(bias)

Convert a -1..1 bias value into a 0..100 percent offset for absolute positioning along the scale track.

function biasToPercent(bias: number): number
  • bias — Bias scalar (clamped to [-1, 1] first).

Returns: The percent offset from the left edge of the track.

bucketColor(bucket)

Resolve the marker colour for a given bias bucket. Uses semantic CSS custom properties so swapping themes / styling libraries does not require touching this component.

function bucketColor(bucket: BiasBucket): string
  • bucket — Bias bucket.

Returns: A var(--…) CSS color string.

tierColor(tier)

Resolve the dot colour for a given reliability tier.

function tierColor(tier: ReliabilityTier): string
  • tier — Reliability tier.

Returns: A var(--…) CSS color string.

BiasIndicator(props)

Political-bias / source-credibility indicator for news article headers. Renders a horizontal -1..+1 scale with a coloured marker at bias, plus an optional reliability dot/chip below. The compact variant collapses to a single coloured dot, suitable for dense article lists.

Colours come from semantic CSS custom properties (--color-info, --color-warning, --color-error, --color-success, --color-foreground-secondary) so per-app theming flows through without code changes.

function BiasIndicator(props: BiasIndicatorProps): JSX.Element
  • props — Component props (see BiasIndicatorProps).

Returns: The rendered indicator.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-solid ^3.14.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-solid

  • @molecule/app-ui

  • @molecule/app-ui-solid

  • solid-js

  • Requires a bonded ClassMap and an i18n provider (the component reads useTranslation()), exactly like the React package.

  • Colours come from the per-app semantic CSS custom properties, so themes flow through without code changes.

Translations

Translation strings are provided by @molecule/app-locales-bias-indicator.