A Glance widget that surfaces a random Pokémon with type-aware styling, stats, and species badges.
Overview • Quick Start • Widget Options • Widget Details • References
![]() |
![]() |
![]() |
| Normal | Legendary | Mythical |
![]() |
![]() |
| Artwork Popover | Name Popover |
| Widget | Purpose | Best Fit | File |
|---|---|---|---|
| Random Pokemon | Show a random Pokemon with official artwork, type chips, base stats, height, weight, optional legendary or mythical badges, a configurable display language, and a hover popover for localized species names | small |
widgets/random-pokemon.yml |
The widget is designed for a compact sidebar-style Glance placement and renders directly from public APIs without any additional backend or local service:
- native time-based pseudo-random Pokemon selection inside the Glance template
- Pokemon data and artwork from PokeAPI
- type-aware gradient accents around the artwork
- built-in fallbacks for Pokemon lookup errors and missing artwork
- Glance derives a time-based pseudo-random Pokemon ID inside the template from the current day-of-year plus the current hour, minute, and second within the configured Pokédex range.
- The widget loads the Pokemon record from
https://pokeapi.co/api/v2/pokemon/<id>. - It loads the species record from
https://pokeapi.co/api/v2/pokemon-species/<id>. - The template renders artwork, type colors, stats, physical attributes, optional
LegendaryorMythicalbadges, the configured display language, and localized species names in a native Glance hover popover.
- Copy
widgets/random-pokemon.ymlinto your Glancewidgets/folder. - Include the widget in
glance.yml. - Reload Glance.
No environment variables are required.
pages:
- name: Fun
columns:
- size: small
widgets:
- $include: widgets/random-pokemon.yml
options:
language: en
min-id: 1
max-id: 151Reference config: examples/glance.yml
| Option | Type | Default | Description |
|---|---|---|---|
min-id |
int | 1 |
Lowest Pokedex number allowed for the random selection |
max-id |
int | 1025 |
Highest Pokedex number allowed for the random selection |
language |
string | en |
PokeAPI language code used for the visible Pokemon name, with automatic fallback to English if that translation is unavailable |
Behavior notes:
- the widget clamps values to the supported national Pokedex range of
1-1025 - if
min-idis greater thanmax-id, the widget swaps them automatically languageexpects a PokeAPI language identifier such asen,de,fr,ja,ja-Hrkt,ko,zh-Hans, orzh-Hant- if the selected
languageis missing for a Pokemon species, the widget falls back to English automatically - this makes
Gen 1 only,Gen 1-4, orGen 4 onlysetups possible without editing the template
| Generation | Pokedex Range |
|---|---|
| Gen 1 | 1-151 |
| Gen 2 | 152-251 |
| Gen 3 | 252-386 |
| Gen 4 | 387-493 |
| Gen 5 | 494-649 |
| Gen 6 | 650-721 |
| Gen 7 | 722-809 |
| Gen 8 | 810-905 |
| Gen 9 | 906-1025 |
Gen 1 only
- $include: widgets/random-pokemon.yml
options:
language: en
min-id: 1
max-id: 151Gen 1-4
- $include: widgets/random-pokemon.yml
options:
language: en
min-id: 1
max-id: 493Gen 4 only
- $include: widgets/random-pokemon.yml
options:
language: en
min-id: 387
max-id: 493German display name
- $include: widgets/random-pokemon.yml
options:
language: de
min-id: 1
max-id: 1025- type: custom-api
title: Random Pokemon
cache: 5m
options:
language: en
min-id: 1
max-id: 1025
template: |
# Random ID lookup within the configured range, Pokemon data requests,
# species lookup, and rendering are handled inside the template
...Hovering the visible Pokemon name opens a native Glance HTML popover.
- the popover header keeps the English species name and Pokédex number centered at the top
- the body lists localized species names in two columns:
flag + localized language labelon the left and the localized name on the right - the visible card title follows
options.language, while the popover remains a multilingual reference view - unsupported or missing translations fall back to English for the visible card title
Hovering the artwork opens a separate native Glance HTML popover for visual details.
- the popover shows up to four sprite variants:
official,official shiny,home, andhome shiny - compact cry chips let you play either the
latestorlegacyPokemon cry directly from the artwork popover - localized species metadata such as genus uses
options.language, with English fallback when needed - compact extra metadata includes generation, capture rate, gender distribution, and form count when applicable
- the Pokédex flavor text also follows
options.language, with English fallback when that language has no matching entry
- the widget is tuned for a
smallGlance column - each refresh derives a new time-based pseudo-random Pokemon from the current day-of-year plus the current hour, minute, and second, then caches the result for
5m - the selection range can be limited with
min-idandmax-id - the selection is deterministic for a given point in time, so repeats can happen more often than with a true random source
- the visible Pokemon name follows
options.language, defaulting to English - hovering the Pokemon name opens a native Glance popover with the English species name and Pokédex number centered at the top, then flags plus localized language labels on the left and localized names on the right
- hovering the artwork opens a second popover with alternate sprite versions and a localized Pokédex entry
- the artwork circle, divider accents, and artwork shadow adapt to the Pokemon type palette
- dual-type Pokemon blend primary and secondary type colors in the accent treatment
- species data adds
LegendaryandMythicalbadges when available - official artwork falls back to the default sprite if the high-resolution image is missing
- if one of the public APIs is unavailable, the widget renders a clear error state instead of a broken card
-
Dashboard platform:
glanceapp/glance
Widget implementation targets Glancecustom-apibehavior and config style. -
Pokemon data:
PokeAPI
Pokemon details, artwork references, species metadata, and type information. -
Original widget inspiration:
KintsugiUwUon Discord (kintsugiuwu)
Credit for the original random Pokemon widget concept this version was built from.
This widget was developed with support from OpenAI Codex and a custom glance-skill.
MIT License © 2026




