Gradio provides a theming system that allows you to customize the appearance of your applications.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/gradio-app/gradio/llms.txt
Use this file to discover all available pages before exploring further.
Theme
Methods
from_hub
String of the form
<author>/<theme-name>@<semantic-version-expression>. If a semantic version expression is omitted, the latest version will be fetched.Hugging Face token. Only needed to download private themes.
A Theme instance loaded from the Hub.
Example
load
The filepath to read.
A Theme instance loaded from the file.
from_dict
The dictionary representation of the theme.
A Theme instance.
to_dict
Dictionary representation of the theme.
dump
The path to write the theme to.
Built-in Themes
Gradio includes several built-in themes that you can use:Base
Default
Soft
Monochrome
Glass
Origin
Citrus
Ocean
Custom Themes
You can create custom themes by extending the base Theme class:Theme Variables
Themes support the following customizable variables:Color Variables
primary_hue: Primary color huesecondary_hue: Secondary color hueneutral_hue: Neutral color hue
Size Variables
text_size: Text size scalespacing_size: Spacing size scaleradius_size: Border radius size scale
Font Variables
font: Main font familyfont_mono: Monospace font family
Example: Using a Custom Theme
Example: Loading from Hub
Notes
- Themes are applied to the entire Blocks interface
- You can share custom themes on the Hugging Face Hub
- Theme variables use CSS custom properties under the hood
- Dark mode is automatically supported for all themes