Skip to content

EmptyState image should be able to accept SVG react component as image instead of url #6998

@TheSecurityDev

Description

@TheSecurityDev

Feature request summary

There should be a way to pass an SVG image as a React component directly to the EmptyState image.

Rationale

The EmptyState component accepts an image prop that is the URL to the image. But sometimes the image doesn't load immediately, because it's loaded afterwords via the <img> src attribute. This causes the layout to shift after the image loads. So there should be a way to pass an SVG image directly as a React Component, so the image won't have to load as a separate network request on the client side.

Implementation

Ideally, the image prop would accepts an SVG component, and then a new imageUrl prop could be used to set the image src, the way it does now. Or for backward compatibility, use the same image prop and then check if it's a string or not to determine whether to use as a component or a URL.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions