[{"data":1,"prerenderedAt":353},["ShallowReactive",2],{"content-\u002Fdocs\u002Fcross-cutting-state\u002Fdisabled":3},{"id":4,"title":5,"body":6,"description":333,"extension":334,"meta":335,"metaRows":336,"navigation":116,"path":348,"seo":349,"source":350,"stem":351,"__hash__":352},"docs\u002Fdocs\u002Fcross-cutting-state\u002Fdisabled.md","disabled",{"type":7,"value":8,"toc":329},"minimark",[9,12,23,26,37,42,47,56,246,252,292,302,306,325],[10,11,5],"h1",{"id":5},[13,14,15],"blockquote",{},[16,17,18,22],"p",{},[19,20,21],"code",{},"useForm({ disabled })"," freezes a reactive form so its data cannot be edited, and nothing can write around the freeze. The guarantee lives at the data layer, so a stray binding, a programmatic write, and a host component all no-op at once. Read-only review screens and hard-prerequisite steps lean on it.",[24,25],"docs-meta-table",{},[16,27,28,29,32,33,36],{},"Flip the toggle and every input freezes together. You never wrote ",[19,30,31],{},":disabled"," on a single one of them: Attaform sets the native attribute on each control from that one option, and the greyed, not-allowed look is plain ",[19,34,35],{},"input:disabled"," CSS.",[38,39],"docs-demo",{"label":40,"slug":41},"Disabled form","disabled-form",[43,44,46],"h2",{"id":45},"one-option-every-write","One option, every write",[16,48,49,51,52,55],{},[19,50,5],{}," accepts a boolean, a ref, a computed, or a getter (",[19,53,54],{},"MaybeRefOrGetter\u003Cboolean>","), unwrapped live so a reactive source keeps tracking:",[57,58,63],"pre",{"className":59,"code":60,"language":61,"meta":62,"style":62},"language-ts shiki shiki-themes github-light github-dark","import { ref } from 'vue'\nimport { useForm } from 'attaform'\nimport { z } from 'zod'\n\nconst frozen = ref(false)\n\nconst profileSchema = z.object({\n  fullName: z.string().min(1),\n  email: z.email(),\n})\n\nconst form = useForm({\n  schema: profileSchema,\n  disabled: frozen,\n})\n","ts","",[19,64,65,85,98,111,118,144,149,168,191,203,209,214,229,235,241],{"__ignoreMap":62},[66,67,70,74,78,81],"span",{"class":68,"line":69},"line",1,[66,71,73],{"class":72},"szBVR","import",[66,75,77],{"class":76},"sVt8B"," { ref } ",[66,79,80],{"class":72},"from",[66,82,84],{"class":83},"sZZnC"," 'vue'\n",[66,86,88,90,93,95],{"class":68,"line":87},2,[66,89,73],{"class":72},[66,91,92],{"class":76}," { useForm } ",[66,94,80],{"class":72},[66,96,97],{"class":83}," 'attaform'\n",[66,99,101,103,106,108],{"class":68,"line":100},3,[66,102,73],{"class":72},[66,104,105],{"class":76}," { z } ",[66,107,80],{"class":72},[66,109,110],{"class":83}," 'zod'\n",[66,112,114],{"class":68,"line":113},4,[66,115,117],{"emptyLinePlaceholder":116},true,"\n",[66,119,121,124,128,131,135,138,141],{"class":68,"line":120},5,[66,122,123],{"class":72},"const",[66,125,127],{"class":126},"sj4cs"," frozen",[66,129,130],{"class":72}," =",[66,132,134],{"class":133},"sScJk"," ref",[66,136,137],{"class":76},"(",[66,139,140],{"class":126},"false",[66,142,143],{"class":76},")\n",[66,145,147],{"class":68,"line":146},6,[66,148,117],{"emptyLinePlaceholder":116},[66,150,152,154,157,159,162,165],{"class":68,"line":151},7,[66,153,123],{"class":72},[66,155,156],{"class":126}," profileSchema",[66,158,130],{"class":72},[66,160,161],{"class":76}," z.",[66,163,164],{"class":133},"object",[66,166,167],{"class":76},"({\n",[66,169,171,174,177,180,183,185,188],{"class":68,"line":170},8,[66,172,173],{"class":76},"  fullName: z.",[66,175,176],{"class":133},"string",[66,178,179],{"class":76},"().",[66,181,182],{"class":133},"min",[66,184,137],{"class":76},[66,186,187],{"class":126},"1",[66,189,190],{"class":76},"),\n",[66,192,194,197,200],{"class":68,"line":193},9,[66,195,196],{"class":76},"  email: z.",[66,198,199],{"class":133},"email",[66,201,202],{"class":76},"(),\n",[66,204,206],{"class":68,"line":205},10,[66,207,208],{"class":76},"})\n",[66,210,212],{"class":68,"line":211},11,[66,213,117],{"emptyLinePlaceholder":116},[66,215,217,219,222,224,227],{"class":68,"line":216},12,[66,218,123],{"class":72},[66,220,221],{"class":126}," form",[66,223,130],{"class":72},[66,225,226],{"class":133}," useForm",[66,228,167],{"class":76},[66,230,232],{"class":68,"line":231},13,[66,233,234],{"class":76},"  schema: profileSchema,\n",[66,236,238],{"class":68,"line":237},14,[66,239,240],{"class":76},"  disabled: frozen,\n",[66,242,244],{"class":68,"line":243},15,[66,245,208],{"class":76},[16,247,248,249,251],{},"While ",[19,250,5],{}," resolves truthy:",[253,254,255,267,279],"ul",{},[256,257,258,262,263,266],"li",{},[259,260,261],"strong",{},"Every value write no-ops"," at Attaform's single write chokepoint, so the programmatic, ",[19,264,265],{},"v-register",", and host-model paths all fall inert together. The freeze is enforced in the data, not on the inputs, so a deep link or a rogue write cannot slip past it.",[256,268,269,275,276,278],{},[259,270,271,272,274],{},"Native inputs render the HTML ",[19,273,5],{}," attribute"," on the server and the client, component hosts and native selects receive a ",[19,277,31],{}," bind, and every field's display state settles to idle, so no error, pending, or success signal shows on a frozen field.",[256,280,281,291],{},[259,282,283,286,287,290],{},[19,284,285],{},"reset()"," and ",[19,288,289],{},"defaultValues"," still hydrate."," A frozen form can be seeded or restored, which is exactly what a read-only review screen needs.",[16,293,294,295,286,298,301],{},"The resolved state reads back on ",[19,296,297],{},"form.meta.disabled",[19,299,300],{},"field.disabled",", both read-only, so a template can style the frozen state without tracking the flag itself.",[43,303,305],{"id":304},"gating-a-wizard-step","Gating a wizard step",[16,307,308,315,316,318,319,324],{},[309,310,312],"a",{"href":311},"\u002Fdocs\u002Fmultistep\u002Fgate",[19,313,314],{},"gate(step)"," drives this same freeze for a hard prerequisite: every step after an uncleared gate is frozen through ",[19,317,5],{},", so it is un-fillable as well as unreachable, and a cleared gate's own form freezes too. See ",[309,320,321],{"href":311},[19,322,323],{},"gate"," for the full model.",[326,327,328],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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 .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":62,"searchDepth":87,"depth":87,"links":330},[331,332],{"id":45,"depth":87,"text":46},{"id":304,"depth":87,"text":305},"useForm({ disabled }) freezes a form so its data cannot be edited: a bypass-proof, data-layer freeze for read-only review screens and gated wizard steps, with every native input auto-disabled.","md",{},[337,340,342,345],{"label":338,"value":339},"Category","Form option",{"label":341,"value":21,"kind":19},"Signature",{"label":343,"value":344,"kind":19},"Accepts","boolean · ref · computed · getter",{"label":346,"value":347,"kind":19},"Reads back","form.meta.disabled · field.disabled","\u002Fdocs\u002Fcross-cutting-state\u002Fdisabled",{"title":5,"description":333},null,"docs\u002Fcross-cutting-state\u002Fdisabled","l1hAraemnQZ15rwXtSQbhhhwJHAGCrdO2XZkvZXUarA",1784252105123]