Skip to content

Instantly share code, notes, and snippets.

@ianmackenzie
Created April 1, 2019 13:39
Show Gist options
  • Save ianmackenzie/bbe070d3c10bb96f030f268917359ec0 to your computer and use it in GitHub Desktop.
Save ianmackenzie/bbe070d3c10bb96f030f268917359ec0 to your computer and use it in GitHub Desktop.
elm-ui bullets
module Main exposing (main)
import Element exposing (Element)
import Html exposing (Html)
type Bullet
= Bullet String (List Bullet)
bullet : Bullet
bullet =
Bullet "UPSC"
[ Bullet "Essay"
[ Bullet "If progress is not engendered it will be" []
, Bullet "Poverty is worst form of violence" []
, Bullet "blockchain and corruption"
[ Bullet "beneficiary verified public registries to" []
, Bullet "corruption is often related to delayed or" []
]
, Bullet "you can learn anything from anywhere"
[ Bullet "history" []
, Bullet "Israel - water scarce - learn importance" []
]
]
]
viewBullet : Bullet -> Element msg
viewBullet (Bullet text children) =
Element.row [ Element.spacing 12 ]
[ Element.el [ Element.alignTop ] (Element.text "•")
, Element.column [ Element.spacing 6 ] (Element.text text :: List.map viewBullet children)
]
main : Html Never
main =
Element.layout [] (viewBullet bullet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment