Loading...
Installation
Props
Prop | Type | Default | Description |
---|---|---|---|
label | string | "Action Input" | The label for the input field |
placeholder | string | "Type command, email, or snippet..." | Placeholder text |
type | string | "text" | Input type |
defaultValue | string | "" | Default input value |
validate | (value: string) => string | null | undefined | Custom validation function |
actions | ActionHubInputAction[] | [] | Array of action buttons |
historyEnabled | boolean | true | Enable input history tracking |
Action Interface
interface ActionHubInputAction {
icon: JSX.Element;
onClick: (value: string) => Promise<void> | void;
tooltip?: string;
showOnEmpty?: boolean;
}
Features
- Customizable Actions: Add any number of action buttons with custom icons and behaviors
- Status Indicators: Visual feedback for loading, success, and error states
- Input History: Tracks and suggests previously entered values
- Async Support: Handles both synchronous and asynchronous action functions
- Conditional Display: Actions can be shown/hidden based on input state
- Validation Support: Built-in validation with error display