@molecule/app-feature-transport-bar-solid

Feature · feature-transport-bar · App (browser) · v1.1.2 · Apache-2.0

Transport-control bar (play / pause / stop / record / skip / loop) used by music-daw + video-editor for editor playback control

npm install @molecule/app-feature-transport-bar-solid

npm · Source on GitHub

How it works

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

import { createSignal } from 'solid-js'
import { TransportBar } from '@molecule/app-feature-transport-bar-solid'

export function EditorTransport() {
  const [playing, setPlaying] = createSignal(false)
  const [recording, setRecording] = createSignal(false)
  const [loop, setLoop] = createSignal(false)
  return (
    <TransportBar
      isPlaying={playing()}
      isRecording={recording()}
      loop={loop()}
      onPlayToggle={() => setPlaying(!playing())}
      onStop={() => setPlaying(false)}
      onRecordToggle={() => setRecording(!recording())}
      onLoopToggle={() => setLoop(!loop())}
      timeDisplay="0:42 / 3:10"
    />
  )
}

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

Reference

Solid transport bar — play / pause / stop / record / skip / loop controls for editor playback (music DAW, video editor, animation tool).

Exports TransportBar. All styling routes through getClassMap() and all button labels translate via the companion @molecule/app-locales-feature-transport-bar locale bond. It is the Solid counterpart of @molecule/app-feature-transport-bar-react: the same props, the same DOM for the same input, and the same callbacks.

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 { createSignal } from 'solid-js'
import { TransportBar } from '@molecule/app-feature-transport-bar-solid'

export function EditorTransport() {
  const [playing, setPlaying] = createSignal(false)
  const [recording, setRecording] = createSignal(false)
  const [loop, setLoop] = createSignal(false)
  return (
    <TransportBar
      isPlaying={playing()}
      isRecording={recording()}
      loop={loop()}
      onPlayToggle={() => setPlaying(!playing())}
      onStop={() => setPlaying(false)}
      onRecordToggle={() => setRecording(!recording())}
      onLoopToggle={() => setLoop(!loop())}
      timeDisplay="0:42 / 3:10"
    />
  )
}

Type

feature

Installation

npm install @molecule/app-feature-transport-bar-solid @molecule/app-solid @molecule/app-ui @molecule/app-ui-solid solid-js

API

Interfaces

TransportBarProps

Transport-bar component props.

interface TransportBarProps {
  /**
   * Whether playback is currently running. Drives the play / pause toggle
   * button's icon, label, and `aria-pressed` state.
   */
  isPlaying: boolean
  /**
   * Whether recording is currently armed / running. Drives the record
   * button's icon, label, and `aria-pressed` state. The record button
   * itself renders only when `onRecordToggle` is provided.
   */
  isRecording?: boolean
  /**
   * Whether the stop button is enabled. When `false`, the button still
   * renders but is `disabled` (use this to communicate that there is
   * nothing to stop). Defaults to `true` when omitted.
   */
  canStop?: boolean
  /**
   * Whether the skip-back / skip-forward buttons are enabled. When
   * `false`, the buttons still render but are `disabled`. Defaults to
   * `true` when omitted. Skip buttons only render when their respective
   * `onSkipBack` / `onSkipForward` handlers are provided.
   */
  canSkip?: boolean
  /**
   * Whether loop playback is currently engaged. Drives the loop
   * button's `aria-pressed` state. The loop button itself renders only
   * when `onLoopToggle` is provided.
   */
  loop?: boolean
  /** Toggle play / pause. Required. */
  onPlayToggle: (event: Event) => void
  /** Stop playback (resets to start). Required. */
  onStop: (event: Event) => void
  /** Skip to the previous marker / start of clip. Optional. */
  onSkipBack?: (event: Event) => void
  /** Skip to the next marker / end of clip. Optional. */
  onSkipForward?: (event: Event) => void
  /** Toggle record mode. Optional — when omitted no record button is rendered. */
  onRecordToggle?: (event: Event) => void
  /** Toggle loop mode. Optional — when omitted no loop button is rendered. */
  onLoopToggle?: (event: Event) => void
  /**
   * Optional time-display slot rendered alongside the controls (typical
   * use: `current / total` time). Takes precedence over `children`.
   */
  timeDisplay?: JSX.Element
  /**
   * Optional time-display slot. Equivalent to `timeDisplay` — provided
   * for ergonomic JSX nesting. Ignored when `timeDisplay` is set.
   */
  children?: JSX.Element
  /** Extra classes merged onto the root element. */
  className?: string
}

Functions

TransportBar(props)

Transport-control bar (play / pause / stop / record / skip / loop) used by music-daw + video-editor surfaces for editor playback control. Renders a horizontal bar of buttons with semantic icons and fully translated aria-labels; an optional time-display slot lets callers render the current playhead position / total duration without coupling the bar to any specific time-format library.

Solid counterpart of @molecule/app-feature-transport-bar-react's TransportBar — the same props (React names), the same DOM for the same input, and the same callbacks.

function TransportBar(props: TransportBarProps): JSX.Element
  • props — Component props (see TransportBarProps).

Returns: The rendered transport bar.

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 (getClassMap() throws otherwise).

  • All user-visible text (button labels) routes through t() via the companion @molecule/app-locales-feature-transport-bar locale bond.

  • timeDisplay is React's optional time-display slot; it takes precedence over children, which fills the same slot when timeDisplay is omitted.

Translations

Translation strings are provided by @molecule/app-locales-feature-transport-bar.