Example#
https://
Usage#
Use an input for one line of text: a name, an email address, a website, a number. Put it in a Field, which prints the label, the hint and the error, and wires them to the input.
- Types.
text,email,tel,url,search,passwordandnumber; numbers get the numeric keypad and tabular figures, with no spinners. - Start and end.
startandendhold short fixed text or a glyph inside the box, such as "https://" or "CAD". - Sizes.
sm40,md48 (default) andlg56 px. - For more than one line, use
Textarea. For a fixed list, useSelect; for a long list to search,Combobox.
Anatomy#
https://
- BoxThe control face with a 2 px rule; hover and focus take the ink.
.mk-input - Start textFixed text or a glyph; never the label.
.mk-input-start - TextThe native input, 16 px so phones do not zoom.
.mk-input-control
Volume#
Reading layer: the box, the rule and the type are identical at every volume, so a form never gets louder than its labels.
Quiet
https://Studio
https://Press
https://Rave
https://
Content#
- The label above the box says what goes in it, in two or three words: "Email", "Your current website".
- Placeholders show the format, never the label: "fernlight.example", not "Enter your website".
- Errors say what to do: "Enter an email address like jordan@example.com", not "Invalid input".
Do and don't#
Do
Don't
Accessibility#
- Use it inside Field, which wires the label, the description, the error line and
aria-invalid. - Text is 16 px, so phones never zoom; the placeholder is never the label.
- Invalid fields take a 3 px rule and a 6 px hatch strip, with the message in words below: no red.
| Keys | What happens |
|---|---|
| Tab | Moves focus into the field |
| Typing | Edits the value; a fixed error clears at once inside Form |
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-ink | --mk-paper | body | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink | --mk-paper | body-ui | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink | --mk-paper | long | 16.49:1 · Lc 97.4, passes | 16.21:1 · Lc 96.1, passes |
--mk-ink | --mk-paper-sunken | body | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink | --mk-paper-sunken | body-ui | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink | --mk-paper-sunken | long | 15.20:1 · Lc 92.2, passes | 15.53:1 · Lc 95.7, passes |
--mk-ink | --mk-paper-plate | body | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink | --mk-paper-plate | body-ui | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink | --mk-paper-plate | long | 18.42:1 · Lc 105.1, passes | 15.02:1 · Lc 95.4, passes |
--mk-ink-rule | --mk-paper | ui | 3.27:1 · Lc 56.5, passes | 3.65:1 · Lc 25.6, passes |
--mk-ink-rule | --mk-paper-sunken | ui | 3.01:1 · Lc 51.2, passes | 3.49:1 · Lc 25.2, passes |
--mk-ink-rule | --mk-paper-plate | ui | 3.65:1 · Lc 64.1, passes | 3.38:1 · Lc 24.8, passes |
--mk-ink-disabled | --mk-paper | ui | 3.27:1 · Lc 56.5, passes | 6.53:1 · Lc 46.1, passes |
--mk-ink-disabled | --mk-paper-sunken | ui | 3.01:1 · Lc 51.2, passes | 6.25:1 · Lc 45.7, passes |
--mk-ink-disabled | --mk-paper-plate | ui | 3.65:1 · Lc 64.1, passes | 6.05:1 · Lc 45.4, passes |
--mk-on-control-2 | --mk-control | body-ui | 6.59:1 · Lc 82.6, passes | 12.47:1 · Lc 82.8, passes |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
type | InputType | none | |
size | Size | none | 40 / 48 (default) / 56 px. |
start | ReactNode | none | A glyph or text before the value, e.g. "https://". |
end | ReactNode | none | A glyph or text after the value. |
className | string | none | Lands on the box. |
style | CSSProperties | none | Lands on the box. |
Tokens#
System tokens (26)
--mk-border--mk-border-thick--mk-control--mk-control-h-lg--mk-control-h-md--mk-control-h-sm--mk-control-rule--mk-disabled--mk-dur-hover--mk-ease-out--mk-focus--mk-font-text--mk-on-control--mk-on-control-2--mk-radius-control--mk-rule--mk-surface-sunken--mk-text--mk-text-disabled--mk-type-body-ui-leading--mk-type-body-ui-size--mk-type-body-ui-tracking--mk-type-body-ui-weight--mk-type-meta-leading--mk-type-meta-size--mk-type-meta-weight
Its own properties (5)
--mk-input-end-w--mk-input-h--mk-input-hatch--mk-input-pad--mk-input-start-w
Changelog#
Arrived in 0.1.0.
- The reading layer's controls, overlays, forms and visitor prefs (P2-T1 to P2-T5): every Button is the comic hit key, with IconButton, Link and Tooltip; Input, Textarea, Select, Checkbox and CheckboxGroup, Radio and RadioGroup, Switch, Slider with the ruler, RulerReadout and SegmentedControl; Dialog, Drawer, NavSheet, Tabs, Disclosure, Faq and faqJsonLd on Base UI 1.9 where the platform falls short; Field, Fieldset, Form with the site's inline validation, ErrorSummary, Callout, Honeypot, FormTimestamp and QuoteForm; PrefsScript under 1 KB, usePref and setPref with cross-tab sync, ThemeToggle and the visitor VolumeDial; VisuallyHidden.