View
The fundamental layout primitive.
View has built in accessibility controls, enforces flexbox columns by default (and supports grid and float layout). Raw text nodes are not allowed as children or siblings of View, and no text-related styling is supported. A View nested within a Text will render inline without altering its display or that of its children. Accessibility props map directly to WAI-ARIA properties (excluding properties and values that are deprecated, redundant, or to be avoided).
import { View } from 'react-gui/view';
<View {...props} />;
API #
Props #
The children of a View
element can be other elements and must not include strings (or components that render down to strings).
Set whether the view can receive keyboard focus.
If href
is defined, the view is rendered as an anchor tag pointing to this URL.
If href
is defined, this prop defines related attributes to include on the anchor (e.g., download
, rel
, target
) which may modify its behavior.
Set the styles of the view.
Set the test selector label (via data-testid
).
Style #
…
Details #
Layout #
Flexbox column by default.
Content #
No text content.