Backstage UI is a component library for Backstage.
Install the package via Yarn:
cd <package-dir> # if within a monorepo
yarn add @backstage/ui
BUI uses React Aria for link activation, including keyboard input, modified
clicks, downloads, and event cancellation. Backstage apps configure BUI routing
automatically. A standalone app can configure client navigation with
BUIProvider's useNavigation prop:
type BUINavigation = {
navigate: (
href: string,
options?: { replace?: boolean; state?: unknown },
) => void;
createHref: (href: string) => string;
pathname: string;
};
The hook runs at each consuming control's position in the app. Return a
createHref function and a navigate function that interpret relative targets
from that same position. Resolved hrefs and pathname must include the deployment
basename. createHref is a normal function so collections can resolve multiple
items. Absolute URLs remain browser-owned.
BUI uses browser navigation unless the app supplies a host hook or a React Aria
RouterProvider from the control's installation. BUI no longer detects an
ambient React Router. Nested BUI providers inherit the host hook.
useNavigation. React Router is no longer a BUI peer dependency.routerOptions fields replace and state. Options
specific to React Router are no longer part of the BUI contract.useNavigation from @backstage/frontend-plugin-api.
See page router integration.When creating changesets for component-specific changes, add component metadata to help maintain documentation:
---
'@backstage/ui': patch
---
Fixed size prop handling for Avatar component.
Affected components: Avatar
Guidelines:
Affected components: Button, ButtonLink, ButtonIconThe changelog sync tool will parse these tags and update the documentation site automatically.
Components used by Backstage plugins and apps