@molecule/app-slide-thumbnail-solid

Feature · slide-thumbnail · App (browser) · v1.1.2 · Apache-2.0

Slide thumbnail tile for presentation editors / slideshow navigators

npm install @molecule/app-slide-thumbnail-solid

npm · Source on GitHub

How it works

@molecule/app-slide-thumbnail-solid is a ready-made slide-thumbnail feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

import { For } from 'solid-js'

import { SlideThumbnail } from '@molecule/app-slide-thumbnail-solid'

interface Slide {
  id: string
  title: string
}

export function SlideStrip(props: {
  slides: Slide[]
  activeIndex: number
  onSelect: (index: number) => void
}) {
  return (
    <div style={{ display: 'flex', 'flex-direction': 'column', gap: '8px' }}>
      <For each={props.slides}>
        {(slide, i) => (
          <SlideThumbnail
            index={i() + 1}
            active={i() === props.activeIndex}
            onClick={() => props.onSelect(i())}
            width={160}
          >
            <span>{slide.title}</span>
          </SlideThumbnail>
        )}
      </For>
    </div>
  )
}

Works with: @molecule/app-i18n, @molecule/app-solid, @molecule/app-ui, @molecule/app-ui-solid

Reference

Solid slide thumbnail tile for presentation editors / slideshow navigators. Renders a fixed-width clickable tile with an index badge and an "active" outline; the app supplies the scaled-down slide preview as children.

Solid counterpart of @molecule/app-slide-thumbnail-react: the same props (React names), the same DOM for the same input, and the same ClassMap tokens. Apps switch framework by changing only the package name in their imports.

Props: index (1-based, required), active, onClick, aspect ('16/9' | '4/3' | '1/1', default '16/9'), width (px, default 160), className, children.

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 { For } from 'solid-js'

import { SlideThumbnail } from '@molecule/app-slide-thumbnail-solid'

interface Slide {
  id: string
  title: string
}

export function SlideStrip(props: {
  slides: Slide[]
  activeIndex: number
  onSelect: (index: number) => void
}) {
  return (
    <div style={{ display: 'flex', 'flex-direction': 'column', gap: '8px' }}>
      <For each={props.slides}>
        {(slide, i) => (
          <SlideThumbnail
            index={i() + 1}
            active={i() === props.activeIndex}
            onClick={() => props.onSelect(i())}
            width={160}
          >
            <span>{slide.title}</span>
          </SlideThumbnail>
        )}
      </For>
    </div>
  )
}

Type

feature

Installation

npm install @molecule/app-slide-thumbnail-solid @molecule/app-i18n @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

SlideThumbnailProps

Props for the SlideThumbnail component.

interface SlideThumbnailProps {
  /** Slide index (1-based). */
  index: number
  /** Live preview content (rendered scaled-down). */
  children?: JSX.Element
  /** Whether the thumbnail represents the active slide. */
  active?: boolean
  /** Click handler; receives the DOM click event (React's `onClick`). */
  onClick?: (event: MouseEvent) => void
  /** Optional aspect ratio (defaults to 16/9). */
  aspect?: '16/9' | '4/3' | '1/1'
  /** Width in pixels. Defaults to 160. */
  width?: number
  /** Extra classes. */
  className?: string
}

Functions

SlideThumbnail(props)

Slide thumbnail tile for presentation editors / slideshow navigators. Apps render the live scaled-down preview as children; this component provides the surrounding chrome (active outline + index label).

function SlideThumbnail(props: SlideThumbnailProps): JSX.Element
  • props — Component props (see SlideThumbnailProps).

Returns: The rendered slide thumbnail.

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-i18n ^1.0.1
  • @molecule/app-solid ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.4.0
  • @molecule/app-ui-solid ^1.1.0
  • solid-js ^1.8.0

Runtime Dependencies

  • @molecule/app-i18n

  • @molecule/app-solid

  • @molecule/app-ui

  • @molecule/app-ui-solid

  • solid-js

  • Requires a wired ClassMap bond (e.g. @molecule/app-ui-tailwind) — getClassMap() throws before bonding.

  • The tile canvas is the theme's surface token (cm.surface) and the index badge sits on a theme scrim (cm.bgScrim + cm.textOnTone), so both follow the app's theme — render your own themed preview inside children.

  • The active outline uses currentColor; set a text color on a parent to control it.

  • The index label's aria-label comes from t('slideThumbnail.label') with an English fallback, read through the binding's useTranslation(), so a locale switch updates it at once.

  • Companion locale bond: @molecule/app-locales-slide-thumbnail.

Translations

Translation strings are provided by @molecule/app-locales-slide-thumbnail.