Image has built-in performance and accessibility optimizations that allow users to easily display responsive images.
import { DaffImageComponent } from '@daffodil/design/image'
@Component()
class DaffImageComponent implements OnInit {
priority: InputSignal<boolean> = input(false)
@Input() @HostBinding() skeleton: boolean = false
@Input() src: string
@Input() alt: string
@Input() width: number
@Input() height: number
@Output() load: EventEmitter<void> = new EventEmitter()
}
boolean| Default | false |
|---|---|
| Description | Controls whether the component displays a skeleton loading state. |
string| Default | – |
|---|---|
| Description | The URL of the image. |
string| Default | – |
|---|---|
| Description | The alternate text for the image. |
number| Default | – |
|---|---|
| Description | The width of the image. |
number| Default | – |
|---|---|
| Description | The height of the image. |
EventEmitter| Default | – |
|---|---|
| Description | Emits when the image has loaded. |
InputSignal| Default | input(false) |
|---|---|
| Description | Whether the image should be treated as a priority image for loading. Priority images are loaded eagerly and not lazy-loaded. |
import { DaffImageModule } from '@daffodil/design/image'
@NgModule()
class DaffImageModule {}