Components / PaperInput

Forms

PaperInput

Editorial form input with field labels and clear error handling.

↗ forms should read like forms, not puzzle boxes.

Preview

We will only send release notes.

import * as React from 'react'
import { cva, type VariantProps } from 'class-variance-authority'
import { cn } from '@/lib/utils'

const paperInputVariants = cva(
  [

Installation

Copy this file into your project, export its barrel, and then add it to the master UI index.

  1. Step 1.Create this file:
    components/ui/paperInput/paperInput.tsx
  2. Step 2.Create the barrel:
    components/ui/paperInput/index.ts
  3. Step 3.Add this export in components/ui/index.ts:
    export * from './paperInput'

Variants

Default

Filled

Bordered

Error

Props

PropTypeDefaultDescription
variant'default' | 'filled' | 'bordered'defaultInput shell treatment.
hasErrorbooleanfalseApplies red underline error state.
placeholderstringundefinedHint text inside field.

Examples

Sign-up form

Pair with PaperField to keep labels and hints consistent.

Visible in URLs and docs.

<PaperField label="Team name"><PaperInput /></PaperField>

Validation error

Use hint channel for clear corrective instructions.

Please enter a valid email address.

<PaperInput hasError placeholder="name@domain.com" />