MCPcopy
hub / github.com/pure-css/pure / Forms

Function Forms

site/src/pages/forms/index.js:11–299  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9const description = 'Simple CSS for HTML forms.';
10
11function Forms() {
12 return (
13 <Layout description={description} title={title}>
14 <Header description={description} title={title} />
15
16 <div className="content">
17 <SectionHeader heading="Default Form" />
18
19 <p>
20 To create a default inline form, add the <code>pure-form</code> classname to any <code>&lt;form&gt;</code> element.
21 </p>
22
23 <Example>
24 <form className="pure-form">
25 <fieldset>
26 <legend>A compact inline form</legend>
27 <input type="email" placeholder="Email" />
28 <input type="password" placeholder="Password" />
29 <label htmlFor="default-remember">
30 <input id="default-remember" type="checkbox" /> Remember me
31 </label>
32 <button type="submit" className="pure-button pure-button-primary">Sign in</button>
33 </fieldset>
34 </form>
35 </Example>
36
37 <SectionHeader heading="Stacked Form" />
38
39 <p>
40 To create a stacked form with input elements below the labels, add the <code>pure-form-stacked</code> classname to a <code>&lt;form&gt;</code> element alongside <code>pure-form</code>.
41 </p>
42
43 <Example>
44 <form className="pure-form pure-form-stacked">
45 <fieldset>
46 <legend>A Stacked Form</legend>
47 <label htmlFor="stacked-email">Email</label>
48 <input id="stacked-email" type="email" placeholder="Email" />
49 <span className="pure-form-message">This is a required field.</span>
50 <label htmlFor="stacked-password">Password</label>
51 <input id="stacked-password" type="password" placeholder="Password" />
52 <label htmlFor="stacked-state">State</label>
53 <select id="stacked-state">
54 <option>AL</option>
55 <option>CA</option>
56 <option>IL</option>
57 </select>
58 <label htmlFor="stacked-remember" className="pure-checkbox">
59 <input id="stacked-remember" type="checkbox" /> Remember me
60 </label>
61 <button type="submit" className="pure-button pure-button-primary">Sign in</button>
62 </fieldset>
63 </form>
64 </Example>
65
66 <SectionHeader heading="Aligned Form" />
67
68 <p>

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…