ActionButton

ActionButton is a special type of button with a specific set of visual styles and properties.

Usage

Basic



Href
Use BitActionButton as a hyperlink to external URLs, opening either in a new tab or the same tab.

Rel
Color
Demonstrates BitActionButton with various predefined colors: Primary, Secondary, Tertiary, Info, Success, Warning, SevereWarning, and Error.



















Size
Show BitActionButton in different sizes: Small, Medium, and Large.

Style & Class
Customize the appearance of BitActionButton using styles and CSS classes.

Template
Add custom template within BitActionButton.

Button Type
Use BitActionButton within a form and validate its state.



RTL
Use BitActionButton in right-to-left (RTL).

API

BitActionButton parameters
Name
Type
Default value
Description
AllowDisabledFocus bool false Whether the button can have focus in disabled mode.
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 button.
ButtonType BitButtonType null The type html attribute of the button element.
ChildContent RenderFragment? null The content of the button.
Classes BitActionButtonClassStyles? null Custom CSS classes for different parts of the button.
Color BitColor? null The general color of the button.
FullWidth bool false Renders the action button in full width of its container with flex-start.
Href string? null The value of the href attribute of the link rendered by the button. If provided, the component will be rendered as an anchor tag instead of button.
IconName string? null The icon name of the icon to render inside the button.
IconOnly bool null Removes the container of the text and only renders the icon.
OnClick EventCallback<MouseEventArgs> The callback for the click event of the button.
Styles BitActionButtonClassStyles? null Custom CSS styles for different parts of the button.
ReversedIcon bool false Reverses the positions of the icon and the content of the button.
Rel BitLinkRel? null If Href provided, specifies the relationship between the current document and the linked document.
Size BitSize? null The size of the button.
Target string? null Specifies target attribute of the link when the button renders as an anchor (by providing the Href parameter).
Title string? null The tooltip to show when the mouse is placed on the button.
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.
Dir BitDir? null Determines the component direction.
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.
BitActionButtonClassStyles properties
Name
Type
Default value
Description
Root string? null Custom CSS classes/styles for the root element of the BitActionButton.
Icon string? null Custom CSS classes/styles for the Icon of the BitActionButton.
Content string? null Custom CSS classes/styles for the content of the BitActionButton.
BitButtonType enum
Name
Value
Description
Button 0 The button is a clickable button.
Submit 1 The button is a submit button (submits form-data).
Reset 2 The button is a reset button (resets the form-data to its initial values).
BitColor enum
Name
Value
Description
Primary 0 Info Primary general color.
Secondary 1 Secondary general color.
Tertiary 2 Tertiary general color.
Info 3 Info general color.
Success 4 Success general color.
Warning 5 Warning general color.
SevereWarning 6 SevereWarning general color.
Error 7 Error general color.
PrimaryBackground 8 Primary background color.
SecondaryBackground 9 Secondary background color.
TertiaryBackground 10 Tertiary background color.
PrimaryForeground 11 Primary foreground color.
SecondaryForeground 12 Secondary foreground color.
TertiaryForeground 13 Tertiary foreground color.
PrimaryBorder 14 Primary border color.
SecondaryBorder 15 Secondary border color.
TertiaryBorder 16 Tertiary border color.
BitSize enum
Name
Value
Description
Small 0 The small size button.
Medium 1 The medium size button.
Large 2 The large size button.
BitLinkRel enum
Name
Value
Description
Alternate 1 Provides a link to an alternate representation of the document. (i.e. print page, translated or mirror)
Author 2 Provides a link to the author of the document.
Bookmark 4 Permanent URL used for bookmarking.
External 8 Indicates that the referenced document is not part of the same site as the current document.
Help 16 Provides a link to a help document.
License 32 Provides a link to licensing information for the document.
Next 64 Provides a link to the next document in the series.
NoFollow 128 Links to an unendorsed document, like a paid link. ("NoFollow" is used by Google, to specify that the Google search spider should not follow that link)
NoOpener 256 Requires that any browsing context created by following the hyperlink must not have an opener browsing context.
NoReferrer 512 Makes the referrer unknown. No referrer header will be included when the user clicks the hyperlink.
Prev 1024 The previous document in a selection.
Search 2048 Links to a search tool for the document.
Tag 4096 A tag (keyword) for the current document.
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).
BitDir enum
Name
Value
Description
Ltr 0 Ltr (left to right) is to be used for languages that are written from the left to the right (like English).
Rtl 1 Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic).
Auto 2 Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element.
  • On this page