<!-- @dsCard group="Components / Forms" viewport="780x330" name="Field" subtitle="Wraps every form control so label, control, help text and error share one 8px rhythm." -->
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Field</title>
<link rel="stylesheet" href="../../styles.css"><link rel="stylesheet" href="../_card/card.css">
<script src="https://unpkg.com/react@18.3.1/umd/react.development.js" integrity="sha384-hD6/rw4ppMLGNu3tX5cjIb+uRZ7UkRJ6BPkLpg4hAu/6onKUg4lLsHAs9EBPT82L" crossorigin="anonymous"></script>
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js" integrity="sha384-u6aeetuaXnQ38mYT8rp6sbXaQe3NL9t+IBXmnYxwkUI2Hw4bsp2Wvmx4yRQF1uAm" crossorigin="anonymous"></script>
<script src="https://unpkg.com/@babel/standalone@7.29.0/babel.min.js" integrity="sha384-m08KidiNqLdpJqLq95G/LEi8Qvjl/xUYll3QILypMoQ65QorJ9Lvtp2RXYGBFj1y" crossorigin="anonymous"></script>
<script src="https://unpkg.com/lucide@0.544.0/dist/umd/lucide.min.js"></script>
<script src="../../_ds_bundle.js"></script>
<script src="../_card/card.js"></script>
</head><body>
<header class="ch"><h1>Field</h1><p>Wraps every form control so label, control, help text and error share one 8px rhythm.</p></header>
<div id="root"></div>
<ul class="notes">
<li>Show <code>FieldError</code> instead of <code>FieldDescription</code> when the control is invalid — never both.</li>
<li>Errors render on validation, never on first paint.</li>
<li>The control fills the width the Field is given; size the Field, not the input.</li>
<li><code>FieldLabel</code> and the control are bound by <code>htmlFor</code> / <code>id</code>, always.</li>
</ul>
<script type="text/babel">
const {Field, FieldLabel, FieldDescription, FieldError, Input} = window.OriginDesignSystem_7c998b;
const {Ic, mount} = window.OriginCard;
function Demo(){return (<>
  <div style={{display:"grid",gridTemplateColumns:"1fr 1fr",gap:18}}>
    <Field><FieldLabel htmlFor="a">Event URL</FieldLabel><Input id="a" defaultValue="30min" /><FieldDescription>Lowercase letters, numbers and dashes.</FieldDescription></Field>
    <Field><FieldLabel htmlFor="b">Email</FieldLabel><Input id="b" defaultValue="not-an-email" invalid /><FieldError>Enter a valid email address.</FieldError></Field>
  </div>
</>)}
mount(<Demo />);
</script>
</body></html>