Use an Image instead of a text in the BarBrand and make it disappear with the Toggle in the Sidebar component. #5134
Unanswered
michele-bettin
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Maybe bind the Bar to a variable and then use it to conditionally show or hide image? <Bar @bind-Visible="@barVisible " Breakpoint="Breakpoint.Desktop" NavigationBreakpoint="Breakpoint.Tablet" ThemeContrast="ThemeContrast.Dark"
Mode="BarMode.VerticalInline" CollapseMode="BarCollapseMode.Small" style="width: 30%;">
<BarToggler />
<BarBrand>
<BarItem>
<BarLink To="">
@if ( barVisible )
{
<Image Source="/ScrittaStatTradeTagliata-transformed.png" Style="width:150px; height: 45px" />
}
else
{
<BarIcon IconName="customIcon" />
}
App Name
</BarLink>
</BarItem>
</BarBrand>
</Bar
@code{
bool barVisible = true;
} |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi guys! Does someone know how to use an image instead of a normal text on the BarBrand and make it disappear when I press the
<BarToggler />
. I have provided a little example to explain the scenario.I would like the BarIcon to remain in the collapsed lateral bar, but the image obviously not beacause it is too big. But in my scenario both of the them reamin in the collapsed bar.
@David-Moreira @stsrki Any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions