1. Component Guide
  2. Form date input
  3. With custom items
Form date input example

With custom items

How it looks (preview)

Beth yw eich dyddiad geni?
Er enghraifft, 31 3 1980

How to call this example

<%= render "govuk_publishing_components/components/date_input", {
  legend_text: "Beth yw eich dyddiad geni?",
  hint: "Er enghraifft, 31 3 1980",
  items: [
    {
      label: "Dydd",
      name: "dob-dydd",
      width: 2,
      value: 31
    },
    {
      label: "Mis",
      name: "dob-mis",
      width: 2,
      value: 3
    },
    {
      label: "Blwyddyn",
      name: "dob-blwyddyn",
      width: 4,
      value: 1980
    }
  ]
} %>