# Alert import { Alert } from '@geckoui/geckoui'; import { DismissibleAlertExample } from '@/components/examples/dismissible-alert-example'; import { AlertCustomVariantExample } from '@/components/examples/module-augmentation-examples'; # Alert An alert component for displaying important messages with different severity levels. Supports multiple variants (error, success, warning, info, default), optional descriptions, custom icons, and dismissal functionality. ## Installation ```tsx import { Alert } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx ``` ## Props API | Prop | Type | Default | Description | | --------------- | ---------------------------------------------------------- | ----------- | --------------------------- | | `title` | `ReactNode \| FC` | - | Main message (required) | | `variant` | `'error' \| 'success' \| 'warning' \| 'info' \| 'default'` | `'default'` | Alert severity level | | `description` | `ReactNode \| FC` | - | Additional detailed text | | `condensed` | `boolean` | `false` | Reduced vertical padding | | `onRemove` | `() => void` | - | Callback for dismiss button | | `icon` | `ReactNode \| FC` | - | Custom icon element | | `iconClassName` | `string` | - | CSS class for default icon | | `className` | `string` | - | CSS class for container | ## Examples ### Variants
```tsx ``` ### With Description
```tsx ``` ### Dismissible Alert ```tsx function DismissibleAlert() { const [show, setShow] = useState(true); if (!show) { return ( ); } return ( setShow(false)} /> ); } ``` ### Condensed Style
```tsx ``` ### With Custom Icon 🎉} /> ```tsx import { RocketIcon } from 'lucide-react'; } /> ``` ### Form Validation Errors
  • Email is required
  • Password must be at least 8 characters
  • Terms of service must be accepted
```tsx ``` ### Status Messages
```tsx ``` ## Behavior ### Dismiss Button When `onRemove` callback is provided, a close button appears in the top-right corner. Clicking it triggers the callback: ```tsx { console.log('Alert dismissed'); // Hide alert or perform cleanup }} /> ``` ### Condensed Mode The `condensed` prop reduces vertical padding for a more compact appearance, ideal for inline notifications: ```tsx ``` ## Module Augmentation The Alert component supports TypeScript module augmentation, allowing you to add custom variants with full type safety. ### Live Example This documentation site demonstrates module augmentation with a custom `critical` variant: ### Step 1: TypeScript Declaration Create a declaration file (e.g., `gecko.d.ts`) in your project: ```typescript import "@geckoui/geckoui"; declare module "@geckoui/geckoui" { interface AlertVariantMap { critical: unknown; } } ``` ### Step 2: Add CSS Styles Add the corresponding styles to your global CSS/SCSS file. You need to define both the container variant and the icon styling: ```scss .GeckoUIAlert { &--critical { @apply text-purple-600; } &__icon { &--critical { @apply bg-purple-600; mask-image: url('data:image/svg+xml,'); -webkit-mask-image: url('data:image/svg+xml,'); } } } ``` ### Step 3: Use Your Custom Variant ```tsx ``` ## Accessibility * Uses semantic HTML with proper ARIA roles * Dismiss button is keyboard accessible * Color-coded icons indicate severity * Works with screen readers * Icon provides visual reinforcement of message type ## Styling The component uses BEM-style class names: * `GeckoUIAlert` - Main container * `GeckoUIAlert--{variant}` - Variant modifier (error, success, warning, info, default) * `GeckoUIAlert--condensed` - Applied when condensed * `GeckoUIAlert__body` - Content wrapper * `GeckoUIAlert__icon` - Icon element * `GeckoUIAlert__icon--{variant}` - Variant-specific icon styling * `GeckoUIAlert__title` - Title text * `GeckoUIAlert__description` - Description text * `GeckoUIAlert__remove-button` - Dismiss button * `GeckoUIAlert__remove-button__icon` - Dismiss button icon ## Related Components * [InputError](/docs/input-error) - Form field error messages * [ConfirmDialog](/docs/confirm-dialog) - Confirmation prompts * [Tooltip](/docs/tooltip) - Contextual hints # Button import { Button } from '@geckoui/geckoui'; import { ButtonCustomColorsExample } from '@/components/examples/module-augmentation-examples'; # Button A flexible button component that extends the native HTML button with customizable styles. Supports different variants (filled, outlined, ghost, icon), sizes, and colors. All styling is applied via TailwindCSS classes, which can be overridden using the `className` prop. ## Installation ```tsx import { Button } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx ``` ## Props API | Prop | Type | Default | Description | | ----------- | --------------------------------------------- | ----------- | ----------------------------------- | | `variant` | `'filled' \| 'outlined' \| 'ghost' \| 'icon'` | `'filled'` | Button visual style | | `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Button size | | `color` | `'primary'` | `'primary'` | Button color scheme | | `disabled` | `boolean` | `false` | Disable the button | | `className` | `string` | - | CSS class for custom styling | | `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | HTML button type | | ...rest | `ButtonHTMLAttributes` | - | All standard HTML button attributes | ## Examples ### Variants
```tsx ``` ### Sizes
```tsx ``` ### Outlined Buttons
```tsx ``` ### Ghost Buttons
```tsx ``` ### Icon Buttons
```tsx ``` ### With Icons and Text
```tsx ``` ### Disabled State
```tsx ``` ### Form Actions
```tsx function MyForm() { const handleSubmit = (e) => { e.preventDefault(); // Handle form submission }; return (
); } ``` ## Custom Styling The component uses TailwindCSS classes that can be overridden. By default, the button adds spacing between child elements:
```tsx ``` ## Module Augmentation The Button component supports TypeScript module augmentation, allowing you to add custom variants, colors, and sizes with full type safety. ### Live Example This documentation site demonstrates module augmentation with custom `secondary` and `danger` colors: ### Step 1: TypeScript Declaration Create a declaration file (e.g., `gecko.d.ts`) in your project: ```typescript import "@geckoui/geckoui"; declare module "@geckoui/geckoui" { interface ButtonColorMap { secondary: unknown; danger: unknown; } } ``` ### Step 2: Add CSS Styles Add the corresponding styles to your global CSS/SCSS file. The class naming follows the pattern `GeckoUIButton--{variant}-{color}`: ```scss .GeckoUIButton { &--filled { &-secondary { @apply bg-gray-600 text-white border-gray-600 enabled:hover:bg-gray-700 enabled:hover:border-gray-700 disabled:bg-gray-600/50 disabled:border-border-disabled; } &-danger { @apply bg-red-600 text-white border-red-600 enabled:hover:bg-red-700 enabled:hover:border-red-700 disabled:bg-red-600/50 disabled:border-border-disabled; } } &--outlined { &-secondary { @apply border-gray-400 text-gray-600 enabled:hover:bg-gray-50 disabled:bg-surface-hover disabled:text-text-disabled; } &-danger { @apply border-red-400 text-red-600 enabled:hover:bg-red-50 disabled:bg-surface-hover disabled:text-text-disabled; } } &--ghost { &-secondary { @apply text-gray-600 enabled:hover:bg-gray-50 disabled:text-text-disabled; } &-danger { @apply text-red-600 enabled:hover:bg-red-50 disabled:text-text-disabled; } } &--icon { &-secondary { @apply text-gray-500 disabled:text-text-disabled; } &-danger { @apply text-red-500 disabled:text-text-disabled; } } } ``` ### Step 3: Use Your Custom Colors ```tsx ``` You can also extend `ButtonVariantMap` for custom variants or `ButtonSizeMap` for custom sizes following the same pattern. ## Accessibility * Uses semantic ` ); } ``` #### CalendarRef API ```tsx interface CalendarRef { moveTo: (month: number, year: number) => void; } ``` **Parameters**: * `month`: 1-12 (January = 1, December = 12) * `year`: Full year (e.g., 2024, 2025) **Behavior**: * Switches view to Day mode * Displays the specified month/year * Does NOT select a date (only navigates) ## Range Mode Use `mode="range"` to enable date range selection with a dual-month calendar display. ```tsx 'use client'; import { useState } from 'react'; import { Calendar } from '@geckoui/geckoui'; import type { DateRange } from '@geckoui/geckoui'; function Example() { const [selectedRange, setSelectedRange] = useState(); return ( setSelectedRange(range ?? undefined)} /> ); } ``` ### Single Month Display Use `numberOfMonths={1}` for a compact single-month range picker: ```tsx setSelectedRange(range ?? undefined)} numberOfMonths={1} /> ``` ### Disable Dates Use `disableDate` to prevent selection of specific dates. The callback receives a date string in `YYYY-MM-DD` format and returns `true` to disable the date. ```tsx 'use client'; import { useState } from 'react'; import { Calendar } from '@geckoui/geckoui'; function Example() { const [selectedDate, setSelectedDate] = useState(); const disableDate = (date: string) => { const dayOfWeek = new Date(date).getDay(); return dayOfWeek === 0 || dayOfWeek === 6; // Disable weekends }; return ( ); } ``` **Common Use Cases**: * Disable weekends * Disable past dates * Disable holidays or specific dates * Disable dates outside a valid range ### Custom Day Rendering Use `renderDayCell` to customize how each day cell is displayed. This allows adding custom styling, indicators, or content to specific dates. ```tsx 'use client'; import { useState } from 'react'; import { Calendar } from '@geckoui/geckoui'; import type { DayCellRenderProps } from '@geckoui/geckoui'; function Example() { const [selectedDate, setSelectedDate] = useState(); const hasEvent = (date: string) => { const today = new Date(); return today.getDate() === new Date(date).getDate(); }; return (
( <> {day} {hasEvent(date) && ( )} )} /> {selectedDate &&

Selected: {selectedDate}

}
); } ``` **Common Use Cases**: * Add event indicators or dots * Show custom styling for holidays * Display additional information on hover * Highlight specific date ranges ## Styling The component uses BEM-style class names: **Main Container:** * `GeckoUICalendar` - Main container * `GeckoUICalendar--calendars-2` - Dual calendar mode modifier * `GeckoUICalendar__dual` - Dual calendar wrapper * `GeckoUICalendar__dual--first` / `GeckoUICalendar__dual--second` - First/second calendar **Header:** * `GeckoUICalendar__header` - Header container * `GeckoUICalendar__header__title` - Month/year title * `GeckoUICalendar__header__title--clickable` - Clickable title state * `GeckoUICalendar__header__arrow-button` - Navigation arrow buttons * `GeckoUICalendar__header__arrow-left-icon` / `GeckoUICalendar__header__arrow-right-icon` - Arrow icons **Year Picker:** * `GeckoUICalendar__year-picker` - Year picker grid * `GeckoUICalendar__year-picker__button` - Year button * `GeckoUICalendar__year-picker__button--selected` - Selected year * `GeckoUICalendar__year-picker__button--prev-next` - Previous/next year buttons **Month Picker:** * `GeckoUICalendar__month-picker` - Month picker grid * `GeckoUICalendar__month-picker__button` - Month button * `GeckoUICalendar__month-picker__button--selected` - Selected month **Day Picker:** * `GeckoUICalendar__day-picker-weekdays` - Weekday header row * `GeckoUICalendar__day-picker` - Day picker grid * `GeckoUICalendar__day-picker__button` - Day button * `GeckoUICalendar__day-picker__button--today` - Today's date * `GeckoUICalendar__day-picker__button--selected` - Selected date * `GeckoUICalendar__day-picker__button--disabled` - Disabled date * `GeckoUICalendar__day-picker__button--active-month-false` - Dates outside current month * `GeckoUICalendar__day-picker__button--in-range` - Date within selected range * `GeckoUICalendar__day-picker__button--range-start` - Range start date * `GeckoUICalendar__day-picker__button--range-end` - Range end date * `GeckoUICalendar__day-picker__button--hover-preview` - Hover preview for range selection * `GeckoUICalendar__day-picker__button--hover-preview-start` / `GeckoUICalendar__day-picker__button--hover-preview-end` - Hover preview boundaries ## Accessibility * Semantic HTML with proper table structure for day grid * Keyboard navigation with arrow keys * Tab to focus navigation buttons * Enter/Space to select dates * Screen reader announcements for date selection * ARIA labels for navigation controls ## Best Practices 1. **Always use ISO format**: Use YYYY-MM-DD for all date values 2. **Validate dates**: Check date ranges and constraints in onSelectDate 3. **Clear selection**: Provide a way to clear the selected date 4. **Form integration**: Disable submit until date is selected 5. **Error handling**: Show validation errors near the calendar 6. **Responsive design**: Calendar adapts to container width ## Related Components * [DateInput](/docs/date-input) - Input field with calendar popup * [DateRangeInput](/docs/date-range-input) - Input for selecting date ranges * [RHFDateInput](/docs/rhf-date-input) - React Hook Form integrated date input # Checkbox import { Checkbox } from '@geckoui/geckoui'; import { CheckboxBasicExample, CheckboxIndeterminateExample, CheckboxDisabledExample, CheckboxMultipleExample } from '@/components/examples/checkbox-examples'; # Checkbox A checkbox component with custom styling and support for indeterminate (partial) state, useful for "select all" scenarios where only some items are selected. ## Installation ```tsx import { Checkbox } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx import { useState } from 'react'; function Example() { const [checked, setChecked] = useState(false); return ( setChecked(e.target.checked)} /> ); } ``` ## Props API | Prop | Type | Default | Description | | ----------- | --------------------- | ------- | -------------------------------------------------- | | `checked` | `boolean` | - | Controlled checked state | | `partial` | `boolean` | `false` | Display indeterminate icon (for partial selection) | | `disabled` | `boolean` | `false` | Disable the checkbox | | `className` | `string` | - | CSS class for the checkbox box | | `onChange` | `ChangeEventHandler` | - | Callback when checked state changes | | ...rest | `InputHTMLAttributes` | - | All standard HTML input attributes | ## Examples ### With Label ```tsx import { useState } from 'react'; function CheckboxWithLabel() { const [agreed, setAgreed] = useState(false); return ( ); } ``` ### Indeterminate State ```tsx import { useState } from 'react'; function SelectAll() { const [items, setItems] = useState([ { id: 1, checked: false }, { id: 2, checked: false }, { id: 3, checked: false }, ]); const allChecked = items.every(item => item.checked); const someChecked = items.some(item => item.checked); const handleSelectAll = (e: React.ChangeEvent) => { setItems(items.map(item => ({ ...item, checked: e.target.checked }))); }; return (
{/* Individual items... */}
); } ``` ### Disabled States ```tsx
``` ### Multiple Checkboxes ```tsx function NotificationSettings() { const [settings, setSettings] = useState({ email: true, sms: false, push: true, }); return (
{/* Other checkboxes... */}
); } ``` ## Keyboard Navigation The checkbox supports full keyboard navigation: * **Space** or **Enter**: Toggle checkbox * **Tab**: Move focus to next element * **Shift + Tab**: Move focus to previous element ## Accessibility * Uses proper ARIA attributes (`aria-checked`, `role="checkbox"`) * Keyboard accessible with Space and Enter keys * Focus management for keyboard users * Works with screen readers * Disabled state properly communicated ## Styling The component uses BEM-style class names: * `GeckoUICheckbox` - Main container * `GeckoUICheckbox__button` - Button wrapper * `GeckoUICheckbox__box` - Visual checkbox box * `GeckoUICheckbox__input` - Hidden native input * `GeckoUICheckbox__icon` - Check or indeterminate icon ## Icons * **CheckIcon**: Displayed when `checked={true}` and `partial={false}` * **IndeterminateIcon**: Displayed when `partial={true}` ## Related Components * [Radio](/docs/radio) - For mutually exclusive selections * [Switch](/docs/switch) - Toggle alternative * [RHFCheckbox](/docs/rhf-checkbox) - React Hook Form integration # ConfirmDialog import { ConfirmDialog } from '@geckoui/geckoui'; import { BasicConfirmDialogExample, DeleteConfirmDialogExample, RichContentConfirmDialogExample, CustomStylingConfirmDialogExample } from '@/components/examples/confirm-dialog-examples'; # ConfirmDialog ConfirmDialog is a flexible confirmation modal component that prompts users for action validation. Built on top of the Dialog component, it provides a standardized interface for displaying confirmation prompts with customizable content, buttons, and behavior. ## Installation ```tsx import { ConfirmDialog } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx ConfirmDialog.show({ title: "Confirm Action", content: "Are you sure you want to proceed?", onConfirm: () => { console.log('Confirmed'); } }); ``` ## API Reference ### ConfirmDialog.show(options) | Option | Type | Default | Description | | ----------------------- | --------------------------------- | ---------- | ---------------------- | | `title` | `string` | - | Dialog title | | `content` | `ReactNode \| FC<{dismiss}>` | - | Dialog content | | `confirmButtonLabel` | `string` | `'Ok'` | Confirm button text | | `cancelButtonLabel` | `string` | `'Cancel'` | Cancel button text | | `onConfirm` | `(args) => void \| Promise` | - | Confirm callback | | `onCancel` | `(args) => void \| Promise` | - | Cancel callback | | `className` | `string` | - | CSS class for dialog | | `titleClassName` | `string` | - | CSS class for title | | `contentClassName` | `string` | - | CSS class for content | | `dismissOnEsc` | `boolean` | `false` | Close on Escape key | | `dismissOnOutsideClick` | `boolean` | `false` | Close on outside click | ### Callback Arguments Both `onConfirm` and `onCancel` receive an object with: | Argument | Type | Description | | ---------------- | ------------ | --------------------- | | `preventDefault` | `() => void` | Prevent auto-close | | `dismiss` | `() => void` | Manually close dialog | ### ConfirmDialog.dismiss() Programmatically closes the confirm dialog from anywhere in your app. ## Examples ### Delete Confirmation(Async) ```tsx function DeleteButton({ itemId }) { const handleDelete = () => { ConfirmDialog.show({ title: "Delete Item", content: "Are you sure you want to delete this item? This action cannot be undone.", confirmButtonLabel: "Delete", cancelButtonLabel: "Cancel", onConfirm: async () => { await deleteItem(itemId); showSuccessMessage("Item deleted successfully"); }, onCancel: () => { console.log('Deletion cancelled'); } }); }; return ; } ``` > If you pass an async function to `onConfirm` or `onCancel`, the dialog will show a loading state on the button until the Promise resolves. ### Rich Content ```tsx ConfirmDialog.show({ title: "Transfer Ownership", content: ({ dismiss }) => (

Transfer project ownership to:

), confirmButtonLabel: "Transfer Now", cancelButtonLabel: "Go Back", titleClassName: "text-warning", contentClassName: "min-h-[200px]", onConfirm: ({ dismiss }) => { performTransfer(); dismiss(); } }); ``` ### Custom Styling ```tsx ConfirmDialog.show({ title: "Premium Feature", content: "This feature requires a premium subscription. Would you like to upgrade?", confirmButtonLabel: "Upgrade Now", cancelButtonLabel: "Maybe Later", className: "max-w-lg", titleClassName: "text-2xl font-bold text-purple-600", contentClassName: "text-gray-600 text-center py-6", onConfirm: () => { router.push("/upgrade"); } }); ``` ## Behavior ### Auto-Close By default, the dialog automatically closes after: * Clicking confirm button (after `onConfirm` completes) * Clicking cancel button (after `onCancel` completes) ### Manual Control Use `preventDefault()` to prevent auto-close and handle dismissal manually: ```tsx onConfirm: async ({ preventDefault, dismiss }) => { preventDefault(); // Don't auto-close const result = await performOperation(); if (result.success) { dismiss(); // Manually close } // Keep open if failed } ``` ### Loading States When `onConfirm` or `onCancel` returns a Promise (async function), the dialog automatically: * Awaits the Promise * Shows loading spinner on the button * Closes after completion ```tsx onConfirm: async () => { await longRunningOperation(); } ``` To skip the loading indicator while still calling an async function: ```tsx onConfirm: () => { myAsyncFunction(); } ``` ### Keyboard Support * **Enter**: Triggers confirm action (when no focusable elements have focus) * **Escape**: Disabled by default (set `dismissOnEsc: true` to enable) ## Accessibility * Built on Dialog component with full accessibility * Proper ARIA attributes * Keyboard navigation * Focus management * Loading states communicated to screen readers ## Styling The component uses BEM-style class names: * `GeckoUIConfirmDialog__dialog` - Dialog container * `GeckoUIConfirmDialog__title` - Title element * `GeckoUIConfirmDialog__content` - Content wrapper * `GeckoUIConfirmDialog__actions` - Button container * `GeckoUIConfirmDialog__confirm-button` - Confirm button * `GeckoUIConfirmDialog__cancel-button` - Cancel button ## Dependencies This component uses: * `Dialog` component for modal functionality * `LoadingButton` for action buttons with loading states ## Related Components * [Dialog](/docs/dialog) - Base modal component * [Alert](/docs/alert) - Non-blocking notifications * [LoadingButton](/docs/loading-button) - Buttons with loading states # DateInput import { DateInput } from '@geckoui/geckoui'; import { CalendarIcon } from 'lucide-react'; import { BasicDateInputExample, WithPlaceholderExample, CustomFormatExample, DifferentFormatsExample, CustomSeparatorExample, DisabledExample, ReadOnlyExample } from '@/components/examples/date-input-examples'; # DateInput An accessible date picker component that provides an intuitive keyboard-driven interface for date entry. Features intelligent auto-completion, cross-field validation, and support for multiple date formats. ## Installation ```tsx import { DateInput } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx import { useState } from 'react'; function Example() { const [date, setDate] = useState(null); return ( setDate(isoDate)} placeholder="Enter date" /> ); } ``` ## Key Features * **ISO 8601 Output**: Always emits dates in `YYYY-MM-DD` format * **Multiple Display Formats**: DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD * **Intelligent Auto-completion**: Auto-advances between fields * **Cross-field Validation**: Handles leap years and month-specific day limits * **Keyboard-driven**: Full keyboard navigation support ## Props API | Prop | Type | Default | Description | | ---------------------- | ---------------------------------------------- | ---------------- | ------------------------------------------------ | | `value` | `string \| null` | `""` | ISO 8601 date string (YYYY-MM-DD) | | `onChange` | `(date: string \| null) => void` | - | Callback when date changes (receives ISO format) | | `format` | `'DD/MM/YYYY' \| 'MM/DD/YYYY' \| 'YYYY/MM/DD'` | `'DD/MM/YYYY'` | Display format | | `separator` | `string` | `'/'` | Separator between date segments | | `prefix` | `ReactNode` | - | Element before input (e.g., calendar icon) | | `suffix` | `ReactNode` | - | Element after input | | `placeholder` | `string` | - | Placeholder text | | `placeholderClassName` | `string` | - | CSS class for placeholder | | `hasError` | `boolean` | `false` | Show error state | | `hideCalendarIcon` | `boolean` | `false` | Hide the default calendar icon | | `hideClearIcon` | `boolean` | `false` | Hide the clear button | | `hideCalendar` | `boolean` | `false` | Hide the calendar popup | | `wrapperClassName` | `string` | - | CSS class for wrapper div | | `calendarClassName` | `string` | - | CSS class for calendar popup | | `calendarPlacement` | `Placement` | `'bottom-start'` | Calendar popup position | | `floatingStrategy` | `'absolute' \| 'fixed'` | `'absolute'` | Floating strategy for calendar | | `disabled` | `boolean` | `false` | Disable the input | | `readOnly` | `boolean` | `false` | Make read-only | | `onStateUpdate` | `(state) => void` | - | Callback with current month/day/year values | | `onSubmit` | `() => void` | - | Callback when Enter is pressed on complete date | | `className` | `string` | - | CSS class for styling | ## Examples ### Different Formats ```tsx import { useState } from 'react'; import { DateInput } from '@geckoui/geckoui'; function Example() { const [date1, setDate1] = useState(null); const [date2, setDate2] = useState(null); const [date3, setDate3] = useState(null); return (
{/* European format */} {/* US format */} {/* ISO format */}
); } ``` ### Custom Separator ```tsx import { useState } from 'react'; import { DateInput } from '@geckoui/geckoui'; function Example() { const [date1, setDate1] = useState(null); const [date2, setDate2] = useState(null); const [date3, setDate3] = useState(null); return (
); } ``` ### Disabled State ```tsx import { useState } from 'react'; import { DateInput } from '@geckoui/geckoui'; function Example() { const [date, setDate] = useState("2024-01-15"); return ; } ``` ### Read-Only ```tsx import { useState } from 'react'; import { DateInput } from '@geckoui/geckoui'; function Example() { const [date, setDate] = useState("2024-12-25"); return ; } ``` ## ISO 8601 Format The component always outputs dates in ISO 8601 format (`YYYY-MM-DD`) regardless of the display format: ```tsx function Example() { const [date, setDate] = useState(null); return (
{ setDate(isoDate); // isoDate is always "YYYY-MM-DD" format // e.g., "2024-12-25" }} format="DD/MM/YYYY" // Display format />

Selected: {date}

{/* Shows: 2024-12-25 */}
); } ``` ## Keyboard Navigation * **Tab**: Move to next segment * **Shift + Tab**: Move to previous segment * **Arrow Up/Down**: Increment/decrement current segment * **Backspace/Delete**: Clear current segment * **Enter**: Submit (triggers `onSubmit` callback) * **Type numbers**: Auto-advance when segment is complete ## Accessibility * Fully keyboard navigable * Automatic focus management between segments * ARIA labels for screen readers * Clear visual focus indicators * Works with screen readers ## Related Components * [Calendar](/docs/calendar) - Full calendar picker * [RHFDateInput](/docs/rhf-date-input) - React Hook Form integration with calendar # DateRangeInput import { DateRangeInput } from '@geckoui/geckoui'; import { BasicDateRangeInputExample, WithDefaultValueExample, DateFormatsExample, NumberOfMonthsExample, DisabledReadOnlyExample, ErrorStateExample } from '@/components/examples/date-range-input-examples'; # DateRangeInput An input component for selecting date ranges. Features segmented date input fields, a floating calendar with dual-month display, and smart date validation. ## Installation ```tsx import { DateRangeInput } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx 'use client'; import { useState } from 'react'; import { DateRangeInput } from '@geckoui/geckoui'; import type { DateRange } from '@geckoui/geckoui'; function Example() { const [value, setValue] = useState(); return ( setValue(v ?? undefined)} /> ); } ``` ## Props API | Prop | Type | Default | Description | | ---------------------- | ---------------------------------------------- | ---------------- | ---------------------------------------------------------------------------- | | `value` | `DateRange` | - | Selected date range with `from` and `to` properties (ISO format: YYYY-MM-DD) | | `onChange` | `(value: DateRange \| null) => void` | - | Callback when date range changes | | `format` | `'DD/MM/YYYY' \| 'MM/DD/YYYY' \| 'YYYY/MM/DD'` | `'DD/MM/YYYY'` | Display format for date segments | | `separator` | `string` | `'/'` | Separator between date segments | | `rangeSeparator` | `string` | `' - '` | Separator between from and to dates | | `numberOfMonths` | `1 \| 2` | `2` | Number of months to display in calendar | | `calendarPlacement` | `Placement` | `'bottom-start'` | Calendar popup position (from @floating-ui/react) | | `floatingStrategy` | `'absolute' \| 'fixed'` | `'absolute'` | Floating UI positioning strategy | | `disabled` | `boolean` | `false` | Disable the input | | `readOnly` | `boolean` | `false` | Make the input read-only | | `hasError` | `boolean` | `false` | Show error styling | | `hideCalendar` | `boolean` | `false` | Hide the calendar popup | | `hideCalendarIcon` | `boolean` | `false` | Hide the calendar icon | | `hideClearIcon` | `boolean` | `false` | Hide the clear button | | `placeholder` | `string` | - | Custom placeholder text | | `placeholderClassName` | `string` | - | CSS class for placeholder | | `prefix` | `FC \| ReactNode` | - | Element before the input | | `suffix` | `FC \| ReactNode` | - | Element after the input | | `className` | `string` | - | CSS class for input container | | `wrapperClassName` | `string` | - | CSS class for wrapper div | | `calendarClassName` | `string` | - | CSS class for calendar container | | `onSubmit` | `() => void` | - | Callback on Enter/Space key | | `onStateUpdate` | `(state) => void` | - | Callback when input segments change | ## DateRange Type ```tsx interface DateRange { from: string | null; // ISO format: 'YYYY-MM-DD' to?: string | null; // ISO format: 'YYYY-MM-DD' } ``` ## Examples ### With Default Value Pre-populate the input with a date range: ```tsx const [value, setValue] = useState({ from: '2024-06-01', to: '2024-06-15', }); setValue(v ?? undefined)} /> ``` ### Date Formats Choose between different date display formats: ```tsx // 15/06/2024 - 30/06/2024 // 06/15/2024 - 06/30/2024 // 2024/06/15 - 2024/06/30 ``` ### Number of Months Display one or two months in the calendar: ```tsx // Single month view // Dual month view (default) ``` ### Disabled and Read-only ```tsx ``` ### Error State ```tsx ``` ## Styling The component uses BEM-style class names: * `GeckoUIDateRangeInputWrapper` - Wrapper container * `GeckoUIDateInput` - Main input container * `GeckoUIDateInput--disabled` - Disabled state * `GeckoUIDateInput--readOnly` - Read-only state * `GeckoUIDateInput--error` - Error state * `GeckoUIDateInput--focus` - Focused state * `GeckoUIDateInput--calendar-open` - Calendar is open * `GeckoUIDateInput__segment` - Date segment input * `GeckoUIDateInput__separator` - Separator between segments (/) * `GeckoUIDateRangeInput__range-separator` - Separator between dates (-) * `GeckoUIDateRangeInput__calendar` - Calendar container * `GeckoUIDateInput__calendar-icon` - Calendar icon * `GeckoUIDateInput__clear-button` - Clear button * `GeckoUIDateInput__prefix` - Prefix container * `GeckoUIDateInput__suffix` - Suffix container ## Accessibility * Segmented inputs for fine-grained keyboard control * Tab navigation between date segments * Arrow keys to move between segments * Enter/Space to open calendar and submit * Click outside to close calendar * Clear button for resetting selection ## Related Components * [Calendar](/docs/calendar) - Standalone calendar component * [DateInput](/docs/date-input) - Single date input with calendar * [RHFDateInput](/docs/rhf-date-input) - React Hook Form date input # Dialog import { Dialog, Button } from '@geckoui/geckoui'; import { BasicDialogExample, ImageLightboxExample, FormDialogExample, NoEscapeDialogExample } from '@/components/examples/dialog-examples'; # Dialog A lightweight, imperative modal component that renders content in a centered overlay. It serves as the foundational layer for more complex dialog patterns and automatically handles focus management, escape key dismissal, and click-outside behavior. ## Installation ```tsx import { Dialog } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx import { Dialog, Button } from '@geckoui/geckoui'; function Example() { const openDialog = () => { Dialog.show({ content: ({ dismiss }) => (

Welcome!

This is a simple dialog with custom content.

) }); }; return ; } ``` ## API ### Dialog.show(options) Opens a dialog with the specified options. | Option | Type | Default | Description | | ----------------------- | ------------------------------------------ | ------- | ------------------------------------------- | | `content` | `ReactNode \| FC<{ dismiss: () => void }>` | - | Content to display in the dialog (required) | | `className` | `string` | - | CSS class for the dialog container | | `dismissOnEsc` | `boolean` | `true` | Dismiss dialog on Escape key press | | `dismissOnOutsideClick` | `boolean` | `true` | Dismiss dialog on backdrop click | | `data-*` | `string` | - | Data attributes for the dialog element | ### Dialog.dismiss() Programmatically closes the currently open dialog. ```tsx // Close dialog from anywhere Dialog.dismiss(); ``` ## Examples ### Image Lightbox ```tsx const openImageViewer = () => { Dialog.show({ content: ({ dismiss }) => (
Preview
), className: "bg-transparent shadow-none", dismissOnEsc: true, dismissOnOutsideClick: true }); }; ``` ### Form Modal ```tsx import { Input, Label } from '@geckoui/geckoui'; const showUserForm = () => { Dialog.show({ content: ({ dismiss }) => (

Edit Profile

), className: "max-w-2xl", dismissOnEsc: false, dismissOnOutsideClick: false }); }; ``` ### Non-Dismissible Dialog ```tsx Dialog.show({ content: ({ dismiss }) => (

Important Notice

This dialog can only be closed by clicking the button.

), dismissOnEsc: false, dismissOnOutsideClick: false }); ``` ### Loading State ```tsx // Show loading dialog Dialog.show({ content: () => (

Processing payment...

), dismissOnEsc: false, dismissOnOutsideClick: false }); // Dismiss from anywhere after async operation await processPayment(); Dialog.dismiss(); ``` ## Content Function Pattern The `content` prop can receive a function that gets access to the `dismiss` callback: ```tsx Dialog.show({ content: ({ dismiss }) => { const handleSave = async () => { await saveData(); dismiss(); // Close after save }; return (

Edit Item

); } }); ``` ## Behavior ### Focus Management * Automatically blurs the active element when dialog opens * Prevents focus from leaving the dialog while open * Restores focus appropriately when closed ### Dismissal * **Escape Key**: Closes dialog by default (disable with `dismissOnEsc={false}`) * **Click Outside**: Closes dialog by default (disable with `dismissOnOutsideClick={false}`) * **Programmatic**: Call `Dialog.dismiss()` from anywhere ### Portal Rendering Dialog requires `` to be mounted in your app: ```tsx // app/layout.tsx import { GeckoUIPortal } from '@geckoui/geckoui'; export default function RootLayout({ children }) { return ( {children} ); } ``` ## Styling The component uses BEM-style class names: * `GeckoUIDialog` - Main container * `GeckoUIDialog__backdrop` - Background overlay * `GeckoUIDialog__dialog` - Dialog content wrapper ## Accessibility * Click-outside detection * Escape key support * Focus management * Backdrop prevents interaction with underlying content ## Related Components * [ConfirmDialog](/docs/confirm-dialog) - Pre-styled confirmation dialogs * [Drawer](/docs/drawer) - Side panel alternative to centered dialogs # Drawer import { Drawer, Button } from '@geckoui/geckoui'; import { BasicDrawerExample, MobileMenuExample, FilterPanelExample, NotificationDrawerExample, BottomSheetExample, NoBackdropDrawerExample } from '@/components/examples/drawer-examples'; # Drawer A slide-out panel component that displays auxiliary content from any edge of the viewport. Provides a less intrusive alternative to modals for navigation menus, settings panels, filters, and contextual information with smooth transitions and flexible dismissal behaviors. ## Installation ```tsx import { Drawer } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx import { useState } from 'react'; import { Drawer, Button } from '@geckoui/geckoui'; function Example() { const [open, setOpen] = useState(false); return ( <> setOpen(false)} placement="right" allowClickOutside className="w-80 p-6" >

Drawer Content

This is a basic drawer that slides in from the right side.

); } ``` ## Props API | Prop | Type | Default | Description | | ------------------- | ---------------------------------------- | --------- | ------------------------------------ | | `open` | `boolean` | `false` | Control drawer visibility (required) | | `handleClose` | `() => void` | - | Callback when drawer should close | | `placement` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'right'` | Edge from which drawer slides | | `allowClickOutside` | `boolean` | `false` | Allow clicking backdrop to close | | `dismissOnEscape` | `boolean` | `true` | Close drawer on Escape key press | | `hideBackdrop` | `boolean` | `false` | Hide backdrop overlay (visual only) | | `backdropClassName` | `string` | - | CSS class for backdrop | | `className` | `string` | - | CSS class for drawer panel | | `children` | `ReactNode` | - | Drawer content | ## Examples ### Mobile Navigation Menu ```tsx const [menuOpen, setMenuOpen] = useState(false); setMenuOpen(false)} placement="left" allowClickOutside dismissOnEscape className="w-80" > ``` ### Filter Panel ```tsx import { Input, Label, Select, SelectOption } from '@geckoui/geckoui'; const [filtersOpen, setFiltersOpen] = useState(false); const [category, setCategory] = useState(''); setFiltersOpen(false)} placement="right" allowClickOutside backdropClassName="bg-black/60" className="w-96 p-6" >

Filters

``` ### Notification Center (Top) ```tsx setShowNotifications(false)} placement="top" hideBackdrop={false} allowClickOutside className="h-96 border-b" >

Notifications

New message received

5 minutes ago

``` ### Bottom Sheet ```tsx setBottomSheetOpen(false)} placement="bottom" allowClickOutside backdropClassName="bg-black/40" className="h-64 rounded-t-2xl" >

Quick Actions

``` ### Without Backdrop ```tsx import { Input, Label } from '@geckoui/geckoui'; setSettingsVisible(false)} placement="right" hideBackdrop allowClickOutside={false} className="w-[600px] border-l" >

Settings

``` ## Imperative API Drawer also provides an imperative API for displaying drawers without managing React state: ```tsx // Show drawer imperatively Drawer.show( { handleAction(action); Drawer.dismiss(); }} />, { placement: "bottom", handleClose: () => Drawer.dismiss(), className: "h-80 rounded-t-xl" } ); // Dismiss drawer Drawer.dismiss(); ``` ### Contextual Help Panel ```tsx Drawer.show( , { placement: "right", handleClose: () => { logHelpUsage(currentTopic); Drawer.dismiss(); }, allowClickOutside: true, className: "w-[500px]" } ); ``` ## Placement Options The drawer can slide in from any edge of the viewport: * `"right"` - Slides in from the right (default) * `"left"` - Slides in from the left * `"top"` - Slides down from the top * `"bottom"` - Slides up from the bottom ## Behavior ### Click Outside When `allowClickOutside` is enabled, clicking the backdrop or any element outside the drawer will close it. Use with caution as clickable elements beneath the drawer will also trigger the close action. ### Escape Key By default, pressing the Escape key will close the drawer. Disable this with `dismissOnEscape={false}` for critical workflows. ### Backdrop The backdrop overlay can be: * **Visible** (default) - Shows a semi-transparent overlay * **Hidden** - Set `hideBackdrop={true}` to hide the backdrop visually * **Custom** - Use `backdropClassName` for custom styling ## Portal Rendering Drawer requires `` to be mounted when using the imperative API: ```tsx // app/layout.tsx import { GeckoUIPortal } from '@geckoui/geckoui'; export default function RootLayout({ children }) { return ( {children} ); } ``` ## Styling The component uses BEM-style class names: * `GeckoUIDrawer` - Main container * `GeckoUIDrawer__backdrop` - Background overlay * `GeckoUIDrawer__backdrop--visible` - Visible backdrop state * `GeckoUIDrawer__backdrop--hidden` - Hidden backdrop state * `GeckoUIDrawer__backdrop--clickthrough` - Clickable backdrop * `GeckoUIDrawer__drawer` - Drawer panel * `GeckoUIDrawer__drawer--{placement}` - Placement modifier * `GeckoUIDrawer__drawer--open` - Open state * `GeckoUIDrawer__drawer--closed` - Closed state ## Accessibility * Keyboard navigation with Escape key support * Click-outside detection * Focus management * ARIA `role="dialog"` applied * Backdrop prevents interaction with underlying content when visible ## Related Components * [Dialog](/docs/dialog) - Centered modal dialogs * [Menu](/docs/menu) - Dropdown menus and action lists # Dropdown import { Dropdown } from '@geckoui/geckoui'; import { BasicDropdownExample, CustomButtonExample, NoArrowIconExample, CustomMenuStyleExample, CustomItemStyleExample, AnchorPositionExample } from '@/components/examples/dropdown-examples'; # Dropdown A fast and easy dropdown component extended from Menu and Button components. Provides a simplified API for creating common dropdown menus with less customization complexity. For advanced use cases, consider using the Menu component directly. ## Installation ```tsx import { Dropdown } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx import { Dropdown } from '@geckoui/geckoui'; const items = [ { label: 'Edit', onClick: () => console.log('Edit clicked') }, { label: 'Duplicate', onClick: () => console.log('Duplicate clicked') }, { label: 'Delete', onClick: () => console.log('Delete clicked') } ]; function Example() { return Actions; } ``` ## Props API | Prop | Type | Default | Description | | --------------- | ---------------- | ---------------- | -------------------------------- | | `items` | `DropdownItem[]` | - | Array of menu items (required) | | `children` | `ReactNode` | - | Button content/label | | `anchor` | `Placement` | `'bottom start'` | Menu position relative to button | | `className` | `string` | - | CSS class for dropdown button | | `menuClassName` | `string` | - | CSS class for dropdown menu | | `iconClassName` | `string` | - | CSS class for arrow icon | | `hideArrowIcon` | `boolean` | `false` | Hide the dropdown arrow icon | | `data-*` | `string` | - | Data attributes | ### DropdownItem | Property | Type | Description | | ----------- | ----------------- | ------------------------- | | `label` | `ReactNode \| FC` | Display text or component | | `onClick` | `() => void` | Click handler | | `disabled` | `boolean` | Disable the item | | `className` | `string` | CSS class for the item | ## Examples ### Custom Button Style ```tsx My Account ``` ### Without Arrow Icon ```tsx Menu ``` ### Custom Menu Styling ```tsx Create New ``` ### Custom Item Styling ```tsx const items = [ { label: 'Save', onClick: () => console.log('Save'), className: 'text-green-600 font-medium' }, { label: 'Cancel', onClick: () => console.log('Cancel'), className: 'text-gray-600' }, { label: 'Delete', onClick: () => console.log('Delete'), className: 'text-red-600 font-medium' } ]; Options ``` ### Anchor Position ```tsx // Open upward from top Top Start // Align to right edge Bottom End ``` ### With Icons in Labels ```tsx import { Edit, Copy, Trash } from 'lucide-react'; const items = [ { label: (
Edit
), onClick: () => console.log('Edit') }, { label: (
Duplicate
), onClick: () => console.log('Duplicate') }, { label: (
Delete
), onClick: () => console.log('Delete') } ]; Actions ``` ### Disabled Items ```tsx const items = [ { label: 'Available Action', onClick: () => {} }, { label: 'Disabled Action', onClick: () => {}, disabled: true }, { label: 'Another Action', onClick: () => {} } ]; Actions ``` ## Keyboard Navigation * **Click**: Toggle dropdown menu * **Enter/Space**: Open dropdown when focused * **Arrow Up/Down**: Navigate items * **Enter**: Select focused item * **Escape**: Close dropdown ## Behavior ### Auto-Focus Management * Automatically blurs the button after opening to prevent focus outline * Prevents Enter key from keeping button focused ### Menu Position The `anchor` prop controls menu placement using HeadlessUI's anchor positioning: * `"bottom start"` (default) - Below button, aligned to left * `"bottom end"` - Below button, aligned to right * `"top start"` - Above button, aligned to left * `"top end"` - Above button, aligned to right ## When to Use Menu Instead Use the `Menu` component directly when you need: * Menu sections with headings * Menu separators * More complex menu item content * Advanced styling per item with render functions * Custom menu button elements ## Styling The component uses BEM-style class names: * `GeckoUIDropdown__button` - Button element * `GeckoUIDropdown__icon` - Arrow icon * `GeckoUIDropdown__menu` - Menu container * `GeckoUIDropdown__menu-item` - Individual menu items ## Accessibility * Keyboard navigation fully supported * ARIA attributes automatically applied * Focus management * Works with screen readers ## Related Components * [Menu](/docs/menu) - Advanced dropdown menus with more customization * [Button](/docs/button) - Standalone button component * [Select](/docs/select) - Form select input # Getting Started # Welcome to Gecko UI Gecko UI is a comprehensive, production-ready React component library built with TypeScript, Tailwind CSS, and modern web standards. It provides carefully crafted components designed for building complex, accessible user interfaces. ## Features * **🎨 Beautiful Design** - Modern, clean aesthetics with thoughtful spacing and typography * **â™ŋī¸ Accessible** - WCAG compliant components with keyboard navigation and ARIA support * **🔧 Highly Customizable** - Extensive theming system with CSS variables and Tailwind integration * **đŸ“Ļ TypeScript First** - Full type safety with comprehensive type definitions * **đŸŽ¯ Developer Experience** - Intuitive APIs, great documentation, and excellent IntelliSense * **📱 Responsive** - Mobile-first design that works across all screen sizes * **🚀 Performance** - Optimized bundle size with tree-shaking support * **🔌 React Hook Form** - Built-in integration with dedicated wrapper components ## Quick Start ### 1. Install the package ```bash npm install @geckoui/geckoui # or pnpm add @geckoui/geckoui # or yarn add @geckoui/geckoui ``` #### Install `react-hook-form` for form components ```bash npm install react-hook-form # or pnpm add react-hook-form # or yarn add react-hook-form ``` ### 2. Import styles Add the CSS imports to your root layout or main entry file: ```tsx import '@geckoui/geckoui/styles.css'; ``` For markdown component styling, also import: ```tsx import '@geckoui/geckoui/markdown.css'; ``` ### 3. Add GeckoUIPortal Add `GeckoUIPortal` to your layout (required for Dialog, Drawer, ConfirmDialog, and Toast components): ```tsx import { GeckoUIPortal } from '@geckoui/geckoui'; export default function RootLayout({ children }) { return ( {children} ); } ``` ### 4. Start using components ```tsx import { Button, Input, Label } from '@geckoui/geckoui'; function LoginForm() { return (
); } ``` ## What's Next? Explore the documentation to learn more: * [Installation Guide](/docs/installation) - Detailed setup instructions and configuration * [Theming](/docs/theming) - Learn how to customize the design system * Browse components in the sidebar to see all available options ## Requirements * **React**: 19.2.0 or higher * **React DOM**: 19.2.0 or higher * **Node.js**: 18.0.0 or higher (recommended) ## Browser Support Gecko UI supports all modern browsers: * Chrome (latest) * Firefox (latest) * Safari (latest) * Edge (latest) ## Community & Support * [GitHub Repository](https://github.com/geckoui/geckoui) * [Report Issues](https://github.com/geckoui/geckoui/issues) # InputError import { InputError, Input } from '@geckoui/geckoui'; # InputError A component for displaying error messages below input fields. This is a simple styled div, typically used to show validation errors or other feedback related to form inputs. ## Installation ```tsx import { InputError } from '@geckoui/geckoui'; ``` ## Basic Usage This field is required ```tsx This field is required ``` ## Props API | Prop | Type | Default | Description | | ----------- | -------------------------------- | ------- | ---------------------------- | | `children` | `ReactNode` | - | Error message content | | `className` | `string` | - | CSS class for custom styling | | ...rest | `HTMLAttributes` | - | All standard div attributes | ## Examples ### With Input Field
Please enter a valid email address
```tsx import { Input, InputError } from '@geckoui/geckoui'; function EmailField() { const [error, setError] = useState(''); return (
{error && {error}}
); } ``` ### Form Validation
Username must be at least 3 characters
Password must contain at least one number
```tsx function FormWithValidation() { const [errors, setErrors] = useState({}); return (
{errors.username && ( {errors.username} )}
{errors.password && ( {errors.password} )}
); } ``` ### Conditional Display
Email is required
```tsx function ConditionalError({ error }) { return (
{error && {error}}
); } ``` ### Multiple Error Types
Password must be at least 8 characters and contain at least one uppercase letter, one lowercase letter, and one number
```tsx function PasswordField({ errors }) { const getErrorMessage = () => { if (errors.required) return 'Password is required'; if (errors.minLength) return 'Password must be at least 8 characters'; if (errors.pattern) return 'Password must contain letters and numbers'; return ''; }; const errorMessage = getErrorMessage(); return (
{errorMessage && {errorMessage}}
); } ``` ### Custom Styling
Default error styling Custom styled error Warning style error
```tsx Custom styled error Warning style error ``` ### With Label
This field is required
```tsx import { Label, Input, InputError } from '@geckoui/geckoui';
{error && {error}}
``` ## Accessibility * Uses semantic HTML (`
` element) * Should be associated with form field via ARIA * Error styling provides visual feedback * Works with screen readers ## Styling The component uses the class name `GeckoUIInputError`. Override styles using the `className` prop: ```css .GeckoUIInputError { /* Default error styling */ } ``` ## Related Components * [Label](/docs/label) - Form field labels * [Input](/docs/input) - Text input fields * [Alert](/docs/alert) - Page-level messages * [RHFInput](/docs/rhf-input) - React Hook Form input integration # Input import { Input } from '@geckoui/geckoui'; import { SearchIcon, MailIcon } from 'lucide-react'; # Input A versatile text input component that supports prefix and suffix elements like icons or text labels. The component automatically adjusts element widths based on content. ## Installation ```tsx import { Input } from '@geckoui/geckoui'; ``` ## Basic Usage ```tsx ``` ## Props API | Prop | Type | Default | Description | | ---------------- | ------------------------------------- | ------- | --------------------------------------------------------------------- | | `prefix` | `ReactNode \| ((props) => ReactNode)` | - | Element displayed before the input (icon, text, or component) | | `suffix` | `ReactNode \| ((props) => ReactNode)` | - | Element displayed after the input (icon, text, or component) | | `inputClassName` | `string` | - | CSS class for the input element itself (for placeholder styles, etc.) | | `className` | `string` | - | CSS class for the container wrapping prefix, input, and suffix | | `disabled` | `boolean` | `false` | Disable the input | | `readOnly` | `boolean` | `false` | Make the input read-only | | ...rest | `InputHTMLAttributes` | - | All standard HTML input attributes | ## Examples ### With Prefix Icon } placeholder="Search..." /> ```tsx import { SearchIcon } from 'lucide-react'; } placeholder="Search..." /> ``` ### With Suffix Text ```tsx ``` ### With Both Prefix and Suffix ```tsx ``` ### Email Input } placeholder="your.email@example.com" /> ```tsx import { MailIcon } from 'lucide-react'; } placeholder="your.email@example.com" /> ``` ### URL Input ```tsx ``` ### Disabled State ```tsx ``` ### Read-Only State ```tsx ``` ## Accessibility * Input is wrapped in a `