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

Add a single radio button to a graph.

data

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

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

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.