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

With dir attribute

To allow the correct display of right to left languages.

When the right_to_left parameter is set to true any hint text displays in the same text direction as the label.

How it looks (preview)

Hint text displayed right to left

How to call this example

<%= render "govuk_publishing_components/components/label", {
  text: "العربيَّة",
  html_for: "id-that-matches-input-7",
  hint_id: "should-match-aria-describedby-input",
  hint_text: "Hint text displayed right to left",
  right_to_left: true
} %>