You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-aspnet/html-helpers/navigation/tabstrip/tabs.md
+174Lines changed: 174 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -275,6 +275,180 @@ The following example showcases how to add a button element inside a specified t
275
275
```
276
276
{% endif %}
277
277
278
+
## Closable Tabs
279
+
280
+
Use the `Closable` property to create closable tabs in the {{site.framework}} TabStrip component. When enabled for the entire component, every tab shows a **close** icon which hides the tab from view and removes it from the TabStrip. You can also control the closable behavior individually by setting the `closable` option for the respective tab. The default value is `false`.
You can leverage the `Enable` property to specify whether a given tab should be enabled or disabled. Disabled tabs cannot be selected or focused and are displayed with a different visual style. The default value is `true`.
313
+
314
+
```HtmlHelper
315
+
@(Html.Kendo().TabStrip()
316
+
.Name("tabstrip")
317
+
.Items(tabstrip =>
318
+
{
319
+
tabstrip.Add().Text("Delete User (Disabled)")
320
+
.Icon("x-outline")
321
+
.Enabled(false)
322
+
.Content("Delete User Content");
323
+
})
324
+
.SelectedIndex(0)
325
+
)
326
+
```
327
+
{% if site.core %}
328
+
```TagHelper
329
+
<kendo-tabstrip name="tabstrip">
330
+
<items>
331
+
<tabstrip-item icon="x-outline" text="Delete User (Disabled)" enabled="false">
332
+
<content>
333
+
Delete User Content
334
+
</content>
335
+
</tabstrip-item>
336
+
</items>
337
+
</kendo-tabstrip>
338
+
```
339
+
{% endif %}
340
+
341
+
## Tabs Icons
342
+
343
+
The TabStrip component provides built-in icons for each of its tabs. The icon is rendered inside the tab element. You can use the name for an existing icon in a theme or SVG content. Check the [full list of Telerik icons](https://www.telerik.com/design-system/docs/foundation/iconography/icon-list/) for all the available icons.
344
+
345
+
Use the `IconPosition` property to set the position of the icon relative to the tab text. Possible values are "IconPosition.Before" and "IconPosition.After".
346
+
347
+
Use the `IconClass` setting to apply a custom CSS class to the icon element, allowing you to style it further.
Use the TabStrip `Actions` configuration to define a collection of action buttons that are rendered in the tab. The actions buttons are rendered as part of the tab and can be used to provide additional functionality beyond the built-in close button.
390
+
391
+
Each action can be further customized with icons, attributes and a handler function that will be executed when the action is clicked.
392
+
393
+
```HtmlHelper
394
+
@(Html.Kendo().TabStrip()
395
+
.Name("tabstrip")
396
+
.Items(tabstrip =>
397
+
{
398
+
tabstrip.Add().Text("Account")
399
+
.Icon("user-outline")
400
+
.Actions(actions =>
401
+
{
402
+
actions.Add().Icon("envelope").Action("sendMessage").HtmlAttributes(new { title = "Send Message" });
403
+
actions.Add().Icon("zoom-in").Action("zoomIn").HtmlAttributes(new { title = "Zoom In" });
404
+
actions.Add().Icon("zoom-out").Action("zoomOut").HtmlAttributes(new { title = "Zoom Out" });
0 commit comments