https://github.com/nickshiro/bind-props
type-safety functional component props binding
https://github.com/nickshiro/bind-props
biome bun npm-package react solid turbo
Last synced: about 2 months ago
JSON representation
type-safety functional component props binding
- Host: GitHub
- URL: https://github.com/nickshiro/bind-props
- Owner: nickshiro
- Created: 2025-07-14T12:11:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-14T13:17:22.000Z (11 months ago)
- Last Synced: 2025-10-14T10:27:25.822Z (8 months ago)
- Topics: biome, bun, npm-package, react, solid, turbo
- Language: TypeScript
- Homepage:
- Size: 190 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React example
```tsx
import type { FC } from "react";
import clsx from "clsx";
import bindProps from "bind-props-react";
interface ButtonProps {
color: "red" | "blue";
onClick: () => void;
}
const Button: FC = ({ color, ...props }) => {
const classes = clsx(
"rounded-lg",
color === "red" ? "bg-red-200" : "bg-blue-200"
);
return ;
};
const RedButton = bindProps(Button, { color: "red" });
export const App = () => {
return (
console.log("Red button clicked!")} />
);
};
```