3LynxJS native UI elements for Elm. Provides typed constructors for native iOS/Android views, layout attributes, and event handlers.
13 "lynxjs-elm/ui": "1.0.0"
21- [`Lynx`](#lynx) — Native element constructors (view, text, image, etc.)
22- [`Lynx.Attributes`](#lynxattributes) — Styling, layout, and content attributes
23- [`Lynx.Events`](#lynxevents) — Tap, touch, and input event handlers
36type alias Node msg = VirtualDom.Node msg
37type alias Attribute msg = VirtualDom.Attribute msg
43view : List (Attribute msg) -> List (Node msg) -> Node msg
46Generic container (`<view>`). The primary layout building block.
49text : List (Attribute msg) -> List (Node msg) -> Node msg
52Text container (`<text>`). Use for styled text that can contain nested text nodes.
55textContent : String -> Node msg
58Plain text node. Auto-wrapped in a `<text>` element by the kernel.
61image : List (Attribute msg) -> List (Node msg) -> Node msg
64Image element (`<image>`). Set the source with `Lynx.Attributes.src`.
67scrollView : List (Attribute msg) -> List (Node msg) -> Node msg
70Scrollable container (`<scroll-view>`). Control direction with `Lynx.Attributes.scrollDirection`.
73list : List (Attribute msg) -> List (Node msg) -> Node msg
76List element (`<list>`) for efficient rendering of long lists.
79input : List (Attribute msg) -> List (Node msg) -> Node msg
82Single-line text input.
85textarea : List (Attribute msg) -> List (Node msg) -> Node msg
93import Lynx exposing (..)
94import Lynx.Attributes exposing (..)
95import Lynx.Events exposing (..)
98 [ text [ fontSize 24, color "white" ]
99 [ textContent "Hello, LynxJS!" ]
100 , image [ src "logo.png", width 100, height 100 ] []
109import Lynx.Attributes exposing (..)
115width : Int -> Attribute msg
116height : Int -> Attribute msg
117minWidth : Int -> Attribute msg
118minHeight : Int -> Attribute msg
119maxWidth : Int -> Attribute msg
120maxHeight : Int -> Attribute msg
123All dimensions are in pixels.
128display : String -> Attribute msg -- e.g. "flex", "none"
129flexDirection : String -> Attribute msg -- "row", "column", "row-reverse", "column-reverse"
130flexWrap : String -> Attribute msg -- "wrap", "nowrap"
131justifyContent : String -> Attribute msg -- "center", "flex-start", "flex-end", "space-between", "space-around"
132alignItems : String -> Attribute msg -- "center", "flex-start", "flex-end", "stretch"
133alignSelf : String -> Attribute msg
134flex : Int -> Attribute msg
135flexGrow : Int -> Attribute msg
136flexShrink : Int -> Attribute msg
142padding : Int -> Attribute msg
143paddingTop : Int -> Attribute msg
144paddingRight : Int -> Attribute msg
145paddingBottom : Int -> Attribute msg
146paddingLeft : Int -> Attribute msg
147margin : Int -> Attribute msg
148marginTop : Int -> Attribute msg
149marginRight : Int -> Attribute msg
150marginBottom : Int -> Attribute msg
151marginLeft : Int -> Attribute msg
159position : String -> Attribute msg -- "relative", "absolute", "fixed"
160top : Int -> Attribute msg
161right : Int -> Attribute msg
162bottom : Int -> Attribute msg
163left : Int -> Attribute msg
164zIndex : Int -> Attribute msg
170backgroundColor : String -> Attribute msg -- e.g. "#ff0000", "red"
171opacity : Float -> Attribute msg -- 0.0 to 1.0
172overflow : String -> Attribute msg -- "hidden", "visible", "scroll"
178borderWidth : Int -> Attribute msg
179borderColor : String -> Attribute msg
180borderRadius : Int -> Attribute msg
186fontSize : Int -> Attribute msg
187fontWeight : String -> Attribute msg -- "bold", "normal", "100"–"900"
188fontFamily : String -> Attribute msg
189color : String -> Attribute msg
190textAlign : String -> Attribute msg -- "center", "left", "right"
191lineHeight : Int -> Attribute msg
192textOverflow : String -> Attribute msg -- "ellipsis", "clip"
198src : String -> Attribute msg -- image URL
199placeholder : String -> Attribute msg -- input placeholder text
200value : String -> Attribute msg -- input value
201scrollDirection : String -> Attribute msg -- "vertical", "horizontal"
207id : String -> Attribute msg
208class_ : String -> Attribute msg
216import Lynx.Events exposing (..)
222onTap : msg -> Attribute msg
225Fires when the element is tapped.
228onLongpress : msg -> Attribute msg
231Fires on a long press.
236onTouchStart : msg -> Attribute msg
237onTouchMove : msg -> Attribute msg
238onTouchEnd : msg -> Attribute msg
239onTouchCancel : msg -> Attribute msg
245onInput : (String -> msg) -> Attribute msg
248Fires when an input's value changes. The callback receives the new value (extracted from `event.detail.value`).
253import Lynx exposing (..)
254import Lynx.Attributes exposing (..)
255import Lynx.Events exposing (..)
257view [ onTap Increment, backgroundColor "#4CAF50", padding 16 ]
258 [ text [ fontSize 20, color "white" ]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list