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

A URL link content item for Deep Linking responses.

Use this for external URLs hosted outside your tool, such as articles,
documentation, or third-party resources. For links that launch back
into your tool via LTI, use `Ltix.DeepLinking.ContentItem.LtiResourceLink`
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 `%{}`.

* `:embed` (`t:map/0`)

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

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

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

* `:window` (`t:map/0`) - Window presentation for the link.

* `:iframe` (`t:map/0`) - Iframe presentation for the link.

# `t`

```elixir
@type t() :: %Ltix.DeepLinking.ContentItem.Link{
  embed: %{html: binary()},
  extensions: %{optional(binary()) =&gt; any()},
  icon: %{
    optional(:width) =&gt; integer(),
    :url =&gt; binary(),
    optional(:height) =&gt; integer()
  },
  iframe: %{
    optional(:width) =&gt; integer(),
    optional(:height) =&gt; integer(),
    src: binary()
  },
  text: binary(),
  thumbnail: %{
    optional(:width) =&gt; integer(),
    :url =&gt; binary(),
    optional(:height) =&gt; integer()
  },
  title: binary(),
  url: binary(),
  window: %{
    optional(:width) =&gt; integer(),
    optional(:height) =&gt; integer(),
    optional(:target_name) =&gt; binary(),
    optional(:window_features) =&gt; binary()
  }
}
```

# `new`

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

Create a new link content item.

## Examples

    iex> {:ok, link} = Ltix.DeepLinking.ContentItem.Link.new(url: "https://example.com")
    iex> link.url
    "https://example.com"

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

---

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