Skip to content
English
Truss forces comes with Pro. Its preview shows once you unlock it.

How it works

A textbook figure of a six-panel truss: seven pinned joints, eleven members, a pin support at A and a roller at D. One load sits on a top joint, E, F or G. Every member force comes from the method of joints and is drawn in the tension or compression colour, with a width that grows with the force and a chip with the signed value (+ tension, − compression). The support reactions appear as arrows with their values. Drag the load along the top chord, tap a top joint or use the segmented control; it snaps to the nearest joint. Select a member on the figure to read its force, and how it was with the load at the previous joint.

Use it for

  • Teach statics: let learners see that the bottom chord pulls and the top chord pushes, and that a diagonal can change from tension to compression when the load moves.
  • Explain support reactions with the lever rule: the closer the load is to a support, the more of it that support carries.

Look elsewhere when

  • For a real structural design, use engineering software: this figure is one idealised, pin-jointed truss with loads at joints only.

Usage

import React, { useState } from 'react'
import { ExhibitTrussForces } from './ExhibitTrussForces.jsx'

export function TrussLesson() {
  const [joint, setJoint] = useState('F')
  return (
    <ExhibitTrussForces
      value={joint}
      onChange={(next, { forces }) => setJoint(next)}
      defaultMember="EB"
      load={12}
      labels={{ title: 'A load at mid-span' }}
    />
  )
}

Props

PropTypeDefaultWhat it does
value'E' | 'F' | 'G'—Controlled top joint that carries the load.
defaultValue'E' | 'F' | 'G''F'Starting load joint when uncontrolled, and what Reset returns to.
onChange(joint, details) => void—Called when the load moves, with the new joint and { reason ('drag', 'press', 'key', 'cancel' or 'reset'), previous, forces (kN by member, tension positive), reactions ({ A, D } in kN) }.
memberstring—Controlled selected member, named by its two joints: AB, BC, CD, EF, FG, AE, EB, BF, FC, CG or GD.
defaultMemberstring'EB'Member selected at the start and after Reset.
onMemberChange(member, { reason, force }) => void—Called when another member is selected, with its force in kN (tension positive).
loadnumber12Size of the load in kN. Every force scales with it; member widths are drawn relative to the largest force it can cause.
labelsobject—Replaces any built-in text: title, caption, tension, compression, zero, legendTension, legendCompression, members, memberText ('{member}', '{state}', '{value}'), readout ('{member}'), compare ('{joint}', '{value}'), compareHint, loadAt, positions (three), reactionText ('{joint}', '{value}'), unit and reset.
localestring'en'Language tag for the decimal numbers.
classNamestring—Extra class on the card, for example to set its width (30rem by default, never wider than its container).

Accessibility

  • The member chips form a radio group: Tab reaches the selected one, arrows move to the next member from left to right, Home and End go to the first and last. Each chip's name reads the member, its state and its force.
  • The load position is a segmented control (a radio group): arrows, Home and End move the load between E, F and G. The draggable load on the figure is a pointer shortcut for the same choice.
  • The readout is a polite live region: it reads the selected member, its state and force, and the comparison with the previous load position. Each reaction is a note named with its support and value. Reset is a button, marked unavailable while nothing has changed.
  • Dragging the load uses pointer capture and touch-action: none, so the page does not scroll mid-drag; a cancelled gesture returns the load to where it started.
  • Colour is not the only key: every member shows a signed value, and the readout names the state in words.

Motion

When the load moves, member colours and widths change over --ds-duration-base and the load glides to its joint; while it is dragged it follows the pointer and the forces switch when it passes the middle between two joints. With reduced motion every change lands at once.

Add it to your project

Pro members copy a prompt and their coding agent installs the source, the same way as the free components.

ExhibitTrussForces.jsxexhibit-truss-forces.csstokens.cssREADME.md

Both files install together. The stylesheet reads the design tokens in tokens.css and carries fallbacks, so it also works alone.

Charts
Trilateration comes with Pro. Its preview shows once you unlock it.