@porsche-design-system/components-react
Version:
Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.
201 lines (200 loc) • 5.41 kB
TypeScript
import type { BaseProps } from '../../BaseProps';
import type { TextareaAutoComplete, BreakpointCustomizable, TextareaBlurEventDetail, TextareaChangeEventDetail, TextareaInputEventDetail, TextareaResize, TextareaState, Theme, TextareaWrap } from '../types';
export type PTextareaProps = BaseProps & {
/**
* Specifies whether the input can be autofilled by the browser
*/
autoComplete?: TextareaAutoComplete;
/**
* The description text.
*/
description?: string;
/**
* Marks the textarea as disabled.
*/
disabled?: boolean;
/**
* The id of a form element the textarea should be associated with.
*/
form?: string;
/**
* Show or hide label. For better accessibility it is recommended to show the label.
*/
hideLabel?: BreakpointCustomizable<boolean>;
/**
* The label text.
*/
label?: string;
/**
* The max length of the textarea.
*/
maxLength?: number;
/**
* The message styled depending on validation state.
*/
message?: string;
/**
* The min length of the textarea.
*/
minLength?: number;
/**
* The name of the textarea.
*/
name: string;
/**
* Emitted when the textarea has lost focus.
*/
onBlur?: (event: CustomEvent<TextareaBlurEventDetail>) => void;
/**
* Emitted when the textarea loses focus after its value was changed.
*/
onChange?: (event: CustomEvent<TextareaChangeEventDetail>) => void;
/**
* Emitted when the value has been changed as a direct result of a user action.
*/
onInput?: (event: CustomEvent<TextareaInputEventDetail>) => void;
/**
* The placeholder text.
*/
placeholder?: string;
/**
* Specifies whether the textarea should be read-only.
*/
readOnly?: boolean;
/**
* Marks the textarea as required.
*/
required?: boolean;
/**
* Controls whether the textarea is resizable and in which direction.
*/
resize?: TextareaResize;
/**
* The amount of rows of the textarea.
*/
rows?: number;
/**
* Show or hide max character count.
*/
showCounter?: boolean;
/**
* Specifies whether the input should have its spelling and grammar checked
*/
spellCheck?: boolean;
/**
* The validation state.
*/
state?: TextareaState;
/**
* Adapts the color depending on the theme.
*/
theme?: Theme;
/**
* The textarea value.
*/
value?: string;
/**
* Handles wrapping behaviour of elements.
*/
wrap?: TextareaWrap;
};
export declare const PTextarea: import("react").ForwardRefExoticComponent<import("react").DOMAttributes<{}> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & {
/**
* Specifies whether the input can be autofilled by the browser
*/
autoComplete?: TextareaAutoComplete;
/**
* The description text.
*/
description?: string;
/**
* Marks the textarea as disabled.
*/
disabled?: boolean;
/**
* The id of a form element the textarea should be associated with.
*/
form?: string;
/**
* Show or hide label. For better accessibility it is recommended to show the label.
*/
hideLabel?: BreakpointCustomizable<boolean>;
/**
* The label text.
*/
label?: string;
/**
* The max length of the textarea.
*/
maxLength?: number;
/**
* The message styled depending on validation state.
*/
message?: string;
/**
* The min length of the textarea.
*/
minLength?: number;
/**
* The name of the textarea.
*/
name: string;
/**
* Emitted when the textarea has lost focus.
*/
onBlur?: (event: CustomEvent<TextareaBlurEventDetail>) => void;
/**
* Emitted when the textarea loses focus after its value was changed.
*/
onChange?: (event: CustomEvent<TextareaChangeEventDetail>) => void;
/**
* Emitted when the value has been changed as a direct result of a user action.
*/
onInput?: (event: CustomEvent<TextareaInputEventDetail>) => void;
/**
* The placeholder text.
*/
placeholder?: string;
/**
* Specifies whether the textarea should be read-only.
*/
readOnly?: boolean;
/**
* Marks the textarea as required.
*/
required?: boolean;
/**
* Controls whether the textarea is resizable and in which direction.
*/
resize?: TextareaResize;
/**
* The amount of rows of the textarea.
*/
rows?: number;
/**
* Show or hide max character count.
*/
showCounter?: boolean;
/**
* Specifies whether the input should have its spelling and grammar checked
*/
spellCheck?: boolean;
/**
* The validation state.
*/
state?: TextareaState;
/**
* Adapts the color depending on the theme.
*/
theme?: Theme;
/**
* The textarea value.
*/
value?: string;
/**
* Handles wrapping behaviour of elements.
*/
wrap?: TextareaWrap;
} & {
children?: import("react").ReactNode | undefined;
} & import("react").RefAttributes<HTMLElement>>;