"use strict";(self.webpackChunkreact_bootstrap_website=self.webpackChunkreact_bootstrap_website||[]).push([[1110],{62967:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>m,contentTitle:()=>d,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>p});var t=n(85893),r=n(11151);const s='import Button from \'react-bootstrap/Button\';\nimport Form from \'react-bootstrap/Form\';\n\nfunction BasicExample() {\n return (\n
\n Email address\n \n \n We\'ll never share your email with anyone else.\n \n \n\n \n Password\n \n \n \n \n \n \n \n );\n}\n\nexport default BasicExample;\n',a='import Button from \'react-bootstrap/Button\';\nimport Form from \'react-bootstrap/Form\';\n\nfunction FormDisabledExample() {\n return (\n \n );\n}\n\nexport default FormDisabledExample;\n',l='import Form from \'react-bootstrap/Form\';\n\nfunction FormDisabledInputExample() {\n return (\n <>\n \n Disabled input\n \n \n \n Disabled select menu\n \n \n \n \n \n \n \n >\n );\n}\n\nexport default FormDisabledInputExample;\n',i={title:"Forms",description:"Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.",sidebar_label:"Overview",sidebar_position:1},d=void 0,c={id:"forms/overview",title:"Forms",description:"Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.",source:"@site/docs/forms/overview.mdx",sourceDirName:"forms",slug:"/forms/overview",permalink:"/docs/forms/overview",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Forms",description:"Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.",sidebar_label:"Overview",sidebar_position:1},sidebar:"sidebar",previous:{title:"Stacks",permalink:"/docs/layout/stack"},next:{title:"Form controls",permalink:"/docs/forms/form-control"}},m={},p=[{value:"Overview",id:"overview",level:2},{value:"Disabled forms",id:"disabled-forms",level:2},{value:"API",id:"api",level:2},{value:"Form",id:"form",level:3},{value:"FormLabel",id:"formlabel",level:3}];function u(e){const o={code:"code",h2:"h2",h3:"h3",p:"p",...(0,r.a)(),...e.components},{CodeBlock:n,PropsTable:i}=o;return n||b("CodeBlock",!0),i||b("PropsTable",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.h2,{id:"overview",children:"Overview"}),"\n",(0,t.jsxs)(o.p,{children:["The ",(0,t.jsx)(o.code,{children:""})," component renders a form control with Bootstrap styling.\nThe ",(0,t.jsx)(o.code,{children:""})," component wraps a form control with proper spacing, along\nwith support for a label, help text, and validation state. To ensure\naccessibility, set ",(0,t.jsx)(o.code,{children:"controlId"})," on ",(0,t.jsx)(o.code,{children:""}),", and use ",(0,t.jsx)(o.code,{children:""})," for\nthe label."]}),"\n",(0,t.jsx)(n,{language:"jsx",live:!0,children:s}),"\n",(0,t.jsxs)(o.p,{children:["The ",(0,t.jsx)(o.code,{children:""})," component directly renders the ",(0,t.jsx)(o.code,{children:""})," or other specified\ncomponent. If you need to access the value of an uncontrolled ",(0,t.jsx)(o.code,{children:""}),",\nattach a ",(0,t.jsx)(o.code,{children:"ref"})," to it as you would with an uncontrolled input, then call\n",(0,t.jsx)(o.code,{children:"ReactDOM.findDOMNode(ref)"})," to get the DOM node. You can then interact with that\nnode as you would with any other uncontrolled input."]}),"\n",(0,t.jsx)(o.p,{children:"If your application contains a large number of form groups, we recommend\nbuilding a higher-level component encapsulating a complete field group\nthat renders the label, the control, and any other necessary components.\nWe don't provide this out-of-the-box, because the composition of those\nfield groups is too specific to an individual application to admit a\ngood one-size-fits-all solution."}),"\n",(0,t.jsx)(o.h2,{id:"disabled-forms",children:"Disabled forms"}),"\n",(0,t.jsxs)(o.p,{children:["Add the ",(0,t.jsx)(o.code,{children:"disabled"})," boolean attribute on an input to prevent user interactions and\nmake it appear lighter."]}),"\n",(0,t.jsx)(n,{language:"jsx",live:!0,children:l}),"\n",(0,t.jsxs)(o.p,{children:["Add the ",(0,t.jsx)(o.code,{children:"disabled"})," attribute to a ",(0,t.jsx)(o.code,{children:"