# certara-input



<!-- Auto Generated Below -->


## Properties

| Property      | Attribute     | Description                                                        | Type                                                                                                                                     | Default        |
| ------------- | ------------- | ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `accept`      | `accept`      | Accepted file types for file inputs (e.g., ".pdf,.doc").           | `string`                                                                                                                                 | `undefined`    |
| `disabled`    | `disabled`    | Prevents user interaction.                                         | `boolean`                                                                                                                                | `false`        |
| `max`         | `max`         | Maximum value for number/date inputs.                              | `number \| string`                                                                                                                       | `undefined`    |
| `maxlength`   | `maxlength`   | Maximum number of characters allowed.                              | `number`                                                                                                                                 | `undefined`    |
| `min`         | `min`         | Minimum value for number/date inputs.                              | `number \| string`                                                                                                                       | `undefined`    |
| `minlength`   | `minlength`   | Minimum number of characters required.                             | `number`                                                                                                                                 | `undefined`    |
| `name`        | `name`        | Form control name, used for form submission and validation events. | `string`                                                                                                                                 | `this.inputId` |
| `pattern`     | `pattern`     | Regex pattern the value must match.                                | `string`                                                                                                                                 | `undefined`    |
| `placeholder` | `placeholder` | Placeholder text shown when empty.                                 | `string`                                                                                                                                 | `undefined`    |
| `readonly`    | `readonly`    | Prevents editing while allowing selection and copy.                | `boolean`                                                                                                                                | `false`        |
| `required`    | `required`    | Marks the field as required for form validation.                   | `boolean`                                                                                                                                | `false`        |
| `size`        | `size`        | Visual size variant of the input.                                  | `"md" \| "sm"`                                                                                                                           | `'md'`         |
| `step`        | `step`        | Step increment for number inputs.                                  | `number \| string`                                                                                                                       | `undefined`    |
| `type`        | `type`        | Input type, affects keyboard on mobile and validation.             | `"date" \| "datetime-local" \| "email" \| "file" \| "month" \| "number" \| "password" \| "search" \| "tel" \| "text" \| "time" \| "url"` | `'text'`       |
| `value`       | `value`       | Current value of the input.                                        | `string`                                                                                                                                 | `undefined`    |


## Events

| Event                     | Description                                                                                     | Type                  |
| ------------------------- | ----------------------------------------------------------------------------------------------- | --------------------- |
| `certaraBlur`             | Emitted when the input loses focus.                                                             | `CustomEvent<any>`    |
| `certaraChange`           | Emitted when value changes from the previous value.                                             | `CustomEvent<any>`    |
| `certaraFocus`            | Emitted when the input gains focus.                                                             | `CustomEvent<any>`    |
| `certaraFormControlError` | Emitted when validation state changes. Payload is the error message or empty string when valid. | `CustomEvent<string>` |
| `certaraInput`            | Emitted on every keystroke.                                                                     | `CustomEvent<any>`    |


## Methods

### `setBlur() => Promise<void>`

Programmatically blurs the input.

#### Returns

Type: `Promise<void>`



### `setError(error: string) => Promise<void>`

Sets a custom error message. This allows consumers to call `input.setError('my error message')` instead of `input.setAttribute('error', 'my error message')`.

#### Parameters

| Name    | Type     | Description                                             |
| ------- | -------- | ------------------------------------------------------- |
| `error` | `string` | The error message to display, or empty string to clear. |

#### Returns

Type: `Promise<void>`



### `setFocus() => Promise<void>`

Programmatically focuses the input.

#### Returns

Type: `Promise<void>`




## Slots

| Slot        | Description                                            |
| ----------- | ------------------------------------------------------ |
| `"append"`  | Content placed after the input (e.g., buttons, icons). |
| `"prepend"` | Content placed before the input (e.g., labels, icons). |


----------------------------------------------


