1. Component Guide
  2. Form textarea
  3. With dir attribute
Form textarea example

With dir attribute

Allows the correct display of right to left languages.

By default the textarea element and the label both display text in a left to right direction.

When the right_to_left parameter of the textarea component is set to true all text desplays in a right to left direction.

How it looks (preview)

Some hint text that displays in the same text direction as the label

Error: An error message that displays in the same text direction as the label

How to call this example

<%= render "govuk_publishing_components/components/textarea", {
  label: {
    text: "Some textarea text that displays right to left with a label that displays in the same direction"
  },
  hint: "Some hint text that displays in the same text direction as the label",
  error_message: "An error message that displays in the same text direction as the label",
  name: "rtl-textarea-text",
  value: "العربيَّة",
  right_to_left: true
} %>