NoRedInk/noredink-ui/35.0.0

NOTE: the latest version is 35.9.3

Nri.Ui.Outline.V1

A nestable layout that can be themed.

type Outline msg
view : List (Outline msg) -> Html msg
import Html.Styled exposing (..)
import Nri.Ui.Outline.V1 as Outline


main : Html msg
main =
    Outline.view []
row :
{ title : Maybe String
, content : Html msg
, palette : RowTheme
, rows : List (Outline msg)
}
-> Outline msg
import Html.Styled exposing (..)
import Nri.Ui.Outline.V1 as Outline exposing (Outline)


myRow : Outline msg
myRow =
    Outline.row
        { title = Just "My node"
        , content = text "This is my content"
        , palette = RowTheme.red
        , rows = []
        }

When you're adding or removing elements, use KeyedOutline and corresponding helpers:

type KeyedOutline msg

Aliased strictly for exporting

viewKeyed : List (KeyedOutline msg) -> Html msg

The row view.

import Html.Styled exposing (..)
import Nri.Ui.Outline.V1 as Outline


main : Html msg
main =
    Outline.viewKeyed [{- Rows go here -}]
String
-> { title : Maybe String
, content : Html msg
, palette : RowTheme
, rows : List (KeyedOutline msg)
}
-> KeyedOutline msg

Render an unstyled row with only the outline styles.

import Html.Styled exposing (..)
import Nri.Ui.Outline.V1 as Outline


main : Html msg
main =
    Outline.viewKeyed []
        [ Outline.keyedRow someKey
            { title = Just "My outline node"
            , content = text "This is my content"
            , palette = RowTheme.red
            , rows = []
            }
        ]
String
-> { rows : List (KeyedOutline msg)
, extraContent : Html msg
, title : Maybe String
, content : Html msg
, palette : RowTheme
}
-> KeyedOutline msg

Render a row with extra content. This row cannot have child rows.

import Html.Styled exposing (..)
import Nri.Ui.Outline.V1 as Outline


main : Html msg
main =
    Outline.view
        [ Outline.keyedRowWithExtraContent someKey
            { title = Just "My outline node"
            , content = text "This is my content"
            , palette = RowTheme.red
            , extraContent = text "My extra content"
            , rows = []
            }
        ]

Predefined color palettes for use with Outlines and KeyedOutlines.

type alias RowTheme =
{ border : Color
, borderStyle : Style
, background : Color
}
white : RowTheme

White palette (borders are blue)

gray : RowTheme
darkGray : RowTheme

Dark Gray palette

blue : RowTheme

Blue palette

darkBlue : RowTheme

Dark blue palette

purple : RowTheme

Purple palette with a purple border instead of a purple background color

turquoise : RowTheme

Turquoise palette

green : RowTheme

Green palette

red : RowTheme

Red palette

aqua : RowTheme

Aqua palette

cornflower : RowTheme

Cornflower palette

blueDashBordered : RowTheme

Blue palette

purpleBordered : RowTheme

Purple palette with a purple border instead of a purple background color

greenBordered : RowTheme

Green palette with a green border instead of a green background color

Modules