Widgets

Widgets in Cliq

Widgets are a great way to customize your Cliq home screen. Imagine having a custom view of all the important data and functionality from the different apps that you use every day. For example, the Twitter widget brings you your twitter feed, the Projects widget shows you recently assigned tasks and bugs, the Notes widget lets you view your recent notes or take notes. 

Widgets are highly customizable and support a wide range of textual and visual elements to make the data displayed more actionable. 

Understanding a widget's structure

Before you start building a widget, it is valuable to understand how widgets in Cliq are structured. Widgets in Cliq are made up of tabs containing sections that house a combination of various elements. 

Widgets

   - Tabs

        - Sections

              - Elements

Tabs

Cliq widgets' tabs are quite similar to any browser's tabs. They're labeled, clickable areas that contain a combination of sections having different elements. Think of a tab as the outermost container or layer that houses the rest of the pieces that form your widget. You can switch between tabs by just clicking on them and just like a browser, the currently selected tab is highlighted than the others. 

Note:

Each Cliq widget can have a maximum of 5 tabs.

Tab Views

Tab views are customizable views that can be created based on the type and amount of data you'd like to display. There are three types of tab views that you can create: 

  • Sections View
  • Info View
  • Web View

Sections View

A sections view comprises different varieties of display and actionable elements that can hold crucial information. This information can be solely for the users' consumption or even to perform actions right from the section. In addition to supporting all the widget section elements, the sections view also supports a header and footer. 


elements = list();
elements.add(
    {
        "type":"title",
        "text":"Widget Title"
    }
);
elements.add(
    {
        "type":"text",
        "text":"Here goes the text! Widgets are built as an internal tool similar to commands, bots and message actions. They are listed in the left side bar of Cliq and will be displayed as a full view in Cliq's home screen. Consider widgets as a mini version of any third party integration or a standalone app that works for you, for your team or for the entire organization."
    }
);
sections = list();
sections.add(
    {
        "id":1,
        "elements":elements
    }
);
return {
    "type":"applet",
    "tabs":[
        {
            "label":"Home",
            "id":"homeTab"
        }
    ],
    "active_tab":"homeTab",
    "sections": sections
};

 

Info View

The info view is typically used to display a piece of important information, mainly for users' consumption with only one actionable element (button). 


return {
	"type":"applet",
	"data_type":"info",
	"tabs":[
	{"label":"Home","id":"homeTab"}
	],
	"info":{
	"title":"Your default portal is not configured yet!",
	"description":"Click here to configure.",
	"image_url":"https://i.ibb.co/gSP05Yr/Cliq-automation.png",
	"button":{
		"label":"Configure",
		"type":"invoke.function",
		"name":"cliqwidget",
		"id":"configuration"
		}
	},
	"active_tab":"homeTab"};

 

Web View

The web view typically loads a web page in an iFrame right inside the widget. 


return {
	"type":"applet",
	"data_type":"web_view",
	"tabs":[
	{"label":"Home","id":"homeTab"}
	],
	"web_view":{"url":"https://www.youtube-nocookie.com/embed/bdZWFptKlXM"},
	"active_tab":"homeTab"
};

 

Sections

Each tab is made up of sections. Simply put, a section is a combination of different elements, grouped together. 

Note:

Each tab can hold a maximum of 25 sections. 

Headers & Footers

Headers are fixed at the top of sections. There are two types of headers

  • Title - Used to display the title of the tab
  • Breadcrumbs - Indicates the naviagtional hierarchy and is useful to navigate across data.

Headers are used to display the headings of tabs. Both title and breadcrumbs can have a maximum of 3 buttons on the right.

Footers

Footers are fixed at the bottom of sections. They can hold text on the left and just like Headers, can also have a maximum of 3 buttons on the right.

Note:

Both Headers and Footers are supported only in sections view

Elements

Section elements are the building blocks of your Cliq widget. They provide the structure, carry the content and layout required to bring your widget to life, precisely! Cliq supports a wide variety of elements to present your content. 

Note:

Each section can hold a maximum of 20 elements.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocliq.com