ionic-team / ionic-team/ionicons

feat: add types for icon names

Open
#1,269 1 comment 1 reaction 0 assignees View on GitHub
type: feature request
Dominant language
TypeScript
Stars
18.2k
Forks
2.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe Problem

it should be possible to type the `name` and `icon` props with available icon names

### Describe Preferred Solution

`name` could be typed as:

```typescript
type IconNames = 'accessibility' | 'accessibility-outline' | 'accessibility-sharp'...
```

`icon` could be typed as:

```typescript
type IconSource = IconNames | (string & {})
```

You can find an [explanation for the `string & {}` part on google](https://www.google.com/search?q=string+%2526+%7B%7D)

### Describe Alternatives

_No response_

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.