-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shadcn components import #3
Comments
Thanks for the great suggestion. Currently, I am focusing on the stability and flexibility of the UI builder for the next few releases. That being said, you should be able to add existing awesome shadcn component libraries by first calling |
@olliethedev, should the schema generator handle custom components as well? For example, I have a import { CustomButton } from "ui-kit"; Here’s my /// <reference types="react" />
import { ButtonProps as PrimeButtonProps } from 'primereact/button';
import { ButtonVariant, ButtonType, ButtonSize } from './types';
export interface ButtonProps extends PrimeButtonProps {
size?: ButtonSize;
variant?: ButtonVariant;
type?: ButtonType;
icon?: string | React.ReactNode;
disabled?: boolean;
/**
* data-testid for testing purposes.
*/
'data-testid'?: string;
}
export declare const Button: ({
size,
variant,
type,
iconPos,
disabled,
icon,
"data-testid": dataTestid,
className,
...rest
}: ButtonProps) => ....... I’ve registered it in the const CustomComponentRegistry: ComponentRegistry = {
CustomButton: {
component: CybButton,
schema: {
// I expected the schema generator to automatically generate this
// so I could just copy it here.
},
from: "ui-kit",
fieldOverrides: {
className: (layer) => classNameFieldOverrides(layer),
children: (layer) => childrenFieldOverrides(layer),
},
},
}; However, when I run the command to generate schemas, I don’t see the Is the generator expected to support this use case? Or do I need to manually define schemas for custom components like |
There are so many awesome shadcn UI libraries https://github.com/birobirobiro/awesome-shadcn-ui and most of the are slowly supporting the shadcn registry structure,
if would be nice to provide all those as pre made components automatically..may be autogenerating the necessary schema treating shadcn elements as primitives
The text was updated successfully, but these errors were encountered: