Documentation menu
Getting Started
Components
Primitives
- Agent Thinking
- Alert
- Alert Dialog
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Command
- Command Palette
- Context Menu
- Data Table
- Dialog
- Dropdown Menu
- Empty
- Field
- Glow Cloud
- Input
- Label
- Medication Schedule
- Period Tabs
- Popover
- Rainbow Button
- Scroll Area
- Select
- Selectable Card
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timeline
- Tooltip
- Use Count Up
Charts and metrics
Patterns
- Confirm Button
- Date Picker
- Embedded
- Empty State
- Entity Drawer
- Error Boundary
- Field Row
- File Dropzone
- Form Dialog
- Kv
- List Editor
- List Page
- Live Time
- Mini Table
- Money
- Note Field
- Note Text
- Page Card
- Page Header
- Page Tabs
- Page Toolbar
- Person Cell
- Picture Field
- Print Card
- Range Switcher
- Row Actions
- Search Input
- Search Select
- Selected Box
- Signature Pad
- Status Badge
- Sub Nav Layout
- Suggest Input
- Tab Icons
- Table Footer
- Theme Accent Picker
- Time Picker
- View All Link
Dashboard cards
Advanced
Device frames
Website widgets
Website screens
Website panels
Patterns
Search Input
A search box with an icon and clear button.
import { useState } from "react"
import { SearchInput } from "@/registry/vcare/ui/search-input"
export default function SearchInputDemo() {
const [q, setQ] = useState("")
return <SearchInput value={q} onChange={setQ} placeholder="Name, MRN or mobile" className="w-72" />
}Installation
npx shadcn@latest add @vcare/search-inputOr install directly from the URL: https://ui.vcarehms.com/r/search-input.json
- Install the dependencies:
npm i lucide-react - Add the registry items it uses: input, utils.
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/ui/search-input.tsx
import { Search } from 'lucide-react';
import { Input } from '@/registry/vcare/ui/input';
import { cn } from '@/registry/vcare/lib/utils';
export function SearchInput({
value,
onChange,
placeholder,
className,
}: {
value: string;
onChange: (v: string) => void;
placeholder?: string;
className?: string;
}) {
return (
<div className="relative min-w-0 max-w-full" data-tour="page-search">
<Search className="pointer-events-none absolute start-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" />
<Input
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder}
className={cn('w-64 max-w-full rounded-full border-0 bg-secondary ps-8 shadow-raised', className)}
/>
</div>
);
}Usage
import { SearchInput } from "@/components/ui/search-input"Exports
SearchInput
Dependencies
lucide-react@^1.80.0(npm)@vcare/input(registry)@vcare/utils(registry)
Raw item: /r/search-input.json