[{"data":1,"prerenderedAt":346,"buildId":347},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-host":3,"github-stars":254,"guide-nav":256},{"id":4,"title":5,"body":6,"categoryId":237,"categorySlug":238,"categoryTitle":239,"curated":240,"description":241,"editUrl":242,"extension":243,"group":244,"groupTitle":245,"kind":246,"meta":247,"navigation":248,"path":249,"seo":250,"sourceUrl":251,"stem":252,"wordCount":242,"__hash__":253},"primitives\u002Fdocs\u002Fprimitives\u002F48.sim-grids\u002F12.stage-host.md","stage.host",{"type":7,"value":8,"toc":231},"minimark",[9,13,22,70,85,90,141,145,196,200,227],[10,11,5],"h1",{"id":12},"stagehost",[14,15,16,17,21],"p",{},"A named step that runs before any gate: pointer smoothing, activity flags, anything a later ",[18,19,20],"code",{},"settle"," needs to know.",[23,24,29],"pre",{"className":25,"code":26,"language":27,"meta":28,"style":28},"language-ts shiki shiki-themes github-dark","stage.host(name: string, run: (f: GridFrame) => void): GridStage\n","ts","",[18,30,31],{"__ignoreMap":28},[32,33,36,40,44,47,51,55,58,61,64,67],"span",{"class":34,"line":35},"line",1,[32,37,39],{"class":38},"s95oV","stage.",[32,41,43],{"class":42},"svObZ","host",[32,45,46],{"class":38},"(name: string, run: (",[32,48,50],{"class":49},"s9osk","f",[32,52,54],{"class":53},"snl16",":",[32,56,57],{"class":42}," GridFrame",[32,59,60],{"class":38},") ",[32,62,63],{"class":53},"=>",[32,65,66],{"class":53}," void",[32,68,69],{"class":38},"): GridStage\n",[14,71,72,73,76,77,80,81,84],{},"Import ",[18,74,75],{},"sim"," from ",[18,78,79],{},"shaders\u002Fstd"," and use ",[18,82,83],{},"sim.grids.stage.host",".",[86,87,89],"h2",{"id":88},"parameters","Parameters",[91,92,93,109],"table",{},[94,95,96],"thead",{},[97,98,99,103,106],"tr",{},[100,101,102],"th",{},"Name",[100,104,105],{},"Type",[100,107,108],{},"Notes",[110,111,112,127],"tbody",{},[97,113,114,120,125],{},[115,116,117],"td",{},[18,118,119],{},"name",[115,121,122],{},[18,123,124],{},"string",[115,126],{},[97,128,129,134,139],{},[115,130,131],{},[18,132,133],{},"run",[115,135,136],{},[18,137,138],{},"(f: GridFrame) => void",[115,140],{},[86,142,144],{"id":143},"example","Example",[23,146,148],{"className":25,"code":147,"language":27,"meta":28,"style":28},"stage.host('cursor', (f) => { active = (f.frameParams.pointer?.x ?? 0.5) !== lastX })\n",[18,149,150],{"__ignoreMap":28},[32,151,152,154,156,159,163,166,168,170,172,175,178,181,184,188,190,193],{"class":34,"line":35},[32,153,39],{"class":38},[32,155,43],{"class":42},[32,157,158],{"class":38},"(",[32,160,162],{"class":161},"sU2Wk","'cursor'",[32,164,165],{"class":38},", (",[32,167,50],{"class":49},[32,169,60],{"class":38},[32,171,63],{"class":53},[32,173,174],{"class":38}," { active ",[32,176,177],{"class":53},"=",[32,179,180],{"class":38}," (f.frameParams.pointer?.x ",[32,182,183],{"class":53},"??",[32,185,187],{"class":186},"sDLfK"," 0.5",[32,189,60],{"class":38},[32,191,192],{"class":53},"!==",[32,194,195],{"class":38}," lastX })\n",[86,197,199],{"id":198},"see-also","See also",[201,202,203,214],"ul",{},[204,205,206,213],"li",{},[207,208,210],"a",{"href":209},"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-values",[18,211,212],{},"stage.values"," — A named step that writes this frame's values for the passes after it.",[204,215,216,222,223,226],{},[207,217,219],{"href":218},"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-settle",[18,220,221],{},"stage.settle"," — Sleep the simulation once nothing has driven it for ",[18,224,225],{},"settleMs"," of simulated time.",[228,229,230],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}",{"title":28,"searchDepth":232,"depth":232,"links":233},2,[234,235,236],{"id":88,"depth":232,"text":89},{"id":143,"depth":232,"text":144},{"id":198,"depth":232,"text":199},"sim.grids","sim-grids","Grid programs",false,"A named step that runs before any gate: pointer smoothing, activity flags, anything a later `settle` needs to know.",null,"md","simulation","Simulation","function",{},true,"\u002Fdocs\u002Fprimitives\u002Fsim-grids\u002Fstage-host",{"title":5,"description":241},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fsim\u002Fgrids.ts#L197","docs\u002Fprimitives\u002F48.sim-grids\u002F12.stage-host","qK_VHWmtIshERbOKhmT70gnCdBA4uBVyZJvUyOiuZeE",{"stars":255},6080,[257,261,265,269,273,277,281,285,289,293,297,301,305,309,313,317,321,326,330,334,338,342],{"path":258,"title":259,"description":260,"category":18},"\u002Fdocs\u002Fguide","Getting started","Shaders is a desktop app where your AI agent designs interactive effects on an infinite canvas, and you shape them by hand.",{"path":262,"title":263,"description":264,"category":18},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":266,"title":267,"description":268,"category":18},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":270,"title":271,"description":272,"category":18},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":274,"title":275,"description":276,"category":18},"\u002Fdocs\u002Fguide\u002Fprops-reactivity","Props and reactivity","Bind props to your framework's state so effects update when it changes, and animate props with an animation library.",{"path":278,"title":279,"description":280,"category":18},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":282,"title":283,"description":284,"category":18},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":286,"title":287,"description":288,"category":18},"\u002Fdocs\u002Fguide\u002Flayout-positioning","Layout and positioning","Size and place a shader in your page with CSS, as a background, a fill, or an inline block.",{"path":290,"title":291,"description":292,"category":18},"\u002Fdocs\u002Fguide\u002Fsizing-and-units","Sizing and units","Size and place layers in CSS units (px, %, vw, rem, and canvas units) that stay correct as the canvas and window resize.",{"path":294,"title":295,"description":296,"category":18},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":298,"title":299,"description":300,"category":18},"\u002Fdocs\u002Fguide\u002Fshape-effects","Shape effects","Pick the 2D, 3D or custom SVG shape that Glass, Neon, Emboss and other shape effects draw inside.",{"path":302,"title":303,"description":304,"category":18},"\u002Fdocs\u002Fguide\u002Fcolor-space","Color space","Match colors to your design tool with the output color space, and keep bright layers from clipping with tone mapping.",{"path":306,"title":307,"description":308,"category":18},"\u002Fdocs\u002Fguide\u002Fhooks-events","Hooks and events","Run code when an effect is ready to show, and show a fallback when the GPU can't run it.",{"path":310,"title":311,"description":312,"category":18},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":314,"title":315,"description":316,"category":18},"\u002Fdocs\u002Fguide\u002Fcustom-shaders","Custom components","Write your own component in TypeScript, use it like any component in the library, and write WGSL by hand when you need to.",{"path":318,"title":319,"description":320,"category":18},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":322,"title":323,"description":324,"category":325},"\u002Fdocs\u002Fguide\u002Fmcp","Working with your agent","The Shaders MCP connects your AI agent to the desktop app, so it can design shaders on your canvas and install them in your project.","workflows",{"path":327,"title":328,"description":329,"category":325},"\u002Fdocs\u002Fguide\u002Fcli","Working with the CLI","The Shaders CLI installs shaders from your projects and the Pro library into your codebase as component files, and keeps them in sync as you keep designing.",{"path":331,"title":332,"description":333,"category":325},"\u002Fdocs\u002Fguide\u002Fframeworks","Supported frameworks","Shaders runs in any web project that renders in a browser with WebGPU, with components for React, Vue, Svelte and Solid and a JavaScript API for everything else.",{"path":335,"title":336,"description":337,"category":18},"\u002Fdocs\u002Fguide\u002Fagent-skill","Agent skill for the engine","Teach your coding agent to write Shaders code with the open-source engine, for when it's working in your codebase instead of on the canvas.",{"path":339,"title":340,"description":341,"category":18},"\u002Fdocs\u002Fguide\u002Fvideo-rendering","Rendering to video","Render a shader effect to video frame by frame, from Remotion, Hyperframes or your own headless Chrome script.",{"path":343,"title":344,"description":345,"category":18},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051187001,"06e02370-81a6-4d74-9931-661d71414be1"]