Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fresh/plugins/twindv1_deps.ts>PropsOf

The next-gen web framework.
Extremely Popular
Go to Latest
type alias PropsOf
import { type PropsOf } from "https://deno.land/x/fresh@1.5.1/plugins/twindv1_deps.ts";

Allows to extract the supported properties of a style function.

Here is an example for react

import { HTMLAttributes } from "react";
import { style, PropsOf } from "@twind/core";
const button = style({ ... })
type ButtonProps = PropsOf<typeof button>
export const Button = (props: ButtonProps & HTMLAttributes<HTMLButtonElement>) => {
  return <button className={style(props)} {...rest} />
}
definition: T extends Style<infer Variants> ? [key in keyof Variants]: MorphVariant<keyof Variants[key]> : never