Though there is a little bit of disagreement on the definition (some maintain historical fantasy is anything that seems as if it could have happened in our world), most of the time, historical fantasy is set firmly in our historical world, with magic. What I particularly love is that it combines the kind of historical detail I adore, with creative glimpses at what our world might look like if things were different.
Especially if, say, there was magic.
As a writer, I love historical fantasy because some of the world-building has been done for me (and I enjoy the rabbit hole that is historical research: I'm currently reading the correspondence between the British ambassador in Vienna in 1848 and Prime Minister Palmerston. Sounds boring, but there are some fascinating tid-bits about how the British viewed the Hungarian conflict I'm writing about). But I also love the freedom to explore "what ifs"--what if social prestige depended on magic? And what if that magic were controlled by a strict society? What if minority groups contravened those rules? And so on.
I'm currently making a list of historical fantasy--as a genre, I'd love to better understand its history. I'm not ready to write the history of the genre, but I thought I'd share some of my favorite YA historical fantasy, set in nineteenth-century Britain.
Patricia Wrede, MAIRELON THE MAGICIAN, SORCERY AND CECILIA

Sorcery and Cecilia is equally delightful (co-written with Caroline Stevermer): a series of letters between cousins Kate, in London for her season, and Cecilia, sequestered at home. Quite accidentally, they stumble into a heinous magical plot, and hijinks ensue.

Stephanie Burgis' delightful middle grade series isn't technically YA, but they have the signature combination of wit, warmth, Regency era and magic that I love. Kat is a fledgling magician who has to use her powers to save her family from magical plots and ne'er-do-wells. The book has magic, romance, highwayman, and sinister villains. What more could you want?
Kiersten White, ILLUSIONS OF FATE

But she quickly gets embroiled with the delightful Finn, drawn first to his sparkling hair, and later to his wit. He's being threatened by the enigmatic Lord Downpike, and soon Jessamin finds herself under attack as well, using her wits to save herself and the boy she's rapidly coming to love. Charming, atmospheric, and a quick read, this is great book to dip your toes in historical fantasy.
Libba Bray, A GREAT AND TERRIBLE BEAUTY

Garth Nix, NEWT'S EMERALD

[Edited to add] Franny Billingsly, CHIME


I don't know how I forgot this one: this dark, charming, goblin-filled story about two girls drawn in by a goblin king in search of a bride to save his kingdom captures a wonderful fairy-tale quality. The romance was heart-wrenching and lovely and if the story meandered for a little in the middle, I adored the characters enough to make the journey worthwhile.
What are some of your favorite historical fantasy books? (I've got Elizabeth May's The Falconer and Robin LeFevers' Dark Assassin books on my TBR list . . .).