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

TypeScript - Enumerate Icon Names #2063

Open
2 tasks done
titouandk opened this issue Oct 3, 2024 · 1 comment
Open
2 tasks done

TypeScript - Enumerate Icon Names #2063

titouandk opened this issue Oct 3, 2024 · 1 comment

Comments

@titouandk
Copy link

Prerequisites

Proposal

Will it be possible to create a TypeScript type to enumerate all existing icons?

Like bi-arrow-left, bi-three-dots-vertical, ...

Motivation and context

Useful to provide autocompletion on bootstrap icons, or to restrict possible values when passing an icon to a component.

@julien-deramond julien-deramond transferred this issue from twbs/bootstrap Oct 3, 2024
@titouandk
Copy link
Author

titouandk commented Oct 7, 2024

I think that the types should rather follow the names given in the Bootstrap Icons doc (without the bi bi- prefixes we add in the CSS class).

Like arrow-left, share, ...

Here is a TS type file created listing the node_modules/bootstrap-icons/icons directory, using the following command:

ls icons/*.svg | sed 's|.*/||; s|\.svg$||' > icons_list.txt

The output has been post-processed to create the .ts file.

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

1 participant