Skip to main content

The simplicity of FastHTML with the power of Tailwind

Project description

MonsterUI

MonsterUI is a UI framework for FastHTML for building beautiful web interfaces with minimal code. It combines the simplicity of Python with the power of Tailwind. Perfect for data scientists, ML engineers, and developers who want to quickly turn their Python code into polished web apps without the complexity of traditional UI frameworks. Follows semantic HTML patterns when possible.

MonsterUI adds the following Tailwind-based libraries Franken UI and DaisyUI to FastHTML, as well as Python's Mistletoe for Markdown, HighlightJS for code highlighting, and Katex for latex support.

Getting Started

Installation

To install this library, uses

pip install MonsterUI

Getting Started

TLDR

Run python file.py on this to start:

from fasthtml.common import *
from monsterui.all import *

# Choose a theme color (blue, green, red, etc)
hdrs = Theme.blue.headers()

# Create your app with the theme
app, rt = fast_app(hdrs=hdrs)

@rt
def index():
    socials = (('github','https://github.com/AnswerDotAI/MonsterUI'),
               ('twitter','https://twitter.com/isaac_flath/'),
               ('linkedin','https://www.linkedin.com/in/isaacflath/'))
    return Titled("Your First App",
        Card(
            H1("Welcome!"),
            P("Your first MonsterUI app", cls=TextPresets.muted_sm),
            P("I'm excited to see what you build with MonsterUI!"),
            footer=DivLAligned(*[UkIconLink(icon,href=url) for icon,url in socials])))

serve()

LLM context files

Using LLMs for development is a best practice way to get started and explore. While LLMs cannot code for you, they can be helpful assistants. You must check, refactor, test, and vet any code any LLM generates for you - but they are helpful productivity tools. Take a look inside the llms.txt file to see links to particularly useful context files!

In addition you can add /md (for markdown) to a url to get a markdown representation and /rmd for rendered markdown representation (nice for looking to see what would be put into context.

Step by Step

To get started, check out:

  1. Start by importing the modules as follows:
from fasthtml.common import *
from monsterui.all import *
  1. Instantiate the app with the MonsterUI headers
app = FastHTML(hdrs=Theme.blue.headers())

# Alternatively, using the fast_app method
app, rt = fast_app(hdrs=Theme.slate.headers())

The color option can be any of the theme options available out of the box

katex and highlightjs are not included by default. To include them set katex=True or highlightjs=True when calling .headers. (i.e. Theme.slate.headers(katex=True))*

From here, you can explore the API Reference & examples to see how to implement the components. You can also check out these demo videos to as a quick start guide:

More resources and improvements to the documentation will be added here soon!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monsterui-1.0.37.tar.gz (37.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monsterui-1.0.37-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file monsterui-1.0.37.tar.gz.

File metadata

  • Download URL: monsterui-1.0.37.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for monsterui-1.0.37.tar.gz
Algorithm Hash digest
SHA256 b1c380733f5e6d3653b8ffed6103ecb19a4bc4935924ffb078329983eb9355eb
MD5 d2e224c7a890f24691c37c275c10bb8b
BLAKE2b-256 78d701e8894d90e31a497c925e77ea37a15fe4e54c4a812d8b784228e3a4b66b

See more details on using hashes here.

File details

Details for the file monsterui-1.0.37-py3-none-any.whl.

File metadata

  • Download URL: monsterui-1.0.37-py3-none-any.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for monsterui-1.0.37-py3-none-any.whl
Algorithm Hash digest
SHA256 5e7fff8daddbb628a9f683cc93ca1b2d192930eeef5831bd1d0f681ae51c20a0
MD5 e90cdb0513c25b95a8615adc34daf025
BLAKE2b-256 45a7578b1235df6fce4dba606e3b701dc3749cb45701e97595b04d66fc0ca82d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page