@bosh-code/preact-slot
v1.3.1
Published
A Preact implementation of @radix-ui/react-slot.
Maintainers
Readme
@bosh-code/preact-slot
A Preact implementation of the @radix-ui/react-slot component meant for use with shadcn/ui component library. This component exposes the same API as the Radix UI Slot, and should be a drop-in replacement when building Preact component libraries using shadcn/ui components.
Installation
Install the package
pnpm add --save-peer @bosh-code/preact-slotUsage
I recommend setting up a path alias for @radix-ui/react-slot to point to this package, so that no changes are made to
any shadcn/ui components that you may be using in your library.
// tsconfig.json
{
"compilerOptions": {
// ...
"paths": {
"@radix-ui/react-slot": [
"./node_modules/@bosh-code/preact-slot"
]
}
}
}Development
- Install dependencies:
pnpm install- Run the playground:
pnpm playground- Build the library:
pnpm build- Build in watch mode:
pnpm dev- Run the unit tests:
pnpm test