{"__v":4,"_id":"57100d24711e960e00f246d2","category":{"project":"56abbf55f25f160d00e17f4e","version":"56abbf55f25f160d00e17f51","_id":"570a5676ade45d0e00c1ad33","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-04-10T13:34:46.864Z","from_sync":false,"order":3,"slug":"client-side-api","title":"Client Side API"},"parentDoc":null,"project":"56abbf55f25f160d00e17f4e","user":"56abbec30b9e0b0d00616274","version":{"__v":12,"_id":"56abbf55f25f160d00e17f51","project":"56abbf55f25f160d00e17f4e","createdAt":"2016-01-29T19:36:53.665Z","releaseDate":"2016-01-29T19:36:53.665Z","categories":["56abbf56f25f160d00e17f52","56abca6bf9757e0d007c6650","56acddfa0ab3c00d00ce3332","56af65da9d32e30d0006d30f","56af66cab34d210d003d9ad0","56af6afcd21e9c0d00b628d1","56af6d6ecc4cbd0d00ce2c88","5705b12221cfed0e00e8c580","570a5676ade45d0e00c1ad33","570d7d25d1e4b82000d9e385","570eac3c3160d10e0041df0e","575709000fd6a3200010dded"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-14T21:35:32.118Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":4,"body":"### Displaying a Custom Tab\n\nThis function displays a [custom chat](doc:api-custom-chat) tab in the chat area, which will replace any other custom tabs that might be showing. It takes a `name`, `description`, and `options`:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`name`\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Name of the tab\",\n    \"1-0\": \"`description`\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Description of the tab\",\n    \"2-0\": \"`options`\",\n    \"2-1\": \"Object\",\n    \"2-2\": \"Extra options for the tab\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]\nThe options object can have the following properties:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`size`\",\n    \"0-1\": \"Decimal\",\n    \"0-2\": \"Relative size of the canvas, 0 being the smallest, 1 being the largest (default 0.5)\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n**Example:** Display a custom tab with a large canvas\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"kongregate.chat.showTab(\\\"MyTab\\\",\\\"My Custom Tab\\\", {size:0.75});\",\n      \"language\": \"javascript\",\n      \"name\": \"ActionScript 3\"\n    },\n    {\n      \"code\": \"kongregate.chat.showTab(\\\"MyTab\\\",\\\"My Custom Tab\\\", {size:0.75});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"The `name` and `description` parameters are currently unused - the tab will display \\\"Match\\\" at the top for now. These may be implemented in the future, so adding them in your code will ensure that it will work when we do.\"\n}\n[/block]\nRelated:\n\n* [Custom Chat](doc:api-custom-chat) \n* [Chat.AddEventListener](doc:client-api-chat-addeventlistener)\n* [Chat.ClearMessages](doc:client-api-chat-clearmessages) \n* [Chat.CloseTab](doc:client-api-chat-closetab) \n* [Chat.DisplayMessage](doc:client-api-chat-displaymessage)","excerpt":"Displays a custom chat tab\n`showTab(name, description, options)`","slug":"client-api-chat-showtab","type":"fn","title":"Chat.ShowTab"}

Chat.ShowTab

Displays a custom chat tab `showTab(name, description, options)`

### Displaying a Custom Tab This function displays a [custom chat](doc:api-custom-chat) tab in the chat area, which will replace any other custom tabs that might be showing. It takes a `name`, `description`, and `options`: [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`name`", "0-1": "String", "0-2": "Name of the tab", "1-0": "`description`", "1-1": "String", "1-2": "Description of the tab", "2-0": "`options`", "2-1": "Object", "2-2": "Extra options for the tab" }, "cols": 3, "rows": 3 } [/block] The options object can have the following properties: [block:parameters] { "data": { "h-0": "Name", "h-1": "Type", "h-2": "Description", "0-0": "`size`", "0-1": "Decimal", "0-2": "Relative size of the canvas, 0 being the smallest, 1 being the largest (default 0.5)" }, "cols": 3, "rows": 1 } [/block] **Example:** Display a custom tab with a large canvas [block:code] { "codes": [ { "code": "kongregate.chat.showTab(\"MyTab\",\"My Custom Tab\", {size:0.75});", "language": "javascript", "name": "ActionScript 3" }, { "code": "kongregate.chat.showTab(\"MyTab\",\"My Custom Tab\", {size:0.75});", "language": "javascript" } ] } [/block] [block:callout] { "type": "info", "title": "Note", "body": "The `name` and `description` parameters are currently unused - the tab will display \"Match\" at the top for now. These may be implemented in the future, so adding them in your code will ensure that it will work when we do." } [/block] Related: * [Custom Chat](doc:api-custom-chat) * [Chat.AddEventListener](doc:client-api-chat-addeventlistener) * [Chat.ClearMessages](doc:client-api-chat-clearmessages) * [Chat.CloseTab](doc:client-api-chat-closetab) * [Chat.DisplayMessage](doc:client-api-chat-displaymessage)