Documentation navigation

Published API · 0.1.0-rc.1

foldkit-ui · textarea

Published foldkit-ui API declarations for textarea.

./textarea

@wsagency/wseffect-foldkit-ui · MIT · source · MIT license · WS-AGENCY-NOTICE · THIRD-PARTY-NOTICES

This entry point is published in @wsagency/wseffect-foldkit-ui@0.1.0-rc.1. Import it from the package subpath shown below; the signatures and documentation are read from the installed package declarations.

import * as Wseffect from '@wsagency/wseffect-foldkit-ui/textarea'

Exported declarations

descriptionId

Returns the description element id, derived from the textarea's base id.

descriptionId: (id: string) => string

TextareaAttributes

Attribute groups the textarea component provides to the consumer's `toView` callback.

export type TextareaAttributes<Message> = Readonly<{
    textarea: ReadonlyArray<TextareaAttribute<Message>>;
    label: ReadonlyArray<Attribute<Message>>;
    description: ReadonlyArray<Attribute<Message>>;
}>;

view

Renders an accessible textarea by building ARIA attribute groups and delegating layout to the consumer's `toView` callback.

view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html

ViewConfig

Configuration for rendering a textarea with `view`.

export type ViewConfig<Message> = Readonly<{
    id: string;
    toView: (attributes: TextareaAttributes<Message>) => Html;
    onInput?: (value: string) => Message;
    value?: string;
    isDisabled?: boolean;
    isReadOnly?: boolean;
    isInvalid?: boolean;
    isAutofocus?: boolean;
    hasDescription?: boolean;
    name?: string;
    rows?: number;
    placeholder?: string;
}>;