Skip to content

Create an icon widget #463

@tomdye

Description

@tomdye

Enhancement

We've circled around this one a few times, but when trying to create a Button with an icon it for the theme tester, I have realised that without an icon widget, it is not straight forward for a user to use the dojo 2 icons in their own apps.

// with an icon widget
w(Button, {}, [
   'search',
   w(Icon, { type: 'search' })
])

// without an icon widget
import * as iconCss from '@dojo/widgets/theme/common/icons.m.css'

@theme(iconCss)
w(Button, {}, [
    'search ',
    v('i', { classes: this.theme([ iconCss.icon, iconCss.searchIcon ])})
])

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions