Skip to content
synccn

Input

Text field with optional leading icon and invalid state.

Enter an address like name@company.com.

Installation

$ pnpm dlx shadcn@latest add @synccn/input

First time in this project? Connect synccn with one command.

Usage

import { Input, Label } from "@/components/ui/input";<Input icon={Search} placeholder="Search…" />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Input

  • icon
    React.ElementType

    Icon shown inside the field on the left.

  • invalid
    boolean

    Marks the field invalid for styling and assistive tech.

  • className
    string

    Extra classes for the root element.

Also accepts every standard <input> attribute, and forwards its ref.

Label

  • className
    string

    Extra classes for the root element.

Also accepts every standard <label> attribute, and forwards its ref.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-invalid
  • Shows a visible focus ring for keyboard users
  • Labels are tied to their controls