Tabs
A row of triggers that switches between panels.
Installation
bash
shellui-native add tabs
Platforms: MAUI · Avalonia. Also installs element-extensions, tabs-list, tabs-trigger, tabs-content.
Usage
Basic
Account
Make changes to your account here.
<ui:Tabs Value="account">
<ui:TabsList>
<ui:TabsTrigger Value="account" Text="Account" />
<ui:TabsTrigger Value="password" Text="Password" />
</ui:TabsList>
<ui:TabsContent Value="account">
<ui:Card>
<ui:CardHeader Title="Account" Description="Make changes to your account here." />
<ui:CardContent><ui:Input Text="Shewart Shepherd" /></ui:CardContent>
</ui:Card>
</ui:TabsContent>
<ui:TabsContent Value="password">
<ui:Card>
<ui:CardHeader Title="Password" Description="Change your password here." />
<ui:CardContent><ui:Input Placeholder="New password" IsPassword="True" /></ui:CardContent>
</ui:Card>
</ui:TabsContent>
</ui:Tabs><ui:Tabs Value="account">
<ui:TabsList>
<ui:TabsTrigger Value="account" Text="Account" />
<ui:TabsTrigger Value="password" Text="Password" />
</ui:TabsList>
<ui:TabsContent Value="account">
<ui:Card>
<ui:CardHeader Title="Account" Description="Make changes to your account here." />
<ui:CardContent><ui:Input Text="Shewart Shepherd" /></ui:CardContent>
</ui:Card>
</ui:TabsContent>
<ui:TabsContent Value="password">
<ui:Card>
<ui:CardHeader Title="Password" Description="Change your password here." />
<ui:CardContent><ui:Input Placeholder="New password" IsPassword="True" /></ui:CardContent>
</ui:Card>
</ui:TabsContent>
</ui:Tabs>Not available on yet
MAUI and Avalonia
On Avalonia, Left and Right also move between the tabs of a focused tab list.
API
Tabs
| Property | Type | Default | Description |
|---|---|---|---|
Value |
string |
— | Value of the active tab. Two-way bindable. |
| Event | Arguments | Description |
|---|---|---|
ValueChanged |
(string Old, string New) |
(oldValue, newValue) User input only: setting Value from code or a binding doesn't raise it. |
| Method | Description |
|---|---|
SetValue(string value) |
Selects the item with this value. |
TabsList
XAML children go to Items on Avalonia and Children on MAUI.
No properties of its own.
TabsTrigger
| Property | Type | Default | Description |
|---|---|---|---|
Value |
string |
— | Value of the panel it shows. |
Text |
string |
— | Text shown by the component. |
TabsContent
XAML children go to Content.
| Property | Type | Default | Description |
|---|---|---|---|
Value |
string |
— | Shown while the tabs' value matches. |