Flask-FomanticUI
Flask-FomanticUI is a collection of Jinja macros for Fomantic UI and
Flask for the global style. Very similar
to Bootstrap-Flask.
Features
Requirements
Python 3.8+
Dependecies for this project.
intallation
You can install via pip:
$> pip install Flask-FomanticUI
Example
Register the extension:
from flask import Flask
from flask_fomanticui import FomanticUI
app = Flask(__name__)
fomantic = FomanticUI(app)
Assuming you have a Flask-WTF form like this:
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(1, 20)])
password = PasswordField('Password', validators=[DataRequired(), Length(8, 150)])
submit = SubmitField()
remember = BooleanField('Remember me')
Now with the render_ui_form
macro:
{% from 'fomanticui/form_ui.html' import render_ui_form %}
<html>
<head>
</head>
<body>
<h2>Login</h2>
{{ render_ui_form(form) }}
</body>
</html>
You will get a form like this with only one line code (i.e. {{ render_ui_form(form) }}
):
When the validation fails, the error messages will be rendered with proper style:
Read the Basic Usage
docs for more details.
Links
Authors
Please submit bug reports, suggestions for improvements and patches via
the (E-mail: juandavid9a0@gmail.com).
Contributors
Credits goes to these peoples:
Official repository and Issues
License
Flask-FomanticUI
is free software you can redistribute it and/or modify it
under the terms of the MIT License. For more information, you can see the
LICENSE file
for details.