Downloading...
129 MB / 1000 MB
A collection of all the components available in miso.ui
A vertically stacked set of interactive headings that each reveal a section of content.
Yes. It adheres to the WAI-ARIA design pattern.
Yes. It comes with default styles that match other component aesthetic.
Yes. It's animated by default, but you can disable it if you prefer.
-----------------------------------------------------------------------------
module MyAccordion (myAccordion) where
-----------------------------------------------------------------------------
import Miso
import Miso.UI.Accordion
( accordion_
, accordionSection_
, accordionHeader_
, accordionBody_
)
-----------------------------------------------------------------------------
myAccordion :: View model action
myAccordion = accordion_ []
[ accordionSection_ []
[ accordionHeader_ []
[ "Is it accessible?" ]
, accordionBody_ []
[ "Yes. It adheres to the WAI-ARIA design pattern." ]
]
, accordionSection_ []
[ accordionHeader_ []
[ "Is it styled?" ]
, accordionBody_ []
[ "Yes. It comes with default styles , that matches the other components aesthetic." ]
]
, accordionSection_ []
[ accordionHeader_ []
[ "Is it animated?" ]
, accordionBody_ []
[ "Yes. It's animated by default, but you can disable it if you prefer." ]
]
]
----------------------------------------------------------------------------------------------------------------------------------------------------------
module MyAlert (alertSample) where
-----------------------------------------------------------------------------
import Miso
import qualified Miso.Html as H
import qualified Miso.Html.Property as P
-----------------------------------------------------------------------------
import qualified Miso.UI.Alert as Alert
-----------------------------------------------------------------------------
alertSample :: View model action
alertSample =
H.div_
[ P.class_ "p-4" ]
[ H.div_
[ P.class_ "grid max-w-xl items-start gap-4"
]
[ Alert.alert_ []
[ Alert.successIcon
, Alert.alertHeader_ [] [ "Success!" ]
, Alert.alertSection_ []
[ """
Congratulations this is a
successful alert !
"""
]
]
, Alert.alert_
[ P.class_ "alert-destructive" ]
[ Alert.destructiveIcon
, Alert.alertHeader_ [] [ "Warning!" ]
, Alert.alertSection_ []
[ """
Something bad happened :( you're getting
a destructive alert!
"""
]
]
]
]-----------------------------------------------------------------------------
module MyAlertDialog (alertDialogComponent) where
-----------------------------------------------------------------------------
import Miso
import qualified Miso.Html as H
import qualified Miso.Html.Property as P
-----------------------------------------------------------------------------
data Action
= ShowModal DOMRef
| CloseDialog
-----------------------------------------------------------------------------
alertDialogComponent :: Component parent () Action
alertDialogComponent = vcomp
where
update_ (ShowModal domRef) = io_ $ do
dialogRef <- nextSibling domRef
void $ dialogRef # ("showModal" :: MisoString) $ ()
update_ CloseDialog = io_ $ do
dialog <- jsg "document"
# ("getElementById" :: MisoString)
$ ["alert-dialog-demo" :: MisoString]
void $ dialog # ("close" :: MisoString) $ ()
vcomp = component () update_ $ \() ->
H.div_
[]
[ H.button_
[ P.type_ "button"
, P.class_ "btn-outline"
, E.onClickWith ShowModal
]
[ "Open alert dialog"
]
, H.dialog_
[ P.id_ "alert-dialog-demo"
, P.class_ "dialog"
, P.aria_ "labelledby" "alert-dialog-title"
, P.aria_ "describedby" "alert-dialog-description"
]
[ H.article_ []
[ H.header_ []
[ H.h2_
[ P.id_ "alert-dialog-title"
]
[ "Are you absolutely sure?"
]
, H.p_
[ P.id_ "alert-dialog-description"
]
[ text $
"This action cannot be undone. " <>
"This will permanently delete your" <>
"account and remove your data from our servers."
]
]
, H.footer_ []
[ H.button_
[ P.class_ "btn-outline"
, E.onClick CloseDialog
] [ "Cancel" ]
, H.button_
[ P.class_ "btn-primary"
, E.onClick CloseDialog
] [ "Continue" ]
]
]
]
]
CN













-----------------------------------------------------------------------------
module MyAvatar (avatarSample) where
-----------------------------------------------------------------------------
import Miso
import qualified Miso.Html as H
import qualified Miso.Html.Property as P
-----------------------------------------------------------------------------
import qualified Miso.UI.Avatar as Avatar
-----------------------------------------------------------------------------
avatarSample :: View model action
avatarSample =
H.div_
[ P.class_ "flex flex-row flex-wrap items-center gap-4" ]
[ Avatar.avatar_
[ P.src_ "https://github.com/dmjio.png"
, P.alt_ "@dmjio"
]
, H.span_
[ P.class_ "size-8 shrink-0 bg-muted flex items-center justify-center rounded-full" ]
[ "CN" ]
, Avatar.avatar_
[ P.src_ "https://github.com/dmjio.png"
, P.alt_ "@dmjio"
, P.class_ "size-12 shrink-0 object-cover rounded-full"
]
, Avatar.avatar_
[ P.src_ "https://github.com/dmjio.png"
, P.alt_ "@dmjio"
, P.class_ "size-8 shrink-0 object-cover rounded-lg"
]
, H.div_
[ P.class_ "flex -space-x-2 [&_img]:ring-background [&_img]:ring-2 [&_img]:grayscale [&_img]:size-8 [&_img]:shrink-0 [&_img]:object-cover [&_img]:rounded-full" ]
[ H.img_ [ P.src_ "https://github.com/dmjio.png", P.alt_ "@dmjio" ]
, H.img_ [ P.src_ "https://github.com/shadcn.png", P.alt_ "@shadcn" ]
, H.img_ [ P.src_ "https://github.com/adamwathan.png", P.alt_ "@adamwathan" ]
, H.img_ [ P.src_ "https://github.com/hunvreus.png", P.alt_ "@hunvreus" ]
]
, H.div_
[ P.class_ "flex -space-x-2 [&_img]:ring-background [&_img]:ring-2 [&_img]:grayscale [&_img]:size-12 [&_img]:shrink-0 [&_img]:object-cover [&_img]:rounded-full" ]
[ H.img_ [ P.src_ "https://github.com/dmjio.png", P.alt_ "@dmjio" ]
, H.img_ [ P.src_ "https://github.com/shadcn.png", P.alt_ "@shadcn" ]
, H.img_ [ P.src_ "https://github.com/adamwathan.png", P.alt_ "@adamwathan" ]
, H.img_ [ P.src_ "https://github.com/hunvreus.png", P.alt_ "@hunvreus" ]
]
, H.div_
[ P.class_ "flex -space-x-2 hover:space-x-1 [&_img]:ring-background [&_img]:size-12 [&_img]:shrink-0 [&_img]:object-cover [&_img]:rounded-full [&_img]:ring-2 [&_img]:grayscale [&_img]:transition-all [&_img]:ease-in-out [&_img]:duration-300" ]
[ H.img_ [ P.src_ "https://github.com/dmjio.png", P.alt_ "@dmjio" ]
, H.img_ [ P.src_ "https://github.com/shadcn.png", P.alt_ "@shadcn" ]
, H.img_ [ P.src_ "https://github.com/adamwathan.png", P.alt_ "@adamwathan" ]
, H.img_ [ P.src_ "https://github.com/hunvreus.png", P.alt_ "@hunvreus" ]
]
]-----------------------------------------------------------------------------
module MyBadge (badgeSample) where
-----------------------------------------------------------------------------
import Miso
import qualified Miso.Html as H
import qualified Miso.Html.Property as P
-----------------------------------------------------------------------------
import qualified Miso.UI.Badge as Badge
-----------------------------------------------------------------------------
badgeSample :: View model action
badgeSample =
H.div_
[ P.class_ "flex flex-col gap-2" ]
[ H.div_
[ P.class_ "flex flex-wrap items-center gap-2 md:flex-row" ]
[ Badge.badge_ [] ["Primary"]
, Badge.badgeSecondary_ [] ["Secondary"]
, Badge.badgeOutline_ [] ["Outline"]
, Badge.badgeDestructive_ [] ["Destructive"]
, Badge.badgeRounded_ [] ["8"]
, Badge.badgeRoundedDestructive_ [] ["99"]
, Badge.badgeRoundedOutline_ [ P.class_ "font-mono tabular-nums" ] ["20+"]
]
, H.div_
[ P.class_ "flex flex-wrap items-center gap-2 md:flex-row" ]
[ Badge.badgeLink_ [ P.href_ "#" ] [ "Link" ]
, Badge.badgeLinkSecondary_ [ P.href_ "#" ] [ "Link" ]
, Badge.badgeLinkDestructive_ [ P.href_ "#" ] [ "Link" ]
, Badge.badgeLinkOutline_ [ P.href_ "#" ] [ "Link" ]
]
]Enter your details below to login to your account
Transcript from the meeting with the client.
Client requested dashboard redesign with focus on mobile responsiveness.
This is a card with an image.
This is a card with a header and a description.
This is a card with a header and a content.
This is a card with a header and a footer.
This is a card with a header, content and footer.
By clicking this checkbox, you agree to the terms and conditions.
You haven't created any projects yet. Get started by creating your first project.
129 MB / 1000 MB
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit Card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank Transfer | $350.00 |
| INV004 | Paid | Paypal | $450.00 |
| INV005 | Paid | Credit Card | $550.00 |
| INV006 | Pending | Bank Transfer | $200.00 |
| INV007 | Unpaid | Credit Card | $300.00 |
| Total | $2,500.00 | ||
Make changes to your account here. Click save when you're done.
Change your password here. After saving, you'll be logged out.
Type your message and press enter to send.