Skip to content

@jsvision/ui / topRight

Function: topRight()

topRight<V>(view, width, height): V

Defined in: ui/src/view/dsl.ts:408

Tag a view as a fixed-size stack layer pinned to the top-right corner.

Type Parameters

V

V extends View

Parameters

view

V

The layer view.

width

number

Fixed width in cells.

height

number

Fixed height in cells.

Returns

V

The same view, for inline chaining inside a stack(...).

Example

ts
import { stack, topRight } from '@jsvision/ui';

const screen = stack(canvas, topRight(badge, 5, 1));