GitHub

Textarea

Textarea works alongside the HTML textarea element, with additional custom styling and functionality.

Components

DaffTextareaComponent

import { DaffTextareaComponent } from '@daffodil/design/textarea'

DaffTextareaComponent provides the same functionality as a native <textarea> and contains custom styling and functionality.

@Component()
class DaffTextareaComponent extends DaffFormFieldControl<string> implements DaffFormFieldControl<string>, OnInit {
  readonly supportsAutoLabelling: boolean = true
  readonly id: string
  get raised(): boolean
  get state(): DaffFormFieldState
  _stateChanges: BehaviorSubject = new BehaviorSubject({
      focused: false,
      filled: false,
      disabled: false,
      error: false,
      valid: true,
    })
  stateChanges: Observable<DaffFormFieldState>

  emitState(deferred: boolean = false): void
}

Properties

supportsAutoLabelling
boolean
Defaulttrue
Description

Whether the control supports automatic label behavior. When true, the form field will associate the label with the control using for and id attributes.

Defaults to true.

id
string
Default
Description

The unique identifier for the control element.

raised
boolean
Default
Description

Whether the label should be in the raised position. By default, matches the focused state.

state
DaffFormFieldState
Default
Description

Computes the current state of the form field control. Combines control properties and form validation state.

_stateChanges
BehaviorSubject
Defaultnew BehaviorSubject({ focused: false, filled: false, disabled: false, error: false, valid: true, })
Description
stateChanges
Observable
Default
Description

Observable stream of state changes for the form field control.

() Methods

emitState
void

Emits the current state.

Parameters
Parameterdeferred: boolean
Defaultfalse
Description