Table of Contents

Class TwToggleGroupItem<T>

Namespace
TwBlazor.Components
Assembly
TwBlazor.dll

One option of a TwToggleGroup<T>, rendered as a TwToggle.

public class TwToggleGroupItem<T> : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent, IDisposable

Type Parameters

T

The type of the value the item stands for; inferred from the enclosing group.

Inheritance
TwToggleGroupItem<T>
Implements
Inherited Members

Remarks

The item takes its variant, size, rounding and pressed state from the group. An item that shows only an icon needs an AriaLabel.

Constructors

TwToggleGroupItem()

public TwToggleGroupItem()

Properties

ChildContent

Gets or sets custom content shown in the item in place of Label.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

Color

Gets or sets the color of this item while it is pressed, in place of the group's Color.

[Parameter]
public Color? Color { get; set; }

Property Value

Color?

Disabled

Gets or sets whether this item is disabled. Disabled items are skipped by the arrow keys.

[Parameter]
public bool Disabled { get; set; }

Property Value

bool

Icon

Gets or sets the icon shown before the label, or on its own for an icon-only item.

[Parameter]
public Icon? Icon { get; set; }

Property Value

Icon?

Label

Gets or sets the text shown in the item. Ignored when ChildContent is set.

[Parameter]
public string Label { get; set; }

Property Value

string

Tooltip

Gets or sets the text of a tooltip shown when the item is hovered or keyboard-focused.

[Parameter]
public string? Tooltip { get; set; }

Property Value

string

Value

Gets or sets the value the item stands for. The item is pressed while the group's value (or one of its values) equals it.

[Parameter]
[EditorRequired]
public T Value { get; set; }

Property Value

T

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

Dispose()

Removes the item from its group.

public void Dispose()

Dispose(bool)

Unregisters the item from its group.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

OnInitialized()

Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

protected override void OnInitialized()