[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"guide-nav":3,"doc-\u002Fdocs\u002Fprimitives\u002Fvalues":145},[4,10,16,20,24,28,32,36,40,44,48,52,56,60,64,69,73,78,82,86,90,94,98,102,106,110,114,117,120,124,127,131,134,138,141],{"path":5,"title":6,"description":7,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide","Getting started","Shaders is a library of GPU effect components for Vue, React, Svelte, Solid, JavaScript and Framer, with a design editor for building with them.","code",null,{"path":11,"title":12,"description":13,"category":8,"exclude":14,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fquickstart","Quickstart","Install Shaders, render your first effect, and drive a prop from state.",[15],"js",{"path":17,"title":18,"description":19,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcomposing-effects","Composing effects","Stack components as layers and nest them to control which layers an effect touches.",{"path":21,"title":22,"description":23,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fblending-masking","Blending and masking","Control how a layer mixes with the layers below it, and reveal one layer through another.",{"path":25,"title":26,"description":27,"category":8,"exclude":9,"forceFramework":9},"\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":29,"title":30,"description":31,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fdynamic-props","Dynamic props","Drive any numeric or position prop from time, the cursor, or another layer, without writing animation code.",{"path":33,"title":34,"description":35,"category":8,"exclude":9,"forceFramework":9},"\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":37,"title":38,"description":39,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Ftransforms","Transforms","Position, size, and rotate any layer inside the canvas with a bounding box, in % or px units.",{"path":41,"title":42,"description":43,"category":8,"exclude":9,"forceFramework":9},"\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":45,"title":46,"description":47,"category":8,"exclude":9,"forceFramework":9},"\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":49,"title":50,"description":51,"category":8,"exclude":9,"forceFramework":9},"\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":53,"title":54,"description":55,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fperformance","Performance","Learn what makes an effect expensive on the GPU and how to keep it inside the frame budget.",{"path":57,"title":58,"description":59,"category":8,"exclude":9,"forceFramework":9},"\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":61,"title":62,"description":63,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Ftelemetry","Telemetry","The `\u003CShader>` component occasionally sends an anonymous performance report to help us improve the engine over time.",{"path":65,"title":66,"description":67,"category":68,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fmcp","Shaders MCP","Connect your AI coding agent to Shaders so it can find, install and edit effects in your codebase.","workflows",{"path":70,"title":71,"description":72,"category":68,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcli","Shaders CLI","Install shaders and presets into your codebase as component files, and keep them in sync with the design editor.",{"path":74,"title":75,"description":76,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fquick-tour-of-the-design-editor","Quick tour of the design editor","A short walkthrough of the full Shaders workflow, from designing on the infinite canvas to exporting code.","editor",{"path":79,"title":80,"description":81,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fintro-to-the-interface","Intro to the interface","A tour of the design editor interface: the canvas, layers, the Properties panel, and the ways to share and export.",{"path":83,"title":84,"description":85,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcomposing-your-first-shader-effect","Composing your first shader effect","Building a first shader effect in the design editor by stacking and nesting components as layers.",{"path":87,"title":88,"description":89,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fmasking-and-blending","Masking and blending","How blend modes and masks combine components in the design editor.",{"path":91,"title":92,"description":93,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fdynamic-prop-mapping","Dynamic prop mapping","Turning static props into dynamic ones in the design editor: mapping one layer's output into another's prop, following the cursor, or animating automatically.",{"path":95,"title":96,"description":97,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fcustom-media-and-transformations","Custom media and transformations","Uploading images, videos, and SVG files to the media gallery, adding them to a composition, and placing them with transformations.",{"path":99,"title":100,"description":101,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Finstalling-a-shader-via-mcp","Installing a shader via MCP","Installing a shader from the design editor into a hero section with the Shaders MCP.",{"path":103,"title":104,"description":105,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fexploring-shape-effects","Exploring shape effects","Applying shape effects such as liquid glass, liquid metal, and glowing edges to built-in shapes and your own SVG.",{"path":107,"title":108,"description":109,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fglass-component-spotlight","Component spotlight: Glass","A short look at the Glass component and the liquid-glass look it creates.",{"path":111,"title":112,"description":113,"category":77,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fdigital-looks-component-spotlight","Component spotlight: Digital looks","A look at the digital stylization components for glitchy, futuristic, or technical effects.",{"path":115,"title":12,"description":116,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fjs\u002Fquickstart","Install Shaders without a framework, render your first effect on a canvas, and update props at runtime.",{"path":118,"title":12,"description":119,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Freact\u002Fquickstart","Install Shaders in a React app, render your first effect, and drive a prop from state.",{"path":121,"title":122,"description":123,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Freact\u002Fssr","Next.js and SSR","Render Shaders in Next.js and other React SSR apps by keeping each shader on the client.",{"path":125,"title":12,"description":126,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fquickstart","Install Shaders in a Solid app, render your first effect, and drive a prop from a signal.",{"path":128,"title":129,"description":130,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsolid\u002Fssr","SolidStart and SSR","Render Shaders in SolidStart and other Solid SSR apps by keeping each shader on the client.",{"path":132,"title":12,"description":133,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fquickstart","Install Shaders in a Svelte app, render your first effect, and drive a prop from state.",{"path":135,"title":136,"description":137,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fsvelte\u002Fssr","SvelteKit and SSR","Render Shaders in SvelteKit and other Svelte SSR apps, where each shader already waits for the browser.",{"path":139,"title":12,"description":140,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fvue\u002Fquickstart","Install Shaders in a Vue app, render your first effect, and drive a prop from a ref.",{"path":142,"title":143,"description":144,"category":8,"exclude":9,"forceFramework":9},"\u002Fdocs\u002Fguide\u002Fvue\u002Fssr","Nuxt and SSR","Render Shaders in Nuxt and other Vue SSR apps by keeping each shader on the client.",{"id":146,"title":147,"body":148,"categoryId":709,"categorySlug":709,"categoryTitle":9,"curated":339,"description":710,"editUrl":711,"extension":712,"group":713,"groupTitle":714,"kind":9,"meta":715,"navigation":339,"path":716,"seo":717,"sourceUrl":718,"stem":719,"wordCount":336,"__hash__":720},"primitives\u002Fdocs\u002Fprimitives\u002F2.values\u002Findex.md","Props & values",{"type":149,"value":150,"toc":703},"minimark",[151,155,192,203,232,237,314,318,587,591,662,666,699],[152,153,147],"h1",{"id":154},"props-values",[156,157,158,159,162,163,167,168,171,172,175,176,179,180,183,184,187,188,191],"p",{},"How a definition points at its own props. ",[8,160,161],{},"p('radius')"," is a ",[164,165,166],"strong",{},"prop ref",": hand it to any word\nthat takes a color, a position or a number and the word reads that prop live on the GPU, with\ndrivers and animation applied, and no rebuild when the value changes. A ",[164,169,170],{},"Scalar"," is a number\nbuilt from props and masks. ",[8,173,174],{},"radialMask(…)"," returns one, so does ",[8,177,178],{},"oscillating(…)"," from\n",[8,181,182],{},"motion",", and ",[8,185,186],{},".times(p('intensity'))"," scales one by a prop. Words that take a ",[8,189,190],{},"ScalarInput","\naccept either a prop ref or a Scalar.",[156,193,194,195,198,199,202],{},"Prop refs and Scalars are data, not GPU values. A word turns them into GPU values when the\nshader is built. In a hand-written builder you do that yourself with ",[8,196,197],{},"uniformOf"," and\n",[8,200,201],{},"resolveScalar"," from the invocation words.",[204,205,210],"pre",{"className":206,"code":207,"language":208,"meta":209,"style":209},"language-ts shiki shiki-themes github-dark","import {p, Scalar} from 'shaders\u002Fstd'\n","ts","",[8,211,212],{"__ignoreMap":209},[213,214,217,221,225,228],"span",{"class":215,"line":216},"line",1,[213,218,220],{"class":219},"snl16","import",[213,222,224],{"class":223},"s95oV"," {p, Scalar} ",[213,226,227],{"class":219},"from",[213,229,231],{"class":230},"sU2Wk"," 'shaders\u002Fstd'\n",[233,234,236],"h2",{"id":235},"reach-for-it-when","Reach for it when",[238,239,240,253],"table",{},[241,242,243],"thead",{},[244,245,246,250],"tr",{},[247,248,249],"th",{},"When you need",[247,251,252],{},"Use",[254,255,256,270,286,305],"tbody",{},[244,257,258,262],{},[259,260,261],"td",{},"a word should read one of your props",[259,263,264],{},[265,266,268],"a",{"href":267},"\u002Fdocs\u002Fprimitives\u002Fvalues\u002Fp",[8,269,156],{},[244,271,272,275],{},[259,273,274],{},"a strength that fades with distance from a point, scaled by a prop",[259,276,277,280,281],{},[8,278,279],{},"radialMask"," chained with .times(p('intensity')) on the ",[265,282,284],{"href":283},"\u002Fdocs\u002Fprimitives\u002Fvalues\u002Fscalar",[8,285,170],{},[244,287,288,291],{},[259,289,290],{},"a value that breathes or pulses on its own",[259,292,293,296,297,300,301],{},[8,294,295],{},"oscillating"," or ",[8,298,299],{},"pulsing"," from motion, as a ",[265,302,303],{"href":283},[8,304,170],{},[244,306,307,310],{},[259,308,309],{},"a prop's value inside a hand-written builder",[259,311,312],{},[8,313,197],{},[233,315,317],{"id":316},"example","Example",[204,319,321],{"className":206,"code":320,"language":208,"meta":209,"style":209},"import {defineShader, p, tintToward, radialMask, crosses, isZero, transformColor, transformPosition} from 'shaders\u002Fstd'\n\n\u002F\u002F A vignette: tint the layer inside toward a color, strongest past a radius from a point.\nexport const Vignette = defineShader({\n  name: 'Vignette',\n  props: {\n    color: {default: '#000000', transform: transformColor},\n    center: {default: {x: 0.5, y: 0.5}, transform: transformPosition},\n    radius: {default: 0.4},\n    falloff: {default: 0.6},\n    intensity: {default: 1, recompile: crosses(0)},\n  },\n  effect: tintToward(p('color'), {\n    amount: radialMask({center: p('center'), radius: p('radius'), falloff: p('falloff')}).times(p('intensity')),\n  }),\n  identityWhen: isZero('intensity'),\n  missingChildMessage: 'Nest a layer inside Vignette to darken its edges.',\n})\n",[8,322,323,334,341,348,371,383,389,401,418,430,441,465,471,492,548,554,570,581],{"__ignoreMap":209},[213,324,325,327,330,332],{"class":215,"line":216},[213,326,220],{"class":219},[213,328,329],{"class":223}," {defineShader, p, tintToward, radialMask, crosses, isZero, transformColor, transformPosition} ",[213,331,227],{"class":219},[213,333,231],{"class":230},[213,335,337],{"class":215,"line":336},2,[213,338,340],{"emptyLinePlaceholder":339},true,"\n",[213,342,344],{"class":215,"line":343},3,[213,345,347],{"class":346},"sAwPA","\u002F\u002F A vignette: tint the layer inside toward a color, strongest past a radius from a point.\n",[213,349,351,354,357,361,364,368],{"class":215,"line":350},4,[213,352,353],{"class":219},"export",[213,355,356],{"class":219}," const",[213,358,360],{"class":359},"sDLfK"," Vignette",[213,362,363],{"class":219}," =",[213,365,367],{"class":366},"svObZ"," defineShader",[213,369,370],{"class":223},"({\n",[213,372,374,377,380],{"class":215,"line":373},5,[213,375,376],{"class":223},"  name: ",[213,378,379],{"class":230},"'Vignette'",[213,381,382],{"class":223},",\n",[213,384,386],{"class":215,"line":385},6,[213,387,388],{"class":223},"  props: {\n",[213,390,392,395,398],{"class":215,"line":391},7,[213,393,394],{"class":223},"    color: {default: ",[213,396,397],{"class":230},"'#000000'",[213,399,400],{"class":223},", transform: transformColor},\n",[213,402,404,407,410,413,415],{"class":215,"line":403},8,[213,405,406],{"class":223},"    center: {default: {x: ",[213,408,409],{"class":359},"0.5",[213,411,412],{"class":223},", y: ",[213,414,409],{"class":359},[213,416,417],{"class":223},"}, transform: transformPosition},\n",[213,419,421,424,427],{"class":215,"line":420},9,[213,422,423],{"class":223},"    radius: {default: ",[213,425,426],{"class":359},"0.4",[213,428,429],{"class":223},"},\n",[213,431,433,436,439],{"class":215,"line":432},10,[213,434,435],{"class":223},"    falloff: {default: ",[213,437,438],{"class":359},"0.6",[213,440,429],{"class":223},[213,442,444,447,450,453,456,459,462],{"class":215,"line":443},11,[213,445,446],{"class":223},"    intensity: {default: ",[213,448,449],{"class":359},"1",[213,451,452],{"class":223},", recompile: ",[213,454,455],{"class":366},"crosses",[213,457,458],{"class":223},"(",[213,460,461],{"class":359},"0",[213,463,464],{"class":223},")},\n",[213,466,468],{"class":215,"line":467},12,[213,469,470],{"class":223},"  },\n",[213,472,474,477,480,482,484,486,489],{"class":215,"line":473},13,[213,475,476],{"class":223},"  effect: ",[213,478,479],{"class":366},"tintToward",[213,481,458],{"class":223},[213,483,156],{"class":366},[213,485,458],{"class":223},[213,487,488],{"class":230},"'color'",[213,490,491],{"class":223},"), {\n",[213,493,495,498,500,503,505,507,510,513,515,517,520,523,525,527,530,533,536,538,540,542,545],{"class":215,"line":494},14,[213,496,497],{"class":223},"    amount: ",[213,499,279],{"class":366},[213,501,502],{"class":223},"({center: ",[213,504,156],{"class":366},[213,506,458],{"class":223},[213,508,509],{"class":230},"'center'",[213,511,512],{"class":223},"), radius: ",[213,514,156],{"class":366},[213,516,458],{"class":223},[213,518,519],{"class":230},"'radius'",[213,521,522],{"class":223},"), falloff: ",[213,524,156],{"class":366},[213,526,458],{"class":223},[213,528,529],{"class":230},"'falloff'",[213,531,532],{"class":223},")}).",[213,534,535],{"class":366},"times",[213,537,458],{"class":223},[213,539,156],{"class":366},[213,541,458],{"class":223},[213,543,544],{"class":230},"'intensity'",[213,546,547],{"class":223},")),\n",[213,549,551],{"class":215,"line":550},15,[213,552,553],{"class":223},"  }),\n",[213,555,557,560,563,565,567],{"class":215,"line":556},16,[213,558,559],{"class":223},"  identityWhen: ",[213,561,562],{"class":366},"isZero",[213,564,458],{"class":223},[213,566,544],{"class":230},[213,568,569],{"class":223},"),\n",[213,571,573,576,579],{"class":215,"line":572},17,[213,574,575],{"class":223},"  missingChildMessage: ",[213,577,578],{"class":230},"'Nest a layer inside Vignette to darken its edges.'",[213,580,382],{"class":223},[213,582,584],{"class":215,"line":583},18,[213,585,586],{"class":223},"})\n",[233,588,590],{"id":589},"types","Types",[238,592,593,603],{},[241,594,595],{},[244,596,597,600],{},[247,598,599],{},"Type",[247,601,602],{},"What it is",[254,604,605,615,631,644],{},[244,606,607,612],{},[259,608,609],{},[8,610,611],{},"PropRef",[259,613,614],{},"A reference to one of the definition's props by name.",[244,616,617,621],{},[259,618,619],{},[8,620,190],{},[259,622,623,624,627,628,630],{},"What a number-valued input accepts: a prop ref ",[8,625,626],{},"p('x')"," or a ",[8,629,170],{},".",[244,632,633,638],{},[259,634,635],{},[8,636,637],{},"ScalarSource",[259,639,640,641,643],{},"The shapes a ",[8,642,170],{}," can hold: a prop, a product of two values, a radial mask, or a live signal.",[244,645,646,651],{},[259,647,648],{},[8,649,650],{},"SignalSlotParams",[259,652,653,654,657,658,661],{},"What a signal is given when it builds: the props, and the context values where the host has them (a warp's ",[8,655,656],{},"map:"," has no ",[8,659,660],{},"ctx",").",[233,663,665],{"id":664},"words","Words",[667,668,670],"primitive-words",{":words":669},"[{\"name\":\"p\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fvalues\u002Fp\",\"summary\":\"Reference one of the definition's props by name, wherever a word asks for a value.\"},{\"name\":\"Scalar\",\"path\":\"\u002Fdocs\u002Fprimitives\u002Fvalues\u002Fscalar\",\"summary\":\"A number built from props: what `radialMask(…)`, `motion.oscillating(…)` and `.times()` return.\"}]",[671,672,673,681],"ul",{},[674,675,676,680],"li",{},[265,677,678],{"href":267},[8,679,156],{}," — Reference one of the definition's props by name, wherever a word asks for a value.",[674,682,683,687,688,690,691,694,695,698],{},[265,684,685],{"href":283},[8,686,170],{}," — A number built from props: what ",[8,689,174],{},", ",[8,692,693],{},"motion.oscillating(…)"," and ",[8,696,697],{},".times()"," return.",[700,701,702],"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);}html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}",{"title":209,"searchDepth":336,"depth":336,"links":704},[705,706,707,708],{"id":235,"depth":336,"text":236},{"id":316,"depth":336,"text":317},{"id":589,"depth":336,"text":590},{"id":664,"depth":336,"text":665},"values","How a definition points at its own props. p('radius') is a prop ref: hand it to any word that takes a color, a position or a number and the word reads that prop live on the GPU, with drivers and animation applied, and no rebuild when the value changes.","https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fedit\u002Fmain\u002Fpackages\u002Fcore\u002Fdocs\u002Fstd\u002Fvalues.md","md","define","Defining a shader",{},"\u002Fdocs\u002Fprimitives\u002Fvalues",{"title":147,"description":710},"https:\u002F\u002Fgithub.com\u002Fshader-effects-inc\u002Fshaders\u002Fblob\u002Fmain\u002Fpackages\u002Fcore\u002Fsrc\u002Fstd\u002Fvalues.ts","docs\u002Fprimitives\u002F2.values\u002Findex","wQmqUuQ-mBq5kA_f5n6BaaoK02qTsIPWCBh46q7asmc"]