View Source Scenic.Component.Input.Caret (Scenic v0.11.2)

Add a blinking text-input caret to a graph.

data

Data

height

  • height - The height of the caret. The caller (TextEdit) calculates this based on its :font_size (often the same thing).

options

Options

You can change the color of the caret by setting the color option

Graph.build()
  |> caret( 20, color: :white )

usage

Usage

The caret component is used by the TextField component and usually isn't accessed directly, although you are free to do so if it fits your needs. There is no short-cut helper function so you will need to add it to the graph manually.

The following example adds a blue caret to a graph.

graph
  |> Caret.add_to_graph(24, id: :caret, color: :blue )

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Link to this section Functions

Link to this function

add_to_graph(graph, data, opts \\ [])

View Source

Callback implementation for Scenic.Component.add_to_graph/3.

Returns a specification to start this module under a supervisor.

See Supervisor.