IImgProps
interface
Media
Props contract for OrigamImg — covers source, lazy loading, responsive sizes, gradient overlays, cross-origin policy, and transition configuration.
TypeScript
Définition
La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.
Héritage
Hérite de
Interfaces parentes dont celle-ci hérite. Leurs propriétés sont disponibles pour tout consommateur de cette interface.
API
Propriétés
Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.
- altstring
- Alternative text for the image (required for a11y).
- coverboolean
- Apply object-fit: cover to fill the container without letterboxing.
- draggableboolean
- Whether the image is draggable.
- gradientstring
- CSS gradient string applied as an overlay on top of the image.
- lazySrcstring
- Low-resolution placeholder shown while the real src is loading.
- optionsIIntersectionObserverInit
- IntersectionObserver options for the lazy-load trigger.
- sizesstring
- HTML sizes attribute for responsive image selection.
- srcstring | ISrcObject
- Image source. Accepts a URL string or an ISrcObject with srcset and lazySrc.
- crossoriginTCrossOrigin
- CORS setting for the image request (anonymous or use-credentials).
- referrerpolicyTReferrerPolicy
- Referrer policy sent with the image request.
- srcsetstring
- HTML srcset attribute for responsive image selection.
- positionstring
- CSS object-position value (e.g. "top center").
Écosystème
Utilisé par
Composants et composables qui étendent ou consomment cette interface.
Usage
Exemples
Extraits de code prêts à coller utilisant cette interface.
Responsive lazy image with a gradient overlay