fin1te/dsv1.0.0
  1. ds
  2. Components
  3. Input

Input

Text fields, textareas, selects and the field wrapper.

Text field

Code
<label class="fld" style="max-width:20rem">
  <span>Title</span>
  <input class="inp" value="Order pipeline" />
</label>
<label class="fld" style="max-width:20rem">
  <span>Kicker</span>
  <input class="inp" placeholder="Short tagline" />
  <span class="hint">Shown above the title in present mode.</span>
</label>

Sizes and styles

Code
<input class="inp lg" placeholder="Search posts" style="max-width:24rem" />
<input class="inp" placeholder="Default" style="max-width:24rem" />
<input class="inp mono" value="sk-ant-••••••••" style="max-width:24rem" />

.lg is for forms on fin1te.com. The default is topo's panel size. .mono is for keys, ids and code.

Textarea and select

Code
<div class="two" style="max-width:28rem">
  <label class="fld"><span>Kind</span>
    <select class="inp"><option>Compute</option><option>Storage</option><option>External</option></select>
  </label>
  <label class="fld"><span>Stack</span><input class="inp" type="number" value="3" min="1" max="6" /></label>
</div>
<label class="fld" style="max-width:28rem"><span>Role</span>
  <textarea class="inp" rows="3">Accepts orders and writes an event before it answers.</textarea>
</label>

States

Code
<label class="fld" style="max-width:20rem"><span>Endpoint</span>
  <input class="inp" aria-invalid="true" value="htp://localhost" aria-describedby="e1" />
  <span class="err" id="e1">Use http:// or https://</span>
</label>
<input class="inp" disabled value="Disabled" style="max-width:20rem" />

API

ClassOnWhat it does
.inpinput, textarea, selectThe control. 2rem high, --bg fill, accent border and ring on focus.
.lg.inp2.375rem, 15px text.
.mono.inpPlex Mono at 12px.
aria-invalid="true".inpRed border. Pair with an .err message.
.fldlabel, divStacks a label, control and hint.
.hint / .errspanHelp text and error text under a control.
.twodivTwo equal columns of fields.

Accessibility

  • Wrap the control in <label class="fld"> or connect a label with for. Placeholders are not labels.
  • Point aria-describedby at hints and errors.