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

Export properties type for each component #106

Closed
mmrath opened this issue Feb 2, 2023 · 5 comments
Closed

Export properties type for each component #106

mmrath opened this issue Feb 2, 2023 · 5 comments

Comments

@mmrath
Copy link

mmrath commented Feb 2, 2023

Is your feature request related to a problem? Please describe.
When creating wrapper component it would be handy to have the type of properties of a component. Currently there is options but that is not the full list of properties of the component

Describe the solution you'd like
I am thinking that for each polymorphicComponent we export the corresponding props. for example for AccordionHeader, something like

export type AccordionHeaderProps = ....

Describe alternatives you've considered
the types can be created by consumer but it does not look great

Additional context
This will be specifically useful to create wrappers

@fabien-ml
Copy link
Collaborator

Hi, thanks for reporting the issue.

If I understand correctly, you want something like this:

// Kobalte custom options
export interface AccordionHeaderOptions {}

// Kobalte custom options + the native HTML `h3` props
export type AccordionHeaderProps = ...

@fabien-ml fabien-ml added this to the v0.7.0 milestone Feb 2, 2023
@mmrath
Copy link
Author

mmrath commented Feb 2, 2023

Thank you. That is correct.

@fabien-ml fabien-ml removed this from the v0.7.0 milestone Feb 10, 2023
@mmrath
Copy link
Author

mmrath commented Mar 3, 2023

Hey @fabien-ml I was thinking if it would be possible for you do this for one component(say TextField.*)? then others(possibly me) can follow the same pattern and raise PRs for the other component. WDYT?

@fabien-ml
Copy link
Collaborator

done in v0.7.1

@mmrath
Copy link
Author

mmrath commented Mar 12, 2023

Thank you @fabien-ml

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

No branches or pull requests

2 participants