Skip to content
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

Button allows any string for appearance #1184

Open
ethanashaw opened this issue Feb 28, 2025 · 2 comments
Open

Button allows any string for appearance #1184

ethanashaw opened this issue Feb 28, 2025 · 2 comments

Comments

@ethanashaw
Copy link

The Button component allows any string for its appearance:

appearance?: ValueOf<typeof ButtonAppearance> | string;

Could it be restricted to ValueOf<typeof ButtonAppearance>?

@huwshimi
Copy link
Collaborator

huwshimi commented Mar 2, 2025

Hi @ethanashaw, string is supported so that custom button variations (classes) can be created within projects and used with this component. Possibly we could adjust the type so that it suggests the values in your IDE.

@ethanashaw
Copy link
Author

Hi @ethanashaw, string is supported so that custom button variations (classes) can be created within projects and used with this component. Possibly we could adjust the type so that it suggests the values in your IDE.

That would be great. I think this should work, at least in Visual Studio Code:

appearance?: ValueOf<typeof ButtonAppearance> | (string & {}); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants