Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


PureScript UI framework based on lenses.

Subscribe to updates I use purescript-optic-ui

Statistics on purescript-optic-ui

Number of watchers on Github 102
Number of open issues 7
Average time to close an issue about 1 month
Main language PureScript
Average time to merge a PR 1 day
Open pull requests 2+
Closed pull requests 2+
Last commit about 3 years ago
Repo Created about 4 years ago
Repo Last Updated over 1 year ago
Size 102 KB
Organization / Authorzrho
Page Updated
Do you use purescript-optic-ui? Leave a review!
View open issues (7)
View purescript-optic-ui activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating purescript-optic-ui for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Optic UI

Build Status Maintainer: zrho

Optic UI is a Purescript library that allows to write single page web user interfaces declaratively and concisely with the help of lenses and traversals:

UI components are defined in a profunctor that gives them access to a view model, a state local to the component. Child components that access only a part of the state of their parent can be embedded in a bigger component using lenses and traversals that focus on the respective sub-states. Components provide a handler function that - given a new state - triggers an update of the UI and generate a view that is finally rendered using virtual-dom.


main = animate false $ with \on h ->
  let clicked _ = updatePure h (not on)
  in mconcat $ ui <$>
    [ H.h1_ $ text "Toggle Button"
    , H.button [H.titleA "Toggle", H.onClick clicked] $ text $ if on then "On" else "Off"
main = animate "Hello World" $ withView H.div_ $ with \s h -> mconcat
  [ ui $ H.h1_ $ text "Synchronized Text Fields"
  , ui $ H.p_ $ text "First text field:"
  , textField []
  , ui $ H.p_ $ text "Second text field:"
  , textField []
main = animate (Tuple "Left" "Right") $ withView H.div_ $ mconcat
  [ ui $ H.h1_ $ text "Independent Text Fields"
  , ui $ H.p_ $ text "First text field:"
  , _1 $ textField []
  , ui $ H.p_ $ text "Second text field:"
  , _2 $ textField []

For more examples, have a look at the examples directory:

purescript-optic-ui open issues Ask a question     (View All Issues)
  • over 3 years Async calls in initializer in the latest version
  • over 3 years Edit lenses
  • almost 4 years Async state updates are first-write-wins
  • almost 4 years Composing calls to runhandler
  • about 4 years Question: different approach to TraversalP, LensP etc.
purescript-optic-ui open pull requests (View All Pulls)
  • Couple of new attrs
  • Fix 404 for Effects example
purescript-optic-ui list of languages used
Other projects in PureScript