Touch and mobile (web)¶
LessonKit courses run in mobile and tablet browsers inside LMS shells and standalone SPAs. Framework 1.7+ adds touch-sized controls, pointer-based drag for assessment blocks, pick-and-place fallbacks on coarse-pointer devices, and shared compound navigation.
Coarse-pointer behavior¶
When (pointer: coarse) matches (typical phones/tablets):
Block |
Touch behavior |
|---|---|
|
Pick-and-place hint; HTML5 drag disabled; pointer drag still supported |
|
Tap word → tap blank; enlarged word bank chips |
|
Full-width choice rows ( |
|
Up/Down icon buttons (44px min height) |
|
Pointer drag selection; grid |
|
Full-width statement buttons |
|
44px minimum hotspot targets |
|
|
|
Swipe or |
|
Full-width |
|
|
|
|
Drag assessment blocks¶
Desktop: HTML5 drag plus keyboard pick-and-place (select item → activate target).
Touch: Tap an item to select it (aria-pressed="true"), then tap a target. Items can also be dragged with pointer capture where supported.
Manifest / resume: Serialized state still uses keyboardItem / keyboardWord keys for backward compatibility.
Touch design tokens¶
Defined in @lessonkit/themes/base.css:
Token |
Default |
Purpose |
|---|---|---|
|
|
Minimum interactive control size |
|
|
Gap between adjacent targets |
Shared classes: .lk-button, .lk-quiz-choice, .lk-compound-nav, .lk-touch-hint, .lk-accordion-trigger, .lk-flip-card, .lk-memory-card, .lk-image-sequence-thumb.
Override in your theme wrapper if your brand needs larger targets.
LMS testing checklist¶
Viewport meta present in packaged
index.html@lessonkit/themes/base.cssimportedComplete one lesson per drag block type on iOS Safari and Android Chrome
Verify SCORM/xAPI player scroll does not trap drag gestures
Confirm quiz choices and compound Next/Prev are tappable without zoom