Is the current royal family explicitly codified in UK law as THE royal family?

Is the current royal family explicitly codified in UK law as THE royal family? Or is there a law/act that states that Charles III is the current monarch? I understand there are acts of succession that spell out the line of succession relative to the current monarch. I believe there are laws that specify that the current monarch acts as Head of State (and what their powers are).

I am curious how explicit UK law is in specifying the exact bloodline – whether it specifies the House of Windsor (or whatever the house is named under Charles III), etc.

For example: Could a popular Duke challenge Charles to joust for the crown? If he wins, is it just a matter of coronating the Duke and making the House of CaveMike the new official house? Or would there be a ton of legal issues to untangle?

(I realize there might not be a clear-cut answer and I’m fine if this is better suited to IMHO).

[edited the link]

The Act of Settlement 1701 settled the throne on the Electress Sophia of Hanover (a Protestant granddaughter of James VI/I) and “the heirs of her body being Protestants”; that phrase has an explicit meaning in English common law, and Charles III is the current person who is the heir of her body.

(Subsequent acts have changed the rules a little bit; the Succession to the Crown Act 2013, for example, abolished the “boys come before girls” rule, but the Act of Settlement is still the central law.)

Of course, Parliament can do whatever it likes, and if a popular duke challenges Charles and wins, Parliament can change the law and make CaveMike and his heirs the new ruling house, but yes, there’d be a ton of issues, including the part that all of the other Commonwealth realms (14 of them, at least as of today, including Canada, Australia, Jamaica, the Solomon Islands, etc.) would have to agree to the change.

While much of all this is codified in law, there is also much that is just precedent and custom. I guess that even constitutional lawyers don’t fully understand everything and those of us who have spent all our lives with it only have a vague knowledge.

When you realise that Westminster Hall, where the Queen is currently lying in state as the multitudes file past, is 1,000 years old, and Westminster Abbey, where the funeral service will be held was built in the 13th century, it gives you some idea of the history. Although monarchs have only been lying in state in Westminster Hall since 1910 (Edward V11)

And there’s a difference between the “working royals” and blood relatives who are members of the family but in a sense not “The Family”. AFAIK that’s a matter for the sovereign to decide, rather than legislation - though it might require discussion with ministers if it means adjusting the overall Sovereign Grant. I believe the Continental monarchies might put such differences into legislation.

Just came here to point out that this has already happened, in the Glorious Revolution of 1688. Essentially, what happened was that Parliament was tired of King James II and VII (II in England, VII in Scotland) because of his pro-Catholic policies. Envoys of Parliament invited William of Orange, who was governor of several Dutch provinces, to take over. William landed troops in England, James fled without battle, and William was proclaimed king, with the whole thing subsequently legitimised by acts of Parliament.

Although, to be fair, the English respect for dynastic legitimacy was still evident in this: The reason why William was chosen was that he was married to James’ daughter Mary. The two would rule jointly as monarchs of equal rank.

William was also a nephew of James and the nearest legitimate male Protestant in the line of succession - and he had a track record as a military leader against Louis XIV (whose Revocation of the Edict of Nantes and subsequent repression of French Protestants had overshadowed James’s reign and amplified anxieties about his religious intentions).