Button Group

A button group component is a visual group of buttons used to create a logical set of actions.

Active

In order to manage an active state, add IsActive props on a button.

TypeDefault Value
boolfalse
<NVButtonGroup>
  <NVButton IsActive="@(_currentState == "sun")" OnClick="@(() => _currentState = "sun")" Icon="sun" />
  <NVButton IsActive="@(_currentState == "moon")" OnClick="@(() => _currentState = "moon")" Icon="moon" />
  <NVButton IsActive="@(_currentState == "devices")" OnClick="@(() => _currentState = "devices")" Icon="devices" />
</NVButtonGroup>

@code {
  private String _currentState = "sun";
}

Combination

You can combine button, dropdown and FieldCheck within the FiedGroup.

Checkbox

Combination of Button and Checkbox.

<NVButtonGroup Vertical>
  <NVFieldCheckbox Color="gray-400" @bind-Value="_value" />
  <NVButton Color="gray">Action 1 </NVButton>
</NVButtonGroup>

Parameters

Vertical

Vertical change the direction of the layout direction to vertical.

TypeDefault Value
boolfalse
<NVButtonGroup Vertical>
  <NVButton Icon="sun" />
  <NVButton Icon="moon" />
  <NVButton Icon="devices" />
</NVButtonGroup>