|
| 1 | +--- |
| 2 | +title: Action Buttons |
| 3 | +page_title: Kendo UI for jQuery ActionSheet Documentation - Action Buttons |
| 4 | +description: "Get started with the Kendo UI for jQuery ActionSheet and learn about its action buttons orientation options." |
| 5 | +slug: actionbuttons_orientation_actionsheet_widget |
| 6 | +position: 4 |
| 7 | +--- |
| 8 | + |
| 9 | +# Action Buttons |
| 10 | + |
| 11 | +Starting with the 2025 Q2 release, the ActionSheet allows configuring the orientation and layout of the action buttons. |
| 12 | + |
| 13 | +## Orientation |
| 14 | + |
| 15 | +By default, the ActionSheet component displays the action buttons in `horizontal` orientation, but also allows you to set their visualization to `vertical`. You can control this behavior with the [`actionButtonsOrientation`](/api/javascript/ui/actionsheet/configuration/actionbuttonsorientation) configuration option. |
| 16 | + |
| 17 | +To configure the orientation of the action buttons, set the `actionButtonsOrientation` option to one of the following values: |
| 18 | + |
| 19 | +* `vertical` |
| 20 | +* `horizontal` |
| 21 | + |
| 22 | +The example below demonstrates the action buttons appearance in both `horizontal` and `vertical` modes. |
| 23 | + |
| 24 | +```dojo |
| 25 | + <div> |
| 26 | + <label for="orientation">Orientation:</label> |
| 27 | + <select id="orientation"> |
| 28 | + <option value="vertical">vertical</option> |
| 29 | + <option value="horizontal">horizontal</option> |
| 30 | + </select> |
| 31 | + </div> |
| 32 | + |
| 33 | +
|
| 34 | + <button id="open">Open Actionsheet</button> |
| 35 | + <div id="actionsheet"></div> |
| 36 | + <script> |
| 37 | + var actionsheet = $('#actionsheet').kendoActionSheet({ |
| 38 | + title: 'Select item', |
| 39 | + actionButtonsOrientation: 'vertical', |
| 40 | + actionButtons: [ |
| 41 | + { |
| 42 | + icon: "check", |
| 43 | + fillMode: "solid", |
| 44 | + themeColor: "primary", |
| 45 | + rounded: "full", |
| 46 | + size: "large", |
| 47 | + text: "Confirm" |
| 48 | + }, |
| 49 | + { |
| 50 | + icon: "x", |
| 51 | + fillMode: "flat", |
| 52 | + size: "large", |
| 53 | + text: "Close" |
| 54 | + } |
| 55 | + ] |
| 56 | + }).data('kendoActionSheet'); |
| 57 | +
|
| 58 | + $('#open').kendoButton({ |
| 59 | + themeColor: 'primary', |
| 60 | + click: function(){ |
| 61 | + actionsheet.open(); |
| 62 | + } |
| 63 | + }) |
| 64 | +
|
| 65 | + $("#orientation").kendoDropDownList({ |
| 66 | + change: function(e){ |
| 67 | + actionsheet.setOptions({ |
| 68 | + actionButtonsOrientation: $("#orientation").val() |
| 69 | + }); |
| 70 | + } |
| 71 | + }); |
| 72 | + </script> |
| 73 | +``` |
| 74 | + |
| 75 | +## Alignment |
| 76 | + |
| 77 | +The ActionSheet component supports multiple types of [`actionButtonsAlignment`](/api/javascript/ui/actionsheet/configuration/actionbuttonsalignment). By default, the action buttons are rendered `stretched`. This alignment of the action buttons works only when the `actionButtonsOrientation` is set to `horizontal` mode. The supported values are: |
| 78 | + |
| 79 | +* `stretched` |
| 80 | +* `justify` |
| 81 | +* `start` |
| 82 | +* `center` |
| 83 | +* `end` |
| 84 | + |
| 85 | +The example below demonstrates all alignments: |
| 86 | + |
| 87 | +```dojo |
| 88 | + <div> |
| 89 | + <label for="alignment">Alignment:</label> |
| 90 | + <select id="alignment"> |
| 91 | + <option value="start">start</option> |
| 92 | + <option value="end" >end</option> |
| 93 | + <option value="center">center</option> |
| 94 | + <option value="stretched" selected="true">stretched</option> |
| 95 | + <option value="justify">justify</option> |
| 96 | + </select> |
| 97 | + </div> |
| 98 | +
|
| 99 | + <div id="actionsheet"></div> |
| 100 | + <script> |
| 101 | + var actionsheet = $('#actionsheet').kendoActionSheet({ |
| 102 | + title: 'Select item', |
| 103 | + items: [ |
| 104 | + { |
| 105 | + text: 'Add to Favorites', |
| 106 | + iconClass: 'k-i-heart', |
| 107 | + } |
| 108 | + ], |
| 109 | + actionButtons: [ |
| 110 | + { |
| 111 | + icon: "check", |
| 112 | + fillMode: "solid", |
| 113 | + themeColor: "primary", |
| 114 | + rounded: "full", |
| 115 | + size: "large", |
| 116 | + text: "Confirm" |
| 117 | + }, |
| 118 | + { |
| 119 | + icon: "x", |
| 120 | + fillMode: "flat", |
| 121 | + size: "large", |
| 122 | + text: "Close" |
| 123 | + } |
| 124 | + ] |
| 125 | + }).data('kendoActionSheet'); |
| 126 | +
|
| 127 | +
|
| 128 | + $("#alignment").kendoDropDownList({ |
| 129 | + change: function(){ |
| 130 | + actionsheet.setOptions({ |
| 131 | + actionButtonsAlignment: $("#alignment").val() |
| 132 | + }); |
| 133 | + actionsheet.open(); |
| 134 | + } |
| 135 | + }); |
| 136 | + </script> |
| 137 | +``` |
| 138 | + |
| 139 | +## See Also |
| 140 | + |
| 141 | +* [Orientation of the ActionSheet (Demo)](https://demos.telerik.com/kendo-ui/actionsheet/orientation) |
| 142 | +* [JavaScript API Reference of the ActionSheet](/api/javascript/ui/actionsheet) |
0 commit comments