Input

A flexible and Polished text input component with support for icons, state handling, and multiple visual variants.

This component requires the FyskProvider. See Quick Start →

Preview

Input
TypeScript

Installation

bash
bash
1
npx shadcn@latest add https://fysk.dev/r/input.json

Usage

tsx
tsx
1
import { Input } from "@/components/ui"
2
3
<Input type="email" placeholder="Email" />

Examples

With Icons

Add visual context with icons at the start or end of the input field.

Component
TypeScript

Interactive Icons

You can add a callback to icons using the onIconClick prop. This is perfect for password toggles, search clears, or custom actions.

Component
TypeScript

Password Toggle

Clearable Search

Variants

Explore multiple visual styles suited for different backgrounds and levels of prominence.

Component
TypeScript

Features

  • Icon Support: Integrated slots for start or end positioned icons with automatic padding adjustment.

  • Visual Variants: Supports secondary, outline (bordered), ghost, and glass (frosted glass) styles.

  • Interactive Icons: Add click actions to icons using the onIconClick prop, transforming the icon into an accessible button.

  • State Feedback: Built-in visual states for loading, success, and error using icons and colors.

  • Micro-Animations: Smooth focus transitions and background shifts.

Props

PropTypeDefaultDescription
variantstring"default"Visual style: default, secondary, outline, ghost, glass.
size"xs" | "sm" | "md" | "lg" | "xl""md"The visual size of the input.
state"idle" | "loading" | "success" | "error""idle"Overlays an icon based on state.
iconReact.Node-Primary icon to display.
iconPosition"start" | "end""start"Where to place the icon.
iconLoadingReact.Node-Custom loader icon override.
iconSuccessReact.Node-Custom success icon override.
iconErrorReact.Node-Custom error icon override.
onIconClick(e: MouseEvent) => void-Callback to make the icon interactive.

Accepts all standard HTML input attributes.

Changelog

2026-01-12

  • Interactive Icons: Added `onIconClick` prop to support clickable icons (e.g., password toggle).

  • Glass Variant: Introduced `glass` variant with backdrop blur effect.

  • Pixel Perfection: Upgraded to `shadow-xs` and refined focus states for a cleaner look.

  • Accessibility: Clickable icons are now automatically rendered using a `button` tag with proper focus states.

Built with 💖 | Created by Yashraj