Base

  • Colors
  • Icons
  • Logos
  • Shadows and Elevations
  • Spacing
  • Typography

Components

  • Accordion
  • Avatars
  • Badges
  • Buttons
  • Cards
  • Character Counter
  • Device Type Icons
  • Draggables
  • Dropdowns
  • Droppables
  • Expandable image
  • Filters
  • Gallery card
  • Icon Button
  • Indicators
  • Lightbox image
  • Lists
  • Loading
  • Messages
  • Pictogram
  • Poster Play
  • Progress bar
  • QR Code
  • Rating stars
  • Row Selector
  • Segmented Controls
  • Sentiment
  • Split View
  • Tables
  • Tags
  • Tester vitals
  • Toggle button
  • Typeahead

Form

  • Checkbox
  • Combobox
  • Form Rule
  • Hint
  • Input
  • Input Title
  • Label
  • Multi-select List
  • Search
  • Select
  • Single-select List
  • Sliders
  • Switch
  • Text Area

Layout

  • Containers
  • Layers
  • Layout
  • Split Layout
  • Wrappers

Navigation

  • Context Switcher
  • Nav bar
  • Navigation
  • Pagination
  • Sidebar Navigation
  • Step Navigation
  • Tabs

Overlay

  • Banners
  • Bulk Selector
  • Modals
  • Popovers
  • Toast
  • Tooltips
  • User Notifications

Patterns

  • Full Page Message
  • Question card & Group Questions Container

Visualizations

  • Data Colors

Text Area

A controllable text area box.

Text Area

Labelled Text Area
Expand Copy
  <tk-text-area>
    <span slot="label" class="l-block mb-2x">Labelled Text Area</span>
  </tk-text-area>

Description

Text areas are inputs for inputting text. They can be resized to allow for larger amount of text input than the tk-input box.

Maximum Length

Maximum character length
Expand Copy
  <tk-text-area
    max-length="5">
    <span slot="label" class="l-block mb-2x">Maximum character length</span>
  </tk-text-area>

Description

The maxLength prop can be provided to control the maximum number of characters that a tk-text-area will accept.

Placeholder

Example placeholder text
Expand Copy
  <tk-text-area
    placeholder="Example placeholder text">
    <span slot="label" class="l-block mb-2x">Example placeholder text</span>
  </tk-text-area>

Description

Placeholders can be added to the tk-text-area to give the user information, this disappears as soon as an input is entered.

Prefilled / Controlled

Prefilled text
Prefilled text in error state
Prefilled text in disabled state
Expand Copy
  <tk-text-area
    is-filled="true"
    value="Prefilled text">
    <span slot="label" class="l-block mb-2x">Prefilled text</span>
  </tk-text-area>
  <hr>
  <tk-text-area
    error
    is-filled="true"
    value="Prefilled text">
    <span slot="label" class="l-block mb-2x">Prefilled text in error state</span>
  </tk-text-area>
  <hr>
  <tk-text-area
    disabled
    is-filled="true"
    value="Prefilled text">
    <span slot="label" class="l-block mb-2x">Prefilled text in disabled state</span>
  </tk-text-area>

Description

The value prop can be used to prefill the input, or to make the tk-text-area controlled.

Rows

Specified row count
Expand Copy
  <tk-text-area
    rows="5">
    <span slot="label" class="l-block mb-2x">Specified row count</span>
  </tk-text-area>

Description

The number of rows of text you wish the tx-text-area to display can be specified. This will define the height of the tx-text-area.

States

Standard state
Error state
Disabled state
Readonly state
Expand Copy
  <tk-text-area
    placeholder="Standard state">
    <span slot="label" class="l-block mb-2x">Standard state</span>
  </tk-text-area>
  <hr>
  <tk-text-area
    error
    placeholder="Error state">
    <span slot="label" class="l-block mb-2x">Error state</span>
  </tk-text-area>
  <hr>
  <tk-text-area
    disabled
    placeholder="Disabled state">
    <span slot="label" class="l-block mb-2x">Disabled state</span>
  </tk-text-area>
  <hr>
  <tk-text-area
    readonly
    placeholder="Readonly state">
    <span slot="label" class="l-block mb-2x">Readonly state</span>
  </tk-text-area>

Description

The tk-text-area can be in error, disabled, or readonly states.

Resize

Resize Both
Resize Vertical
Expand Copy
  <tk-text-area
    placeholder="Resize Both">
    <span slot="label" class="l-block mb-2x">Resize Both</span>
  </tk-text-area>
  <hr>
  <tk-text-area
    placeholder="Resize Vertical"
    resize="vertical">
    <span slot="label" class="l-block mb-2x">Resize Vertical</span>
  </tk-text-area>

Description

The tk-text-area’s resize functionality can be changed. If defaults to being resized both horizontally and vertically, but can also be set to only be resized vertically.

Hint

Enter text here Text Area With Hint
There was an error Text Area With Error Hint
Expand Copy
  <tk-text-area>
    <span slot="hint" class="l-inline-flex l-v-center">
      <tk-icon name="heart" size="xs" class="mr-1x" variant="filled"></tk-icon>
      Enter text here
    </span>
    <span slot="label" class="l-block mb-2x">Text Area With Hint</span>
  </tk-text-area>
  <hr/>
  <tk-text-area error value="Text value">
    <span slot="hint" class="l-inline-flex l-v-center">
      <tk-icon name="alert" size="xs" class="mr-1x" variant="filled"></tk-icon>
      There was an error
    </span>
    <span slot="label" class="l-block mb-2x">Text Area With Error Hint</span>
  </tk-text-area>

Description

The tk-text-area can render a hint containing any content injected into the hint slot, when supplied. When the error prop is also true, the hint is rendered in the error state, aria-invalid="true" is added to the textarea and the aria-errormessage value of the textarea is set to the id of the tk-hint.

Character counter

Text Area With Character Counter
Enter text here Text Area With Character Counter And Hint
Expand Copy
  <tk-text-area class="t-normal">
    <tk-character-counter
      count-down="true"
      max-length="256"
      slot="character-counter"
      text=""
    ></tk-character-counter>
    <span slot="label" class="l-block mb-2x">Text Area With Character Counter</span>
  </tk-text-area>
  <hr/>
  <tk-text-area class="t-normal">
    <span slot="hint" class="l-inline-flex l-v-center">
      <tk-icon name="heart" size="xs" class="mr-1x" variant="filled"></tk-icon>
      Enter text here
    </span>
    <tk-character-counter
      count-down="true"
      max-length="256"
      slot="character-counter"
      text=""
    ></tk-character-counter>
    <span slot="label" class="l-block mb-2x">Text Area With Character Counter And Hint</span>
  </tk-text-area>

Description

The tk-text-area renders any content injected into the character-counter slot underneath and to the right-hand side of the textarea. As the name suggests, the intended slot content is a tk-character-counter component. The counter will be inline with the hint, if one is provided.

Label Size

Text Area With Medium Label
Text Area With Large Label
Expand Copy
  <tk-text-area>
    <span slot="label" class="mb-2x t-medium">Text Area With Medium Label</span>
  </tk-text-area>
  <hr/>
  <tk-text-area>
    <span slot="label" class="mb-2x t-large">Text Area With Large Label</span>
  </tk-text-area>

Description

If label slot is provided, our typography utility classes can be used to change the sizing of the label to any size within that class. If no label size is set, medium is used as a default.

Border

Text Area With No Border
Expand Copy
  <tk-text-area
    border="false"
    placeholder="Example placeholder text">
    <span slot="label" class="l-block mb-2x">Text Area With No Border</span>
  </tk-text-area>

Description

The tk-text-area can be used with no surrounding borders. It should be used in a container (such as a modal) and accompanied with placeholder text and an aria-label to give the user additional guidance.

Prevent Paste

Pasting from clipboard or dropping in text is disabled
Expand Copy
 <tk-text-area prevent-paste="true">
  <span slot="label" class="l-block mb-2x">Pasting from clipboard or dropping in text is disabled</span>
  </tk-text-area>

Description

When set to true, the user cannot paste text from the clipboard or drop text into the text area.

Accessibility

  • Inputs should always use the label slot.

  • The component will then render a <label> above the input and automatically make an association between the two.

tk-text-area

Properties

Property Attribute Description Type Default
border border boolean true
disabled disabled boolean false
error error boolean false
isFilled is-filled boolean false
labelHidden label-hidden boolean false
labelSize label-size string undefined
labelText label-text string undefined
maxLength max-length number undefined
placeholder placeholder string undefined
preventPaste prevent-paste Prevents the user from pasting text into the input when set to ’true'. boolean false
readonly readonly boolean false
resize resize "both" | "vertical" 'both'
rows rows number undefined
value value string ''

Events

Event Description Type
valueChanged CustomEvent<string>

Methods

focusComponent() => Promise<void>

Returns

Type: Promise<void>