Skip to content

Commit f13177e

Browse files
committed
docs(button): add demo for IconOnly parameter
1 parent f8e1b63 commit f13177e

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

docs/LumexUI.Docs.Client/Common/Navigation/NavigationStore.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class NavigationStore
2525
.Add( new( nameof( LumexAlert ), PageStatus.New ) )
2626
.Add( new( nameof( LumexAvatar ), PageStatus.New ) )
2727
.Add( new( nameof( LumexBadge ), PageStatus.New ) )
28-
.Add( new( nameof( LumexButton ) ) )
28+
.Add( new( nameof( LumexButton ), PageStatus.Updated ) )
2929
.Add( new( nameof( LumexCard ) ) )
3030
.Add( new( nameof( LumexCheckbox ) ) )
3131
.Add( new( nameof( LumexCheckboxGroup ) ) )

docs/LumexUI.Docs.Client/Pages/Components/Button/Button.razor

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
Customize the appearance of the button by applying
3737
different colors that suit your application's theme and design.
3838
</p>
39-
<LumexUI.Docs.Client.Pages.Components.Button.PreviewCodes.Colors />
39+
<Colors />
4040
</DocsSection>
4141

4242
<DocsSection Title="Variants">
@@ -54,6 +54,14 @@
5454
</p>
5555
<WithIcons />
5656
</DocsSection>
57+
58+
<DocsSection Title="Icon Only">
59+
<p>
60+
You can also display a button without text by passing the <Code>IconOnly</Code>
61+
parameter and the desired icon as <Code>ChildContent</Code>.
62+
</p>
63+
<IconOnly />
64+
</DocsSection>
5765
</DocsSection>
5866

5967
<DocsSection Title="Custom Styles">
@@ -78,6 +86,7 @@
7886
new("Colors"),
7987
new("Variants"),
8088
new("Icons"),
89+
new("Icon Only"),
8190
]),
8291
new("Custom Styles"),
8392
new("API")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="flex items-center gap-4">
2+
<LumexButton IconOnly="@true" Color="@ThemeColor.Danger">
3+
<LumexIcon Icon="@Icons.Rounded.Favorite" />
4+
</LumexButton>
5+
<LumexButton IconOnly="@true" Color="@ThemeColor.Warning">
6+
<LumexIcon Icon="@Icons.Rounded.PhotoCamera" />
7+
</LumexButton>
8+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@rendermode InteractiveWebAssembly
2+
3+
<PreviewCode Code="@new(name: null, snippet: "Button.Code.IconOnly")">
4+
<LumexUI.Docs.Client.Pages.Components.Button.Examples.IconOnly />
5+
</PreviewCode>
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
1-
@using LumexUI.Services
2-
3-
@inject IPopoverService PopoverService
4-
5-
<LumexButton OnClick="@TriggerAsync"
6-
data-popoverref="@_popoverId">
7-
Open Popover
8-
</LumexButton>
9-
10-
<LumexPopover Id="@_popoverId">
1+
<LumexPopover>
2+
<LumexPopoverTrigger>
3+
<LumexButton>Open Popover</LumexButton>
4+
</LumexPopoverTrigger>
115
<LumexPopoverContent>
126
<div class="px-1 py-2">
137
<div class="text-small font-bold">Oh, hi there!</div>
148
<div class="text-tiny">I am the popover content</div>
159
</div>
1610
</LumexPopoverContent>
17-
</LumexPopover>
18-
19-
@code {
20-
private string _popoverId = "popover-usage";
21-
22-
private Task TriggerAsync()
23-
{
24-
return PopoverService.TriggerAsync(_popoverId);
25-
}
26-
}
11+
</LumexPopover>

0 commit comments

Comments
 (0)