Skip to content

Commit a88d671

Browse files
GillesTourreauGilles TOURREAU
andauthored
Add examples and documentation for the Persona component. (#843)
* Add examples and documentation for the Persona component. * Fix the Persona samples to use "@DataSource.SamplePicture" instead of using external resources. --------- Co-authored-by: Gilles TOURREAU <[email protected]>
1 parent 16620e1 commit a88d671

File tree

8 files changed

+76
-0
lines changed

8 files changed

+76
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<FluentPersona Name="Bill Gates"
2+
Status="PresenceStatus.Available"
3+
StatusSize="PresenceBadgeSize.Small"
4+
StatusTitle="He is available"
5+
Image="@DataSource.SamplePicture"
6+
ImageSize="50px">
7+
</FluentPersona>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<div hidden="@this.Hidden">
2+
<FluentPersona Name="Bill Gates"
3+
Status="PresenceStatus.Available"
4+
StatusSize="PresenceBadgeSize.Small"
5+
StatusTitle="He is available"
6+
Image="@DataSource.SamplePicture"
7+
ImageSize="50px"
8+
DismissTitle="Hide Bill"
9+
OnDismissClick="@this.Dismiss">
10+
</FluentPersona>
11+
</div>
12+
13+
@code {
14+
private bool Hidden { get; set; }
15+
16+
private void Dismiss()
17+
{
18+
this.Hidden = true;
19+
}
20+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<FluentPersona Name="Lydia Bauer"
2+
ImageSize="50px"
3+
Initials="LY">
4+
</FluentPersona>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<FluentPersona Name="Lydia Bauer"
2+
ImageSize="50px"
3+
Status="PresenceStatus.Busy"
4+
StatusSize="PresenceBadgeSize.Small">
5+
</FluentPersona>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@page "/Persona"
2+
@using FluentUI.Demo.Shared.Pages.Persona.Examples
3+
4+
<h1>Persona</h1>
5+
<p>A Persona is a visual representation of a person with an avatar. A status can be specified optionally.</p>
6+
7+
<h2>Examples</h2>
8+
<DemoSection Title="Default" Component="typeof(PersonaDefault)">
9+
<Description>
10+
Display a person with his avatar and his status.
11+
</Description>
12+
</DemoSection>
13+
14+
<DemoSection Title="With no image (Default initials)" Component="typeof(PersonaNoImage)">
15+
<Description>
16+
If no image is specified, the initials of the person is automatically retrieved.
17+
</Description>
18+
</DemoSection>
19+
20+
<DemoSection Title="With no image (Specific initials)" Component="typeof(PersonaInitials)">
21+
<Description>
22+
Explicit initials for the person can be defined with the <code>Initials</code> property.
23+
</Description>
24+
</DemoSection>
25+
26+
<DemoSection Title="Dismiss action" Component="typeof(PersonaDismiss)">
27+
<Description>
28+
Display a "Dismiss" cross and raise an event.
29+
</Description>
30+
</DemoSection>
31+
32+
<h2>API Documentation</h2>
33+
<ApiDocumentation Component="typeof(FluentPersona)" />
34+
35+

examples/Demo/Shared/Shared/DemoNavMenu.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
<FluentNavLink Href="/Overflow" Icon="@(new Icons.Regular.Size20.MultiselectRtl())">Overflow</FluentNavLink>
9797
<FluentNavLink Href="/Overlay" Icon="@(new Icons.Regular.Size20.CursorHover())">Overlay</FluentNavLink>
9898
<FluentNavLink Href="/Panel" Icon="@(new Icons.Regular.Size20.PanelRight())">Panel</FluentNavLink>
99+
<FluentNavLink Href="/Persona" Icon="@(new Icons.Regular.Size20.PersonAvailable())">Persona</FluentNavLink>
99100
<FluentNavLink Href="/Popover" Icon="@(new Icons.Regular.Size20.TooltipQuote())">Popover</FluentNavLink>
100101
<FluentNavLink Href="/Progress" Icon="@(new Icons.Regular.Size20.SquareHint())">Progress</FluentNavLink>
101102
<FluentNavLink Href="/ProgressRing" Icon="@(new Icons.Regular.Size20.ArrowClockwiseDashes())">Progress Ring</FluentNavLink>

examples/Demo/Shared/Shared/DemoNavMenuList.razor

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@
160160
<li>
161161
<FluentAnchor Href="Panel" Appearance=Appearance.Neutral>Panel</FluentAnchor>
162162
</li>
163+
<li>
164+
<FluentAnchor Href="Persona" Appearance=Appearance.Neutral>Persona</FluentAnchor>
165+
</li>
163166
<li>
164167
<FluentAnchor Href="Popover" Appearance=Appearance.Neutral>Popover</FluentAnchor>
165168
</li>

examples/Demo/Shared/Shared/DemoNavMenuTree.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<FluentNavMenuLink Href="/Overflow" Icon="@(new Icons.Regular.Size20.MultiselectRtl())" Text="Overflow" />
8282
<FluentNavMenuLink Href="/Overlay" Icon="@(new Icons.Regular.Size20.CursorHover())" Text="Overlay" />
8383
<FluentNavMenuLink Href="/Panel" Icon="@(new Icons.Regular.Size20.PanelRight())" Text="Panel" />
84+
<FluentNavMenuLink Href="/Persona" Icon="@(new Icons.Regular.Size20.PersonAvailable())" Text="Persona" />
8485
<FluentNavMenuLink Href="/Popover" Icon="@(new Icons.Regular.Size20.TooltipQuote())" Text="Popover" />
8586
<FluentNavMenuLink Href="/Progress" Icon="@(new Icons.Regular.Size20.SquareHint())" Text="Progress" />
8687
<FluentNavMenuLink Href="/ProgressRing" Icon="@(new Icons.Regular.Size20.ArrowClockwiseDashes())" Text="Progress Ring" />

0 commit comments

Comments
 (0)