Documentation navigation

Published API · 0.1.0-rc.1

themes · components/text-area

Published themes API declarations for components/text-area.

./components/text-area

@wsagency/wseffect-themes · MIT · source · MIT license · WS-AGENCY-NOTICE

This entry point is published in @wsagency/wseffect-themes@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-themes/components/text-area'

Exported declarations

Props

export type Props = typeof Props.Type;

Props

Props: Schema.Struct<{
    readonly id: Schema.String;
    readonly label: Schema.optional<Schema.String>;
    readonly size: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly string[]> | Schema.String, Schema.Struct<{
        [k: string]: Schema.optional<Schema.Literals<readonly string[]> | Schema.String>;
    }>]>>;
    readonly variant: Schema.optional<Schema.Literals<readonly ["classic", "surface", "soft"]>>;
    readonly resize: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly string[]> | Schema.String, Schema.Struct<{
        [k: string]: Schema.optional<Schema.Literals<readonly string[]> | Schema.String>;
    }>]>>;
    readonly color: Schema.optional<Schema.Literals<readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky", "custom"]>>;
    readonly radius: Schema.optional<Schema.Literals<readonly ["none", "small", "medium", "large", "full"]>>;
    readonly value: Schema.optional<Schema.String>;
    readonly defaultValue: Schema.optional<Schema.String>;
    readonly disabled: Schema.optional<Schema.Boolean>;
    readonly readOnly: Schema.optional<Schema.Boolean>;
    readonly invalid: Schema.optional<Schema.Boolean>;
    readonly autofocus: Schema.optional<Schema.Boolean>;
    readonly name: Schema.optional<Schema.String>;
    readonly required: Schema.optional<Schema.Boolean>;
    readonly rows: Schema.optional<Schema.Number>;
    readonly placeholder: Schema.optional<Schema.String>;
}>

view

view: <Message>(props: ViewProps<Message>, children: ReadonlyArray<Html | string>, h: HtmlBuilder<Message>) => Html

ViewProps

export type ViewProps<Message> = Props & Readonly<{
    onInput?: (value: string) => Message;
    /** Additional native textarea attributes and event handlers. The typed list supports Foldkit's full textarea attribute set and is forwarded directly to the `<textarea>`. */
    textareaAttributes?: ReadonlyArray<TextareaAttribute<Message>>;
}>;

Props

Props exported by @wsagency/wseffect-themes/components/text-area · Props · source
NameTypeRequiredChoicesDescription
idstringYes——
labelstringNo——
size"1" | "2" | "3" | Responsive<"1" | "2" | "3">No——
variant"classic" | "surface" | "soft"No"classic", "surface", "soft"—
resize"none" | "vertical" | "horizontal" | "both" | Responsive<"none" | "vertical" | "horizontal" | "both">No——
color"gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky" | "custom"No"gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky", "custom"—
radius"none" | "small" | "medium" | "large" | "full"No"none", "small", "medium", "large", "full"—
valuestringNo——
defaultValuestringNo——
disabledbooleanNo——
readOnlybooleanNo——
invalidbooleanNo——
autofocusbooleanNo——
namestringNo——
requiredbooleanNo——
rowsnumberNo——
placeholderstringNo——

Rendered component example

TextArea
Example usage
import * as Themes from '@wsagency/wseffect-themes'
import * as SliderRange from '@wsagency/wseffect-themes/components/slider/range'
import * as Option from 'effect/Option'
import { defineView } from '@wsagency/wseffect-foldkit/submodel'
import { inertHtml, type HtmlBuilder } from '@wsagency/wseffect-foldkit/html'

const example = (h: HtmlBuilder<unknown>) => Themes.TextArea.view({ id: 'summary', value: 'Release notes', onInput: (value) => value }, [], h)