Meridianby Commenda
Components

Input

A single-line field with its label, help and error.

A single-line field with its label, description and error built in. One size, 40 high with a 16 value and a 14 label, the same height as an xl Button. Every HubSpot form on the site is built from it; search, number and email are ways of setting it up, not separate parts.

The legal name on your registration.

Usage

Example.tsx
import { Input } from "@commenda/meridian/ui/input";

<Input label="Company name" placeholder="e.g. Northwind Ltd" />;

Field

Label above, value inside, one line of description below when it helps.

The legal name on your registration.

Label options

Required adds a red asterisk, optional says so in words, help opens a tooltip. Use one, not all three.

(optional)
$

Prefix and suffix

Units and fixed parts sit in tinted segments, never in the value.

$
https://
%

Icon and action

A left icon for search. Actions sit in a segment at the end, like copy. Copy stays live when the field is disabled.

States

Hover from the pointer. Focus is a blue border with a soft glow. Invalid shows the error in place of the description, after the person leaves the field.

default
filled
disabled
read-only
invalid
Enter your company’s legal name.

Anatomy

Label row, field, then description or error. The field holds the optional prefix, left icon, value, suffix and action, in that order.

PartValue
Field40 (control/xl), radius 8, 1px soft-pearl 400
LabelLabel/14 Strong, soft-pearl 900
ValueLabel/16, soft-pearl 1000; placeholder soft-pearl 700
Description, errorLabel/14
Focusblue 700 border with a blue 200 glow

API reference

PropTypeDescription
labelConditionalstringFrom Pathfinder.
hideLabelbooleanFrom Pathfinder.
aria-labelConditionalstringFrom Pathfinder.
requiredConditionaltrue | falseFrom Pathfinder.
labelConfigObjectView fields · 2 shapesFrom Pathfinder.
sourceConfigFieldSourceConfigView fieldsFrom Pathfinder.
descriptionstringFrom Pathfinder.
errorConfigObjectView fieldsFrom Pathfinder.
disableConfigDisableConfigView fieldsFrom Pathfinder.
valueConditionalstringFrom Pathfinder.
onValueChangeConditional(value: string) => voidFrom Pathfinder.
defaultValuestringFrom Pathfinder.
prefixstringFrom Pathfinder.
leadingIconReactElement<unknown, string | JSXElementConstructor<any>>From Pathfinder.
suffixstringFrom Pathfinder.
typeConditional"password" | "number" | "search" | "text" | "email" | "url" | "tel"From Pathfinder.
actionConfigObjectView fields · 3 shapesFrom Pathfinder.
labelConfigObject fields

Choose one of these 2 shapes. Don't combine fields the chosen shape excludes.

Option 1

FieldTypeDescription
optionalLabelRequiredstring

Do not supply: help.

Option 2

FieldTypeDescription
helpRequiredstring

Do not supply: optionalLabel.

sourceConfigObject fields
FieldTypeDescription
kindRequired"entity" | "record" | "document"
labelRequiredstring
previewRequiredReactNode
onOpenRequired() => void
side"top" | "bottom"
errorConfigObject fields
FieldTypeDescription
messageRequiredstring
reveal"after-blur" | "immediate"
disableConfigObject fields
FieldTypeDescription
isDisabledRequiredboolean
reasonstring
actionConfigObject fields

Choose one of these 3 shapes. Don't combine fields the chosen shape excludes.

Option 1

FieldTypeDescription
kindRequired"copy"
labelstring
onCopy() => void
onCopyError(error: Error) => void

Option 2

FieldTypeDescription
kindRequired"clear"
labelstring

Option 3

FieldTypeDescription
kindRequired"reveal"
labelstring
hideLabelstring

Best practices

  • Labels are nouns in sentence case: Work email, Company name. Always show the label; the placeholder is never the only label.
  • Placeholders are examples that start with "e.g.", or nothing. Never the label again, never an instruction.
  • Descriptions say why we ask, in one line. On a demo form, ask only what sales needs.
  • Errors say what happened and how to fix it ("Enter a work email, like name@company.com"), and appear only after the person leaves the field.
  • Units go in a prefix or suffix, never in the value. Copy and clear are actions, never suffixes.
  • A field next to a button is 40, the same as an xl Button. Focus is always visible: the blue border and glow.
  • Source: Pathfinder Input. Meridian makes the field 40 tall with a 16 value, a 14 label and 14 help and error text.

On this page