Textarea
With label
open System
open FSharp.ViewEngine
open Acme.Components.Primitives
open Acme.Components.Application
open type Html
open type Svg
open type Datastar
let labelledTextarea =
Textarea.create "message" "Message"
|> Textarea.withAttributes [ _placeholder "Write your message…" ]
|> Textarea.renderWith instructions
Maximum 400 characters.
open System
open FSharp.ViewEngine
open Acme.Components.Primitives
open Acme.Components.Application
open type Html
open type Svg
open type Datastar
let editableInstructions =
Textarea.create "instructions" "Payment instructions"
|> Textarea.withId "instructions-editable"
|> Textarea.withValue "Include the invoice number with your payment."
|> Textarea.withDescription "Maximum 400 characters."
|> Textarea.withAttributes [ _maxlength 400 ]
|> Textarea.renderWith validation error
Enter a message before continuing.
open System
open FSharp.ViewEngine
open Acme.Components.Primitives
open Acme.Components.Application
open type Html
open type Svg
open type Datastar
let invalidTextarea =
Textarea.create "invalidMessage" "Message"
|> Textarea.required
|> Textarea.withValidation "Enter a message before continuing."
|> Textarea.renderPending
open System
open FSharp.ViewEngine
open Acme.Components.Primitives
open Acme.Components.Application
open type Html
open type Svg
open type Datastar
let pendingNotes =
Textarea.create "pendingNotes" "Checking notes"
|> Textarea.withValue "Please quote invoice INV-2048."
|> Textarea.pending
|> Textarea.renderDisabled
open System
open FSharp.ViewEngine
open Acme.Components.Primitives
open Acme.Components.Application
open type Html
open type Svg
open type Datastar
let unavailableNotes =
Textarea.create "unavailableNotes" "Unavailable notes"
|> Textarea.disabled
|> Textarea.render