Scenic.Component.Input.RadioButton (Scenic v0.10.3) View Source

Add a single radio button to a graph.

Data

{text, id} {text, id, selected?}

  • text - a bitstring of the text to display
  • id - any term. Identifies the radio button.
  • selected? - boolean. true if selected. false if not. Default is false if this term is not provided.

Usage

The RadioButton component is used by the RadioGroup 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 caret to a graph.

graph
|> RadioButton.add_to_graph({"A button", :an_id, true})

Link to this section Summary

Link to this section Functions

Link to this function

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

View Source

Specs

add_to_graph(graph :: Scenic.Graph.t(), data :: any(), opts :: list()) ::
  Scenic.Graph.t()

Callback implementation for Scenic.Component.add_to_graph/3.