fluentui-blazor
fluentui-blazor copied to clipboard
Menu Button: Appearance Parameter
🙋 Feature Request
Can Menu button be updated to allow Appearance to be passed so it's not always accent?
There are several Appearance available: https://fluentui-blazor.net/button
The menu is linked to the button using Anchor.
<FluentButton>Button</FluentButton>
<FluentButton Appearance="Appearance.Accent">Accent</FluentButton>
<FluentButton Appearance="Appearance.Lightweight">Lightweight</FluentButton>
<FluentButton Appearance="Appearance.Outline">Outline</FluentButton>
<FluentButton Appearance="Appearance.Stealth">Stealth</FluentButton>
<FluentButton BackgroundColor="var(--highlight-bg)" Color="var(--info)">Colored</FluentButton>
<FluentButton Loading="@loading" OnClick="@StartLoadingAsync" Appearance="Appearance.Accent">Loading</FluentButton>
Hi,
Thanks, I know I can restyle a button, but your MenuButton component doesn't allow this for some reason? Why can't the appearance be passed here too rather than hard coded to Appearance.Accent?
<div class="fluent-menubutton-container">
<FluentButton @ref="Button" Appearance="Appearance.Accent" Style=@ButtonStyle aria-haspopup="true" aria-expanded="@_visible" @onclick=ToggleMenu @onkeydown=OnKeyDown>
@Text
<FluentIcon Value="@(new CoreIcons.Regular.Size24.ChevronDown())" Slot="end" Color="@Color.Fill" />
</FluentButton>
<FluentMenu @ref="Menu" aria-labelledby="button" Style="@MenuStyle" @bind-Open=@_visible @onmenuchange=OnMenuChangeAsync>
@foreach (KeyValuePair<string, string> item in Items)
{
<FluentMenuItem Id="@item.Key">@item.Value</FluentMenuItem>
}
</FluentMenu>
</div>
I could create my own version of a button and menu like your page but then why does MenuButton exist?
Oh. I hadn't understood that. Indeed it could be interesting