SplitButton
SplitButton is a special type of MenuButton that splits the main action and sub actions.
Notes
The BitSplitButton is a Multi-API component which can accept the list of Items in 3 different ways: BitSplitButtonItem class, a custom Generic class, and BitSplitButtonOption component.Usage
Basic
IsSticky
Disabled item
OnClick
Component's OnClick:
Clicked item:
Item's OnClick:
Clicked item:
Style & Class
Component's Style & Class:
Item's Style & Class:
Styles & Classes:
Visibility
Visible: [
]
Hidden: [
]
Collapsed: [
]
ItemTemplate
Component's ItemTemplate:
Item's Template:
Controlled
Selected item: Delete
Changed item:
Implementation
BitSplitButton parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
AriaDescription | string? | null | Detailed description of the button for the benefit of screen readers. |
AriaHidden | bool | false | If true, add an aria-hidden attribute instructing screen readers to ignore the element. |
ButtonStyle | BitButtonStyle | BitButtonStyle.Primary | The style of button, Possible values: Primary | Standard. |
ButtonType | BitButtonType | BitButtonType.Button | The type of the button. |
ChevronDownIcon | string | ChevronDown | Icon name of the chevron down part of the BitSplitButton. |
ChildContent | RenderFragment? | null | The content of the BitSplitButton, that are BitSplitButtonOption components. |
Classes | BitSplitButtonClassStyles? | null | Custom CSS classes for different parts of the BitSplitButton. |
DefaultSelectedItem | TItem? | null | Default value of the SelectedItem. |
ItemTemplate | RenderFragment<TItem>? | null | The content inside the item can be customized. |
IsSticky | bool | false | If true, the current item is going to be change selected item. |
Items | IEnumerable<TItem> | new List<TItem>() | List of Item, each of which can be a Button with different action in the SplitButton. |
ItemTemplate | RenderFragment<TItem>? | null | The content inside the item can be customized. |
NameSelectors | BitSplitButtonNameSelectors<TItem>? | null | Names and selectors of the custom input type properties. |
OnClick | EventCallback<TItem> | The callback is called when the button or button item is clicked. | |
OnChange | EventCallback<TItem> | The callback that is called when the selected item has changed. | |
Options | RenderFragment? | null | Alias of ChildContent. |
SelectedItem | TItem? | null | Determines the current selected item that acts as the main button. |
Styles | BitSplitButtonClassStyles? | null | Custom CSS styles for different parts of the BitSplitButton. |
BitComponentBase parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
AriaLabel | string? | null | The aria-label of the control for the benefit of screen readers. |
Class | string? | null | Custom CSS class for the root element of the component. |
HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Capture and render additional attributes in addition to the component's parameters. |
Id | string? | null | Custom id attribute for the root element. if null the UniqueId will be used instead. |
IsEnabled | bool | true | Whether or not the component is enabled. |
Style | string? | null | Custom CSS style for the root element of the component. |
Visibility | BitVisibility | BitVisibility.Visible | Whether the component is visible, hidden or collapsed. |
BitComponentBase public members
Name |
Type |
Default value |
Description |
---|---|---|---|
UniqueId | Guid | Guid.NewGuid() | The readonly unique id of the root element. it will be assigned to a new Guid at component instance construction. |
RootElement | ElementReference | The ElementReference of the root element. |
BitSplitButtonClassStyles properties
Name |
Type |
Default value |
Description |
---|---|---|---|
Callout | string? | null | Custom CSS classes/styles for the callout container of the BitSplitButton. |
ChevronDown | string? | null | Custom CSS classes/styles for the chevron down of the BitSplitButton. |
ItemButton | string? | null | Custom CSS classes/styles for each item of the BitSplitButton. |
ItemIcon | string? | null | Custom CSS classes/styles for each item icon of the BitSplitButton. |
ItemText | string? | null | Custom CSS classes/styles for each item text of the BitSplitButton. |
Overlay | string? | null | Custom CSS classes/styles for each overlay of the BitSplitButton. |
BitSplitButtonNameSelectors properties
Name |
Type |
Default value |
Description |
---|---|---|---|
Class | BitNameSelectorPair<TItem, string?> | new(nameof(BitSplitButtonItem.Class)) | The CSS Class field name and selector of the custom input class. |
IconName | BitNameSelectorPair<TItem, string?> | new(nameof(BitSplitButtonItem.IconName)) | IconName field name and selector of the custom input class. |
IsEnabled | BitNameSelectorPair<TItem, bool> | new(nameof(BitSplitButtonItem.IsEnabled)) | IsEnabled field name and selector of the custom input class. |
Key | BitNameSelectorPair<TItem, string?> | new(nameof(BitSplitButtonItem.Key)) | Key field name and selector of the custom input class. |
OnClick | BitNameSelectorPair<TItem, Action<TItem>?> | new(nameof(BitSplitButtonItem.OnClick)) | OnClick field name and selector of the custom input class. |
Style | BitNameSelectorPair<TItem, string?> | new(nameof(BitSplitButtonItem.Style)) | Style field name and selector of the custom input class. |
Text | BitNameSelectorPair<TItem, string?> | new(nameof(BitSplitButtonItem.Text)) | Text field name and selector of the custom input class. |
BitNameSelectorPair properties
Name |
Type |
Default value |
Description |
---|---|---|---|
Name | string | Custom class property name. | |
Selector | Func<TItem, TProp?>? | Custom class property selector. |
BitVisibility enum
Name |
Value |
Description |
---|---|---|
Visible | 0 | The content of the component is visible. |
Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). |
Collapsed | 2 | The component is hidden (display:none). |