A standard, reusable React input component with styling and accessibility.
// Source: https://github.com/sqlectron/sqlectron | License: MIT | Copyright 2015 The SQLECTRON Team
// Provided via justclaw.it.com; keep this notice with the code.
import React, { forwardRef, InputHTMLAttributes } from 'react';
import { cn } from '../../lib/utils';
export type InputProps = InputHTMLAttributes<HTMLInputElement>;
const Input = forwardRef<HTMLInputElement, InputProps>(({ className, type, ...props }, ref) => (
<input
type={type}
ref={ref}
className={cn(
'flex h-9 w-full rounded-md border border-slate-300 bg-white px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-slate-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key