AncrelDocumentationv0.3.0

Search documentation

    Playground / fe.safe-image

    SafeImage playground

    An image with an accessible fallback that retries when its source changes.

    Preview

    Mountain silhouette

    Props editor

    State matrix

    dark / comfortable
    VariantDefault
    Sample
    Mountain silhouette

    Published example

    API reference
    'use client'
    
    import { SafeImage } from '@ancrel/ui'
    import '@ancrel/tokens/css'
    import '@ancrel/ui/styles.css'
    
    export default function App() {
      return (
        <SafeImage src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 48'%3E%3Cpath d='M0 48L32 8l16 22 10-12 22 30z'/%3E%3C/svg%3E"
          alt="Mountain silhouette" width={80} height={48} />
      )
    }