File: README.md

package info (click to toggle)
node-yarnpkg 4.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,752 kB
  • sloc: javascript: 38,953; ansic: 26,035; cpp: 7,247; sh: 2,829; makefile: 724; perl: 493
file content (21 lines) | stat: -rw-r--r-- 666 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# `@yarnpkg/libui`

This library is used to power parts of the UI in our interactive plugins.

## Components

### `Application`

A component that setups the state.

### `<ScrollableItems size={number} children={ReactEle}/>`

A scrollable container which will display at most `2 * size + 1` lines of result on screen and will watch the up and down keys to scroll.

**Note:** The current implementation only supports children with an explicit `key` parameter and a height of exactly 1 row.

## Hooks

### `useListItems`

A key listener that watches for two keys (configurable through `minus` and `plus`) and triggers the `set` callback when either of them is pressed.