# `Plushie.Canvas.Text`
[🔗](https://github.com/plushie-ui/plushie-elixir/blob/v0.7.2/lib/plushie/canvas/text.ex#L1)

Canvas text element with position, content, and optional font styling.

# `option`

```elixir
@type option() ::
  ((((((({:x, number()} | {:y, number()}) | {:content, String.t() | atom()})
       | {:fill, term()})
      | {:size, number()})
     | {:font, String.t() | atom()})
    | {:align_x, String.t() | atom()})
   | {:align_y, String.t() | atom()})
  | {:opacity, number()}
```

# `t`

```elixir
@type t() :: %Plushie.Canvas.Text{
  align_x:
    (String.t() | atom())
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  align_y:
    (String.t() | atom())
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  content:
    (String.t() | atom())
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  fill:
    term()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  font:
    (String.t() | atom())
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  id: String.t() | nil,
  opacity:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  size:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  x:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil,
  y:
    number()
    | Plushie.Animation.Transition.t()
    | Plushie.Animation.Spring.t()
    | Plushie.Animation.Sequence.t()
    | nil
}
```

# `align_x`

```elixir
@spec align_x(widget :: t(), value :: (String.t() | atom()) | nil) :: t()
```

Horizontal alignment: "left", "center", "right".

Accepts `String.t() | atom()`.

# `align_y`

```elixir
@spec align_y(widget :: t(), value :: (String.t() | atom()) | nil) :: t()
```

Vertical alignment: "top", "center", "bottom".

Accepts `String.t() | atom()`.

# `build`

```elixir
@spec build(widget :: t()) :: Plushie.Widget.ui_node()
```

Converts this widget struct to a `ui_node()` map.

# `content`

```elixir
@spec content(widget :: t(), value :: (String.t() | atom()) | nil) :: t()
```

Text string to draw.

Accepts `String.t() | atom()`.

# `fill`

```elixir
@spec fill(widget :: t(), value :: term() | nil) :: t()
```

Text fill color.

Accepts `term()`.

# `font`

```elixir
@spec font(widget :: t(), value :: (String.t() | atom()) | nil) :: t()
```

Font specification.

Accepts `String.t() | atom()`.

# `new`

# `new`

Creates a new element without an explicit ID (auto-assigned by parent container).

# `new`

Creates a new element with the given ID, positional args, and keyword options.

# `opacity`

```elixir
@spec opacity(widget :: t(), value :: number() | nil) :: t()
```

Opacity from 0.0 to 1.0.

Accepts `number()`.

# `size`

```elixir
@spec size(widget :: t(), value :: number() | nil) :: t()
```

Font size in pixels.

Accepts `number()`.

# `type_name`

```elixir
@spec type_name() :: String.t()
```

Returns the element type string for the wire protocol.

# `with_options`

```elixir
@spec with_options(widget :: t(), opts :: [option()]) :: t()
```

Applies keyword options to an existing widget struct.

# `x`

```elixir
@spec x(widget :: t(), value :: number() | nil) :: t()
```

X position in pixels.

Accepts `number()`.

# `y`

```elixir
@spec y(widget :: t(), value :: number() | nil) :: t()
```

Y position in pixels.

Accepts `number()`.

---

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