Skip to content

Tabler UI#2892

Open
mariofix wants to merge 4 commits into
pallets-eco:masterfrom
mariofix:tabler-ui
Open

Tabler UI#2892
mariofix wants to merge 4 commits into
pallets-eco:masterfrom
mariofix:tabler-ui

Conversation

@mariofix
Copy link
Copy Markdown

@mariofix mariofix commented May 5, 2026

This PR adds Tabler UI into Flask-Admin, an early version.

fixes #2443

See tabler folder included in examples

admin = Admin(
    app,
    name="Example: Tabler",
    theme=TablerTheme(layout="condensed")
)

options allowed

layout: TablerLayout = "fluid" # "vertical", "fluid", "condensed"
# Defaults match Tabler's own defaults so existing deployments are unaffected.
theme: str = "light"  # "light" | "dark"
theme_primary: str = "blue"  # "blue" | "lime" | "azure" | "indigo" | …
theme_base: str = "gray"  # "gray" | "neutral" | "slate" | "zinc" | "stone"
theme_font: str = "sans-serif"  # "sans-serif" | "serif" | "monospace" | "comic"
theme_radius: str = "1"  # "0" | "0.5" | "1" | "1.5" | "2"

you can go to https://preview.tabler.io to see combinations

let me know what you think

Comment thread flask_admin/theme.py
theme_base: str = "gray" # "gray" | "neutral" | "slate" | "zinc" | "stone"
theme_font: str = "sans-serif" # "sans-serif" | "serif" | "monospace" | "comic"
theme_radius: str = "1" # "0" | "0.5" | "1" | "1.5" | "2"
theme_use_cdn: bool = True # From where to load tabler files
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@umpirsky
Copy link
Copy Markdown
Contributor

umpirsky commented May 5, 2026

This is huge! Great work, really appreciate the effort, thanks!

@ElLorans ElLorans added the theme label May 10, 2026
@umpirsky
Copy link
Copy Markdown
Contributor

@ElLorans What are the steps that we need to do to push this to the finish line?

@ElLorans
Copy link
Copy Markdown
Contributor

Replying to my 2 comments and fixing the tests (but this I can do myself)

Comment on lines -43 to +45
f'<span class="fa {fa} glyphicon glyphicon-{glyph} '
f'<span class="fa {fa} glyphicon glyphicon-{glyph} ti ti-{ti} {color} '
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a breaking change. What's the impact on bootstrap4 template?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignored if tabler icons are not loaded, same for glyphs, deprecated since long ago but the class is still there

Comment thread flask_admin/theme.py
"""
Tabler 1.4.0 theme for Flask-Admin.

Ships Tabler UI assets locally (CSS, JS, icon webfonts) so no CDN is
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this refers to shipping locally but that will need a separate PR?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to @mariofix, I'm fine with doing only CDN for the first version.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, you said first pr with cdn to.make it simpler, there are like 5 or 6 static files

@umpirsky
Copy link
Copy Markdown
Contributor

Replying to my 2 comments and fixing the tests (but this I can do myself)

@ElLorans Fixed the tests in mariofix#1 cc @mariofix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Template Mode w/ Tabler

3 participants