forked from LumexUI/lumexui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKbd.razor
More file actions
61 lines (51 loc) · 1.86 KB
/
Kbd.razor
File metadata and controls
61 lines (51 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@page "/docs/components/kbd"
@layout DocsContentLayout
@using LumexUI.Docs.Client.Pages.Components.Kbd.PreviewCodes
<DocsSection Title="Usage">
<Usage />
<DocsSection Title="Keys">
<p>Use the <code>Keys</code> parameter to specify a single keyboard key or a combination of keys.</p>
<Keys />
</DocsSection>
</DocsSection>
<DocsSlotsSection Slots="@_slots">
<div>
<h4 class="font-semibold">Kbd</h4>
<ul>
<li><code>Class</code>: The basic CSS class name styles the wrapper of the kbd contents.</li>
<li><code>Classes</code>: The CSS class names for the kbd slots style the entire kbd at once.</li>
</ul>
</div>
</DocsSlotsSection>
<DocsApiSection Components="@_apiComponents" />
@code {
[CascadingParameter] private DocsContentLayout Layout { get; set; } = default!;
private readonly Heading[] _headings = new Heading[]
{
new("Usage", [
new("Keys")
]),
new("Custom Styles"),
new("API")
};
private readonly Slot[] _slots = new Slot[]
{
new(nameof( KbdSlots.Base ), "Kbd wrapper, it handles alignment, placement, and general appearance."),
new(nameof( KbdSlots.Abbr ), "The keys wrapper that handles the appearance of the keys."),
new(nameof( KbdSlots.Content ), "The children wrapper that handles the appearance of the content."),
};
private readonly string[] _apiComponents = new string[]
{
nameof( LumexKbd )
};
protected override void OnInitialized()
{
Layout.Initialize(
title: "Keyboard Key",
category: "Components",
description: "Keyboard key component for displaying keyboard shortcuts and input combinations.",
headings: _headings,
linksProps: new ComponentLinksProps( "Kbd", isServer: true )
);
}
}