NoRedInk/noredink-ui/6.6.2

NOTE: the latest version is 35.9.3

Nri.Ui.Outline.V2

A module for rendering outline layouts.

segment : List (NodeLayout msg) -> Html msg

A container to draw nodes in.

segment
    [ node { config | label = "First Node" }
    , node { config | label = "Second Node" }
    ]
node : NodeConfig msg -> NodeLayout msg

Draw a node of an outline structure. You can draw other nodes inside it and connecting lines will appear.

node { config | label = "Claim" }
type NodeLayout msg

A wrapper for a node rendered into Html. This type exists to prevent us from accidentally wrapping a node in a container element before passing it as a child to another node or segment. Such wrapping would break some of our styling, which assumes nodes of the same level are sibblings in the Html tree.

type alias NodeConfig msg =
{ label : Html msg
, contents : Html msg
, children : List (NodeLayout msg)
, selected : Bool
, ghosted : Bool
, attrs : List (Attribute msg)
}

Defines how a node should look.

config : NodeConfig msg

A default node configuration, allowing you to only set the properties you care about.

node { config | label = "Claim" }
html : Html msg -> NodeLayout msg

Wrap any html in a NodeLayout so you can use it as sibling content to nodes.

segment
    [ node { config | label = "This is a node" }
    , html (Html.text "This is some random Html content!")
    ]