Skip to content

Commit

Permalink
add IconOnly parameter to BitActionButton #8740
Browse files Browse the repository at this point in the history
  • Loading branch information
msynk committed Sep 26, 2024
1 parent 3443cd2 commit c5e6b8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
<i style="@Styles?.Icon" class="bit-acb-ico bit-icon bit-icon--@IconName @Classes?.Icon" />
}
@if (ChildContent is not null)
@if (ChildContent is not null && IconOnly is false)
{
<div style="@Styles?.Content" class="bit-acb-con @Classes?.Content">
@ChildContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public partial class BitActionButton : BitComponentBase
/// </summary>
[Parameter] public string? IconName { get; set; }

/// <summary>
/// Removes the container of the text and only renders the icon.
/// </summary>
[Parameter] public bool IconOnly { get; set; }

/// <summary>
/// The callback for the click event of the button.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ public partial class BitActionButtonDemo
Description = "The icon name of the icon to render inside the button.",
},
new()
{
Name = "IconOnly",
Type = "bool",
DefaultValue = "null",
Description = "Removes the container of the text and only renders the icon.",
},
new()
{
Name = "OnClick",
Type = "EventCallback<MouseEventArgs>",
Expand Down

0 comments on commit c5e6b8e

Please sign in to comment.