Guide › Interactivity

Lazy attach

By default an island's code loads as soon as the page does. Add attach to load it later.

ValueLoads
attach="load"as soon as the page loads (the default)
attach="idle"once the browser has nothing else to do
attach="visible"when it scrolls into view
attach="interaction"the first time someone clicks, types or focuses inside it
<comments attach="visible" [post]="post.id" />

Nothing the visitor does is lost while the code loads: clicks, key presses, input and form submissions inside the island are held and replayed once it attaches, and a form doesn't post in the meantime. The copy buttons on this site use attach="interaction".