Changelog - 2026-10-09
useDocumentTitle and useHtmlLang
New FeatureIn one line. @venizia/ardor-admin gains useDocumentTitle, which sets the tab title for a screen, and useHtmlLang, which keeps <html lang> on the UI locale. Both are re-exported from @venizia/ardor.
What changed
useDocumentTitle({ title, appTitle, separator, enabled }). The tab title is the non-emptytitlesegments, thenappTitle, joined byseparator(default' · ').titleis one segment or an array;false,null,undefinedand''are skipped.enableddefaults totrue.- Restore. When the title changes or the component unmounts, the hook puts back the title it replaced, so no reset on navigation is needed. It restores only while the tab still shows the title the hook wrote, so a locale switch or two calls with the same title no longer leave a stale title.
useHtmlLang(). Setsdocument.documentElement.langto the ra-coreuseLocaleState()locale and follows every change, so screen readers pick the right voice.
tsx
import { useDocumentTitle, useHtmlLang } from '@venizia/ardor';
export function OrdersPage() {
useHtmlLang();
useDocumentTitle({ title: 'Orders', appTitle: 'Back Office' });
return null;
}
// tab title: Orders · Back OfficeWho is affected
- Applications with their own title or
langhook. They can switch to these. - Everyone else. No action needed.
Call useDocumentTitle from one component per screen: React runs child effects before parent effects, so a call in a parent wins over a call in a child. useHtmlLang needs the ra-core locale state.