{
  "$id": "http://gov.uk/schema/v1.0.0/definition/button",
  "_name": "definition.button",
  "title": "Button component definition",
  "allOf": [
    {
      "$ref": "http://gov.uk/schema/v1.0.0/definition/component"
    },
    {
      "$ref": "http://gov.uk/schema/v1.0.0/definition/htmlattributes"
    },
    {
      "$ref": "http://gov.uk/schema/v1.0.0/validations#/definitions/requiredBundle"
    }
  ],
  "properties": {
    "name": {
      "title": "Name",
      "description": "Button name",
      "type": "string"
    },
    "value": {
      "title": "Value",
      "description": "Button value",
      "type": "string"
    },
    "html": {
      "title": "Text",
      "description": "Button text",
      "type": "string",
      "content": true
    },
    "href": {
      "title": "URL",
      "description": "Button URL",
      "type": "string",
      "content": true
    },
    "element": {
      "title": "Element",
      "description": "Button element",
      "type": "string",
      "enum": ["button", "a", "input"]
    },
    "preventDoubleClick": {
      "title": "Prevent double click",
      "description": "Stop users from accidentally sending information more than once",
      "type": "boolean",
      "default": true
    },
    "disabled": {
      "title": "Disabled",
      "oneOf": [
        {
          "$ref": "http://gov.uk/schema/v1.0.0/definition/conditional/boolean"
        }
      ],
      "default": false
    }
  },
  "category": [
    "button"
  ]
}
