Custom Components GalleryNEW
ExploreCustom Components GalleryNEW
ExploreNew to Gradio? Start here: Getting Started
See the Release History
To install Gradio from main, run the following command:
pip install https://gradio-builds.s3.amazonaws.com/4a3ee6fafe8ba9ecf1d5c103002766db14c569f4/gradio-4.31.4-py3-none-any.whl
*Note: Setting share=True
in
launch()
will not work.
gradio.Base(···)
Parameter | Description |
---|---|
primary_hue colors.Color | str default: Color() | The primary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string "green"), or pass your own gradio.themes.utils.Color object. |
secondary_hue colors.Color | str default: Color() | The secondary hue of the theme. Load a preset, like gradio.themes.colors.green (or just the string "green"), or pass your own gradio.themes.utils.Color object. |
neutral_hue colors.Color | str default: Color() | The neutral hue of the theme, used . Load a preset, like gradio.themes.colors.green (or just the string "green"), or pass your own gradio.themes.utils.Color object. |
text_size sizes.Size | str default: Size() | The size of the text. Load a preset, like gradio.themes.sizes.text_sm (or just the string "sm"), or pass your own gradio.themes.utils.Size object. |
spacing_size sizes.Size | str default: Size() | The size of the spacing. Load a preset, like gradio.themes.sizes.spacing_sm (or just the string "sm"), or pass your own gradio.themes.utils.Size object. |
radius_size sizes.Size | str default: Size() | The radius size of corners. Load a preset, like gradio.themes.sizes.radius_sm (or just the string "sm"), or pass your own gradio.themes.utils.Size object. |
font fonts.Font | str | Iterable[fonts.Font | str] default: (<gradio.themes.utils.fonts.GoogleFont (name='Source Sans Pro', weights=(400, 600))>, 'ui-sans-serif', 'system-ui', 'sans-serif') | The primary font to use for the theme. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks. |
font_mono fonts.Font | str | Iterable[fonts.Font | str] default: (<gradio.themes.utils.fonts.GoogleFont (name='IBM Plex Mono', weights=(400, 600))>, 'ui-monospace', 'Consolas', 'monospace') | The monospace font to use for the theme, applies to code. Pass a string for a system font, or a gradio.themes.font.GoogleFont object to load a font from Google Fonts. Pass a list of fonts for fallbacks. |
gradio.Base.push_to_hub(repo_name, ···)
Upload a theme to the HuggingFace hub. <br> This requires a HuggingFace account. <br>
Parameter | Description |
---|---|
repo_name str required | The name of the repository to store the theme assets, e.g. 'my_theme' or 'sunset'. |
org_name str | None default: None | The name of the org to save the space in. If None (the default), the username corresponding to the logged in user, or hƒ_token is used. |
version str | None default: None | A semantic version tag for theme. Bumping the version tag lets you publish updates to a theme without changing the look of applications that already loaded your theme. |
hf_token str | None default: None | API token for your HuggingFace account |
theme_name str | None default: None | Name for the name. If None, defaults to repo_name |
description str | None default: None | A long form description to your theme. |
private bool default: False |
gradio.Base.from_hub(repo_name, ···)
Load a theme from the hub. <br> This DOES NOT require a HuggingFace account for downloading publicly available themes. <br>
Parameter | Description |
---|---|
repo_name str required | string of the form <author>/<theme-name>@<semantic-version-expression>. If a semantic version expression is omitted, the latest version will be fetched. |
hf_token str | None default: None | HuggingFace Token. Only needed to download private themes. |
gradio.Base.load(path, ···)
Load a theme from a json file. <br>
Parameter | Description |
---|---|
path str required | The filepath to read. |
gradio.Base.dump(filename, ···)
Write the theme to a json file. <br>
Parameter | Description |
---|---|
filename str required | The path to write the theme too |