ToolJet/docs/versioned_docs/version-2.68.0/widgets/button-group.md
Aman Regu bdfe3270e2
[docs]: v2.68.0-Beta (#10755)
* docs: jira

* docs: formatting + Client Credentials grant type

* docs: connection string pgsql

* docs: parameterized queries mysql

* docs: parameterized queries in PostgreSQL

* docs: update mysql example

* docs: TJDB sql editor

* docs: add metadata to REST API

* docs: add, update  postgresql media

* docs: add metadata to graphql

* docs: update parameterized queries

* docs: add parameterized queries for mssql

* docs: add SSL Cert to mysql

* docs: TJDB SQL restricted commands

* docs: update JIRA token location

* docs: update delete issue example

* docs: update find user by query example

* docs: remove session id from get assignable users

* docs: use correct image for get issues for board

* docs: update create issue example

* docs: update delete issue media

* docs: update assignable users media

* docs: update examples

* docs: update key desc

* docs: v2.68.0-Beta
2024-09-13 19:23:19 +05:30

5.8 KiB

id title
button-group Button Group

Button Group

The Button Group component is used to group a series of buttons together in a single line. It is used to group related buttons.

<img style={{ border:'0', marginBottom:'15px', borderRadius:'5px', boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.2)' }} className="screenshot-full" src="/img/widgets/button-group/buttongroup1.png" alt="Button group" />

Properties

<div style={{ width:"100px"}}> Properties <div style={{ width:"100px"}}> Description <div style={{ width:"135px"}}> Expected Value
label Sets the title of the button-group. Any String value: Select the options or {{queries.queryname.data.text}}
values Sets the values of the Button Group items. Array of strings and numbers: {{[1,2,3]}}
Labels Sets the labels of the Button Group items. Array of strings and numbers: {{['A','B','C']}}
Default selected Sets the initial selected values. Array of strings and numbers: {{[1]}} will select the first button by default.
Enable multiple selection Toggle on or off to enable multiple selection. Boolean value: {{true}} or {{false}}

Events

Events are actions that can be triggered programmatically when the user interacts with the component. Click on the component handle to open its properties on the right. Go to the Events accordion and click on + Add handler.

<div style={{ width:"100px"}}> Events <div style={{ width:"100px"}}> Description
On click This event is triggered when the user clicks on the button in the Button Group.

:::info Check Action Reference docs to get the detailed information about all the Actions. :::

Component Specific Actions (CSA)

There are currently no CSA (Component-Specific Actions) implemented to regulate or control the button-group component.

Exposed Variables

<div style={{ width:"100px"}}> Variable <div style={{ width:"200px"}}> Description <div style={{ width:"135px"}}> How To Access
selected If the enable multiple selection option is turned off, then the variable is an array of objects, and the first object holds the value of the selected button. However, if it is turned on, the variable type changes from an array to an object, and the selected button values are stored as a string within that object. Access the value using {{components.buttongroup1.selected[0]}} or {{components.buttongroup1.selected}}

General

Tooltip

A Tooltip is often used to display additional information when the user hovers the mouse pointer over the component. Once a value is set for Tooltip, hovering over the element will display the specified string as the tooltip text.

<img style={{ border:'0', marginBottom:'15px', borderRadius:'5px', boxShadow: '0px 1px 3px rgba(0, 0, 0, 0.2)' }} className="screenshot-full" src="/img/widgets/button-group/grouptooltip.png" alt="Button group layout" />

Layout

<div style={{ width:"100px"}}> Layout <div style={{ width:"100px"}}> Description
Desktop Toggle to show or hide the component in the desktop view. Dynamically configure the value by clicking on Fx and entering a logical expression that results in either true or false. Alternatively, the values can be set to {{true}} or {{false}}.
Mobile Toggle to show or hide the component in the desktop view. Dynamically configure the value by clicking on Fx and entering a logical expression that results in either true or false. Alternatively, the values can be set to {{true}} or {{false}}.

Styles

<div style={{ width:"135px"}}> Style <div style={{ width:"100px"}}> Description <div style={{ width:"135px"}}> Expected Value
Background color Set a background color for the buttons in buttons group. Choose a color from the picker or enter the Hex color code. ex: #000000
Text color Set a text color for the buttons in buttons group. Choose a color from the picker or enter the Hex color code. ex: #000000
Visibility Make the component visible or hidden. {{true}} or {{false}}, By default, its value is set to {{true}}
Disable Disable the component. {{true}} or {{false}}, By default, its value is set to {{false}}
Border radius Add a border radius to the buttons in the component using this property. Any numerical value from 0 to 100
Selected text color Use this property to modify the text color of selected button Choose a color from the picker or enter the Hex color code. ex: #000000
Selected background color Use this property to modify the background color of selected button Choose a color from the picker or enter the Hex color code. ex: #000000
Box shadow Sets the add shadow effects around a component's frame. You can specify the horizontal and vertical offsets(through X and Y sliders), blur and spread radius, and color of the shadow. Values that represent X, Y, blur, spread, and color. Example: `9px 11px 5px 5px #00000040``