Skip to content

feat: Add interface for accessing icons with Ionic #26

@Lexpeartha

Description

@Lexpeartha

🆒 Your use case

When using icons while creating an app, what you usually do is with ion-icon you specify your icons like this:

<ion-icons name="home" />

or if you would like a little more type-safety for example:

import { home, homeSharp } from 'ionicons/icons'

// Just one icon
<ion-icons :name="home" />
// Or to specify for different platforms
<ion-icons :md="home" :ios="homeSharp" />

🆕 The solution you'd like

I think it would be great if nuxt-ionic could expose unified interface from which we could access all icons in typesafe way

🔍 Alternatives you've considered

Let's say interface Ionicon is auto-imported, then my proposition would look something like this

<ion-icons :md="Ionicon.home.regular" :ios="Ionicon.home.sharp" />

This seems a bit more verbose than previous type-safe solution, but requires less boilerplate and less looking up certain strings on the official website

ℹ️ Additional info

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions