npm.io
11.1.0 • Published 1 month ago

@primereact/types

Licence
SEE LICENSE IN LICENSE.md
Version
11.1.0
Deps
0
Size
1.7 MB
Vulns
0
Weekly
0

Cover

@primereact/types

TypeScript definitions shared across PrimeReact: prop interfaces, instance shapes, Pass Through contracts and the core infrastructure types that @primereact/core, @primereact/headless, @primereact/styles and @primereact/ui are built on.

Every component already re-exports its own types, so a separate install is only needed to reference a type without pulling in the runtime, or to author a component against PrimeReact's contracts.

npm install -D @primereact/types

Usage

Per-component types live under @primereact/types/primitive/<name>, and the matching hook types under @primereact/types/headless/<name>.

import type { ButtonProps, ButtonInstance } from '@primereact/types/primitive/button';

Each component contributes a consistent set: Props extending BaseComponentProps, State for the exposed internal state, Instance for what a ref returns and what Pass Through functions receive, PassThrough with one entry per internal element, and ClassNames for the .p- names the styled layer emits.

BaseComponentProps combines the headless props, the global component props (unstyled, pt, ptOptions, as) and the intrinsic props of the rendered element. A component's prop interface extends it rather than restating any of them.

Documentation

License

Licensed under the PrimeUI License - Copyright (c) PrimeTek Informatics