docs v1.0.0

KeyboardShortcut

Returns BoxNamespace Bibui.Core.RuntimeSourceTheme tokens

A keyboard shortcut: a row of keycaps, each a small raised box with a border around one key's name. It takes nothing.

Preview
Verified render
keyboard-shortcut-chord
keyboard-shortcut-chord

Fixtures: keyboard-shortcut-chord and keyboard-shortcut-single.

Build

C#
public static Box Build(BibuiRuntime runtime, params ReadOnlySpan<string> keys)

public const float KeyHeight = 24f;
ParameterMeaning
keysOne keycap per key, in order, 4 px apart.

The row is as wide as its keycaps and 24 px tall.

Claims and reports

None. It returns a keyless Box.

State the caller owns

None.

Theme tokens

  • Keycap: a SurfaceRaised fill and a Border edge runtime.Theme.Borders.Width wide.
  • Key name: TextColor.Primary, at the small size.

Example

C#
using Bibui.Core;
using Bibui.Core.Runtime;

sealed class CommandPaletteHint
{
    const string Ctrl = "Ctrl";
    const string Shift = "Shift";
    const string P = "P";

    public UiNode Build(BibuiRuntime runtime) => KeyboardShortcut.Build(runtime, Ctrl, Shift, P);
}