Skip to content

Commit de24423

Browse files
Gilles TOURREAUGillesTourreau
authored andcommitted
Add examples and documentation for the Persona component.
1 parent 45ce752 commit de24423

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="Kevin Sturgis"
2+
Status="PresenceStatus.Available"
3+
StatusSize="PresenceBadgeSize.Small"
4+
StatusTitle="He is available"
5+
Image="https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/office-ui-fabric-react-assets/persona-male.png"
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="Kevin Sturgis"
3+
Status="PresenceStatus.Available"
4+
StatusSize="PresenceBadgeSize.Small"
5+
StatusTitle="He is available"
6+
Image="https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/office-ui-fabric-react-assets/persona-male.png"
7+
ImageSize="50px"
8+
DismissTitle="Hide Kevin"
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
@@ -97,6 +97,7 @@
9797
<FluentNavLink Href="/Overflow" Icon="@(new Icons.Regular.Size20.MultiselectRtl())">Overflow</FluentNavLink>
9898
<FluentNavLink Href="/Overlay" Icon="@(new Icons.Regular.Size20.CursorHover())">Overlay</FluentNavLink>
9999
<FluentNavLink Href="/Panel" Icon="@(new Icons.Regular.Size20.PanelRight())">Panel</FluentNavLink>
100+
<FluentNavLink Href="/Persona" Icon="@(new Icons.Regular.Size20.PersonAvailable())">Persona</FluentNavLink>
100101
<FluentNavLink Href="/Popover" Icon="@(new Icons.Regular.Size20.TooltipQuote())">Popover</FluentNavLink>
101102
<FluentNavLink Href="/Progress" Icon="@(new Icons.Regular.Size20.SquareHint())">Progress</FluentNavLink>
102103
<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
@@ -163,6 +163,9 @@
163163
<li>
164164
<FluentAnchor Href="Panel" Appearance=Appearance.Neutral>Panel</FluentAnchor>
165165
</li>
166+
<li>
167+
<FluentAnchor Href="Persona" Appearance=Appearance.Neutral>Persona</FluentAnchor>
168+
</li>
166169
<li>
167170
<FluentAnchor Href="Popover" Appearance=Appearance.Neutral>Popover</FluentAnchor>
168171
</li>

examples/Demo/Shared/Shared/DemoNavMenuTree.razor

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

0 commit comments

Comments
 (0)