[{"data":1,"prerenderedAt":235,"buildId":236},["ShallowReactive",2],{"doc-\u002Fdocs\u002Fprimitives\u002Finputs-events":3,"github-stars":143,"guide-nav":145},{"id":4,"title":5,"body":6,"categoryId":128,"categorySlug":129,"categoryTitle":130,"curated":131,"description":132,"editUrl":133,"extension":134,"group":135,"groupTitle":136,"kind":130,"meta":137,"navigation":138,"path":139,"seo":140,"sourceUrl":133,"stem":141,"wordCount":31,"__hash__":142},"primitives\u002Fdocs\u002Fprimitives\u002F43.inputs-events\u002Findex.md","Events",{"type":7,"value":8,"toc":123},"minimark",[9,13,17,47,52,82,86,119],[10,11,5],"h1",{"id":12},"events",[14,15,16],"p",{},"Discrete events as an input: the most recent presses on the canvas, each with where it happened, how long ago, and a random seed of its own. Overlapping transients (click ripples, bursts, rain on a puddle) need a queue, which a boolean prop cannot be.",[18,19,24],"pre",{"className":20,"code":21,"language":22,"meta":23,"style":23},"language-ts shiki shiki-themes github-dark","import {events} from 'shaders\u002Fstd'\n","ts","",[25,26,27],"code",{"__ignoreMap":23},[28,29,32,36,40,43],"span",{"class":30,"line":31},"line",1,[28,33,35],{"class":34},"snl16","import",[28,37,39],{"class":38},"s95oV"," {events} ",[28,41,42],{"class":34},"from",[28,44,46],{"class":45},"sU2Wk"," 'shaders\u002Fstd'\n",[48,49,51],"h2",{"id":50},"types","Types",[53,54,55,68],"table",{},[56,57,58],"thead",{},[59,60,61,65],"tr",{},[62,63,64],"th",{},"Type",[62,66,67],{},"What it is",[69,70,71],"tbody",{},[59,72,73,79],{},[74,75,76],"td",{},[25,77,78],{},"EventsInput",[74,80,81],{},"interface EventsInput extends InputNode { readonly kind: 'events' readonly source: 'click' readonly max: number readonly maxAge: number }",[48,83,85],{"id":84},"words","Words",[87,88,90],"primitive-words",{":words":89},"[{\"name\":\"events\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Finputs-events\u002Fevents\",\"summary\":\"The last `max` presses (up to 32) on the canvas within `maxAge` seconds, read by slot: `clicks(i)` is a `vec4f` of (x, y in uv, age in seconds, seed 0–1).\"}]",[91,92,93],"ul",{},[94,95,96,102,103,106,107,110,111,114,115,118],"li",{},[97,98,100],"a",{"href":99},"\u002Fdocs\u002Fprimitives\u002Finputs-events\u002Fevents",[25,101,12],{}," — The last ",[25,104,105],{},"max"," presses (up to 32) on the canvas within ",[25,108,109],{},"maxAge"," seconds, read by slot: ",[25,112,113],{},"clicks(i)"," is a ",[25,116,117],{},"vec4f"," of (x, y in uv, age in seconds, seed 0–1).",[120,121,122],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}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);}",{"title":23,"searchDepth":124,"depth":124,"links":125},2,[126,127],{"id":50,"depth":124,"text":51},{"id":84,"depth":124,"text":85},"inputs.events","inputs-events",null,false,"Discrete events as an input: the most recent presses on the canvas, each with where it happened, how long ago, and a random seed of its own.","https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Finputs\u002Fevents.ts","md","inputs","Inputs",{},true,"\u002Fdocs\u002Fprimitives\u002Finputs-events",{"title":5,"description":132},"docs\u002Fprimitives\u002F43.inputs-events\u002Findex","qC1rGiXHKymxlesmn-KVBZwWdBo2g20k7mzeCv4fkuI",{"stars":144},6080,[146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,215,219,223,227,231],{"path":147,"title":148,"description":149,"category":25},"\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":151,"title":152,"description":153,"category":25},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",{"path":155,"title":156,"description":157,"category":25},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":159,"title":160,"description":161,"category":25},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":163,"title":164,"description":165,"category":25},"\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":167,"title":168,"description":169,"category":25},"\u002Fdocs\u002Fguide\u002Fanimation","Animating a shader","Tween a shader's props with Motion, GSAP or anything else that animates a number.",{"path":171,"title":172,"description":173,"category":25},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":175,"title":176,"description":177,"category":25},"\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":179,"title":180,"description":181,"category":25},"\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":183,"title":184,"description":185,"category":25},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in any CSS unit.",{"path":187,"title":188,"description":189,"category":25},"\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":191,"title":192,"description":193,"category":25},"\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":195,"title":196,"description":197,"category":25},"\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":199,"title":200,"description":201,"category":25},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":203,"title":204,"description":205,"category":25},"\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":207,"title":208,"description":209,"category":25},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":211,"title":212,"description":213,"category":214},"\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":216,"title":217,"description":218,"category":214},"\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":220,"title":221,"description":222,"category":214},"\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":224,"title":225,"description":226,"category":25},"\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":228,"title":229,"description":230,"category":25},"\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":232,"title":233,"description":234,"category":25},"\u002Fdocs\u002Fguide\u002Fssr","Server rendering","Render Shaders in Next.js, Nuxt, SvelteKit, SolidStart and other SSR apps by keeping each shader on the client.",1796051186150,"06e02370-81a6-4d74-9931-661d71414be1"]