Menu

Components

Form controls

Real inputs in the house dress: a text field, a textarea, search, checkboxes, radios, a switch built on a checkbox, and tabs built on radios.

Usage

Text field

A reply within two days.

<label htmlFor="email" className="aka-label block">Email</label>
<input id="email" type="email" aria-describedby="email-hint" placeholder="you@example.com"
  className="mt-1.5 w-full rounded-lg border border-border bg-background px-3 py-2.5 text-13 text-foreground placeholder:text-muted-foreground/75 focus:border-foreground/30" />
<p id="email-hint" className="mt-1.5 text-11 font-light text-muted-foreground/75">A reply within two days.</p>

Label above, hint below, never the placeholder as the label: a placeholder is gone the moment someone types.

Examples

Textarea

<label htmlFor="message" className="aka-label block">Message</label>
<textarea id="message" rows={3} className="mt-1.5 w-full rounded-lg border border-border bg-background px-3 py-2.5 text-13 text-foreground focus:border-foreground/30" />

Search

<label htmlFor="search" className="aka-label block">Search</label>
<div className="relative mt-1.5">
  <Search aria-hidden className="pointer-events-none absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/75" />
  <input id="search" type="search" placeholder="Filter projects" className="w-full rounded-lg border border-border bg-background py-2.5 pl-8 pr-3 text-13 text-foreground" />
</div>

Checkbox and radio

Show
Sort
<fieldset>
  <legend className="aka-label">Show</legend>
  <label className="flex items-center gap-2.5 text-13 font-light">
    <input type="checkbox" defaultChecked className="h-4 w-4 [accent-color:var(--foreground)]" /> Open source
  </label>
</fieldset>
<fieldset>
  <legend className="aka-label">Sort</legend>
  <label className="flex items-center gap-2.5 text-13 font-light">
    <input type="radio" name="sort" defaultChecked className="h-4 w-4 [accent-color:var(--foreground)]" /> Newest
  </label>
</fieldset>

Square for many, round for one. The native controls, drawn in the ink through accent-color, so they keep the platform's keyboard and focus behaviour.

Switch

<label className="relative inline-flex cursor-pointer items-center gap-2.5 text-13 font-light">
  <input type="checkbox" role="switch" defaultChecked className="peer sr-only" />
  <span aria-hidden className="h-5 w-9 rounded-full border border-border bg-muted/40 transition-colors peer-checked:bg-foreground peer-focus-visible:outline peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-[color:var(--select)] motion-reduce:transition-none" />
  <span aria-hidden className="absolute left-[3px] top-1/2 h-3.5 w-3.5 -translate-y-1/2 rounded-full bg-muted-foreground transition-transform peer-checked:translate-x-4 peer-checked:bg-background motion-reduce:transition-none" />
  Reduce motion
</label>

A checkbox with role="switch", hidden but focusable, and two spans drawn from its state with peer variants. On means the ink fill; off means the muted ground.

Tabs

Show
<fieldset className="-ml-2.5 flex flex-wrap items-center gap-x-1 gap-y-1">
  <legend className="sr-only">Show</legend>
  <label className="cursor-pointer rounded-md px-2.5 py-1 text-12 font-light tracking-wide text-muted-foreground/75 transition-colors hover:text-foreground has-[:checked]:text-primary has-[:focus-visible]:outline has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-[color:var(--select)]">
    <input type="radio" name="tab" defaultChecked className="sr-only" /> projects
  </label>
</fieldset>

The active one carries the accent; the rest stay quiet. Built on radios, the way akaOSS builds its layout switch, so it needs no script and the arrow keys move it.

Best practices

When to use

  • These strings for any form on the site. They are strings, not classes, until a second form needs one.
  • Tabs for switching a view in place; links for going to another page.

Behaviour

  • Inputs sit on the page's ground with the border edge, 13px, and the edge strengthens on focus.
  • Nothing dims or glows; a checked control fills with the ink.

Accessibility

  • Every control has a visible label tied to it: htmlFor, a wrapping label, or a legend for a group.
  • Hints are tied with aria-describedby.
  • A hidden input keeps a visible focus ring on the thing drawn for it.