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

Convenient methods #711

Open
Spomky opened this issue Nov 10, 2023 · 1 comment
Open

Convenient methods #711

Spomky opened this issue Nov 10, 2023 · 1 comment

Comments

@Spomky
Copy link

Spomky commented Nov 10, 2023

Is your feature request related to a problem? Please describe.
The FlowbiteInstances.getInstance method is great, but is could be even better with convenient methods such as getModal, getCarousel, getTooltip, getDropdown and so on.

Describe the solution you'd like
Add convenient methods to have somthing like as follows:

const modal = FlowbiteInstances.getModal('modal-id');
// Same as const modal = FlowbiteInstances.getInstance('Modal', 'modal-id');

Describe alternatives you've considered
getInstance is fine too.

Additional context
no context

@zoltanszogyenyi
Copy link
Member

zoltanszogyenyi commented Nov 11, 2023

Hey @Spomky ,

Great idea! I'm open to this - you can also open a PR if you want to contribute and I'll have a look. The magic is in the instances.ts file.

Cheers,
Zoltan

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