Ludic Logo
Edit

Buttons

The module ludic.catalog.buttons contains the following buttons:

ButtonLink
 1   from ludic.catalog.buttons import (
 2       Button,
 3       ButtonPrimary,
 4       ButtonSecondary,
 5       ButtonSuccess,
 6       ButtonInfo,
 7       ButtonWarning,
 8       ButtonDanger,
 9       ButtonLink
10   )
11   
12   Button("Button")
13   ButtonPrimary("ButtonPrimary")
14   ButtonSecondary("ButtonSecondary")
15   ButtonSuccess("ButtonSuccess")
16   ButtonInfo("ButtonInfo")
17   ButtonWarning("ButtonWarning")
18   ButtonDanger("ButtonDanger")
19   ButtonLink("ButtonLink", to="/")

The ButtonLink component can be styled like any other button using the classes attribute:

1   from ludic.catalog.buttons import ButtonLink
2   
3   ButtonLink("ButtonLink", to="/", classes=["warning"])

You can disable a button using the disabled attribute:

1   from ludic.catalog.buttons import Button
2   
3   Button("Button", disabled=True)

Button Sizes

#

You can also change the size of the button appending the small or large class:

1   from ludic.catalog.buttons import ButtonPrimary
2   
3   ButtonPrimary("Small", classes=["small"])
4   ButtonPrimary("Normal")
5   ButtonPrimary("Large", classes=["large"])
Made with Ludic and HTMX and 🐍 • DiscordGitHub