Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.04 KB

File metadata and controls

36 lines (25 loc) · 1.04 KB
title KeyHints
parent Navigation and overlays
grand_parent Components

KeyHints

{: .no_toc }

The keys available right now, along one line.

import { KeyHints } from '@textui/widgets';

<KeyHints hints={[{ keys: 'q', label: 'quit' }, { keys: 'r', label: 'refresh' }]} />

Props

Prop Type Default
hints { keys: string; label: string }[] required
separator string

Plus everything on BoxProps.

A terminal UI has no menus to discover, so this is usually the only place a reader learns what the keys are. Keep it to the keys that work here - a hint line listing everything the application can do teaches nothing.

Commands registered with the hints slot can populate this from the registry rather than from a literal, which keeps the line honest as the screen changes.

See also