Safe Haskell | None |
---|---|
Language | Haskell2010 |
Purpose of this module is to provide a simple, functional way to define tabs in Snap applications.
Synopsis
Define Tabs in DOM via Heist
tabsSplice :: MonadSnap m => Splice m Source #
tabsCSplice :: MonadSnap m => Splice m Source #
Compiled splice for tabs.
Define Tabs in Haskell
data TabActiveMode Source #
How do we decide "active" for tab state?
TAMExactMatch | Current url has to match exactly |
TAMPrefixMatch | Only the prefix needs to match current url |
TAMInfixMatch | A sub-set of the current url has to match |
TAMDontMatch |
:: MonadSnap m | |
=> Text | A class to be given to the parent ul tag |
-> [Tab] | List of tabs in order |
-> Splice m |
Make tabs from tab definitions. Use the tab
combinator to
define individual options.
:: Text | Target URL for tab |
-> Text | A text/label for tab |
-> [(Text, Text)] | A list of attributes as key=val |
-> TabActiveMode | A |
-> Tab |
Tab item constructor to be used with mkTabs
. Just supply the
given arguments here and it will create a Tab
ready to be used in
mkTabs
.
If the tab is currently active, the li tag will get a class of 'active'.
Make sure to provide a trailing / when indicating URLs as snap context paths contain it and active tab checks will be confused without it.