# `Ltix.DeepLinking.ContentItem.Image`
[🔗](https://github.com/DecoyLex/ltix/blob/main/lib/ltix/deep_linking/content_item/image.ex#L1)

An image content item for Deep Linking responses.

The platform renders the image directly using an HTML `img` tag.
For images that are part of a larger resource, consider using
`Ltix.DeepLinking.ContentItem.Link` with an `embed` instead.

## Options

* `:title` (`t:String.t/0`) - Title for the content item.

* `:text` (`t:String.t/0`) - Plain-text description.

* `:extensions` (`t:map/0`) - Required. Vendor-specific extension properties. The default value is `%{}`.

* `:width` (`t:integer/0`) - Width of the image in pixels.

* `:url` (`t:String.t/0`) - Required. URL of the image.

* `:icon` (`t:map/0`) - Icon or thumbnail for the image.

* `:thumbnail` (`t:map/0`) - Icon or thumbnail for the image.

* `:height` (`t:integer/0`) - Height of the image in pixels.

# `t`

```elixir
@type t() :: %Ltix.DeepLinking.ContentItem.Image{
  extensions: %{optional(binary()) =&gt; any()},
  height: integer(),
  icon: %{
    optional(:width) =&gt; integer(),
    :url =&gt; binary(),
    optional(:height) =&gt; integer()
  },
  text: binary(),
  thumbnail: %{
    optional(:width) =&gt; integer(),
    :url =&gt; binary(),
    optional(:height) =&gt; integer()
  },
  title: binary(),
  url: binary(),
  width: integer()
}
```

# `new`

```elixir
@spec new(keyword()) :: {:ok, t()} | {:error, Exception.t()}
```

Create a new image content item.

## Examples

    iex> {:ok, image} = Ltix.DeepLinking.ContentItem.Image.new(url: "https://example.com/photo.png")
    iex> image.url
    "https://example.com/photo.png"

    iex> {:error, %Ltix.Errors.Invalid{}} =
    ...>   Ltix.DeepLinking.ContentItem.Image.new([])

---

*Consult [api-reference.md](api-reference.md) for complete listing*
