Parts
Ez az oldal még csak angolul érhető el.
The parts of @poltura/theme-sdk/media.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/media';MediaImage
A responsive image in every format the browser takes, with blur-up and broken-link recovery.
MediaImage(props: MediaImageProps): ReactElementProps: MediaImageProps
Example
import { MediaImage } from '@poltura/theme-sdk/media';
export function Hero({ image }: { image: string }) {
return <MediaImage image={image} role='hero' priority sizes='100vw' />;
}MediaPlaceholder
The neutral drawing shown where an image is not chosen yet.
MediaPlaceholder(props: MediaPlaceholderProps): ReactElementProps: MediaPlaceholderProps
Example
import { MediaPlaceholder } from '@poltura/theme-sdk/media';
export function EmptyTile() {
return <MediaPlaceholder width={800} height={800} className='rounded' />;
}SettingVideo
Draws a video setting: the file with its poster, autoplay, loop and mute, or the YouTube or Vimeo player, with its text alternative.
SettingVideo(props: SettingVideoProps): ReactElement | nullReturns: The video, or nothing when the setting is empty.
Props: SettingVideoProps
Example
import { SettingVideo, type VideoValue } from '@poltura/theme-sdk/media';
export function HeroBackdrop({ video }: { video?: VideoValue }) {
return (
<div className='relative h-96'>
<SettingVideo value={video} cover />
</div>
);
}