1. Component Guide
  2. Option select
  3. With option pre checked
Option select example

With option pre checked

How it looks (preview)

List of options

List of options

How to call this example

<%= render "govuk_publishing_components/components/option_select", {
  key: "with_checked_value_set",
  title: "List of options",
  options_container_id: "list_of_vegetables",
  options: [
    {
      value: "potatoes",
      label: "Potatoes",
      checked: true
    },
    {
      value: "carrots",
      label: "Carrots",
      id: "carrots"
    },
    {
      value: "mash",
      label: "Mash",
      id: "mash"
    }
  ]
} %>