Type Event Revision Release 2026.3728 Keywords fold, foldable, hinge, posture See also display.getReservedRegions() system.getInfo() system.hasEventSource() resize
A fold event occurs when a foldable device’s hinge changes state, for example when it is opened flat, half opened into a “tabletop” or “book” posture, or closed.
Fold event listeners can only be set up via the Runtime object. Soon after you add a listener, an event reports the device’s current state.
Folding or unfolding a device usually changes the size of the app’s view too. Use the resize event to
iOS / iPadOS — iOS 27.1 or later, on devices with a hinge.
Android — Android 6.0 or later. Set supportsFoldables = true in the android table of build.settings (see Advanced Build Settings).
Simulator — Use a foldable skin such as Pixel 10 Pro Fold or iPhone Duo, then choose Hardware > Unfold to switch between the folded and unfolded states.
Use system.hasEventSource( "fold" )
local function onFold( event )
print( "Fold state: " .. event.state )
if ( event.state == "halfOpen" and event.orientation == "horizontal" and event.bounds ) then
-- Tabletop posture: keep content above the hinge, controls below it
local hingeY = event.bounds.y + event.bounds.height
print( "Hinge ends at y = " .. hingeY )
end
end
if system.hasEventSource( "fold" ) then
Runtime:addEventListener( "fold", onFold )
end