A square button for icon-only actions.
import { IconButton } from '@oztix/roadie-components'
Always provide an aria-label since there is no visible text.
The default size is md. All sizes maintain square proportions.
The legacy icon-xs / icon-sm / icon-md / icon-lg size literals are still accepted for backwards compatibility (marked @deprecated in TypeScript) but new code should use the plain xs / sm / md / lg names above.
Pass href to render the icon button as a routed anchor. Roadie picks the right element + safety attributes based on the href shape: internal routes go through your configured RoadieLinkProvider; external (https://…) auto-render with target='_blank' rel='noopener noreferrer'; protocol hrefs (mailto: / tel: / sms:) render plain anchors.
Hover each button. The browser status bar shows the resolved href exactly as Roadie rendered it (note the mailto: / tel: URLs vs the routed paths). See Linking for the full reference, including external / target / rel overrides.
Add download to an href icon button to save the file instead of opening it, optionally under a filename.
For full element control, or anchor props href doesn't cover (hreflang, referrerPolicy), use Base UI's render prop. It keeps Base UI's button semantics, role='button' and Space activation, so the element you pass is yours to make accessible. Passing both href and render triggers a one-shot dev warning. render wins, and provider routing is silently disabled.
aria-label to describe the action since there is no visible text. Interface copy says how to word it.<IconButton href={…}> and wire RoadieLinkProvider at the app root. The legacy LinkIconButton component is @deprecated and will be removed in v3.0.0.CSS class applied to the element, or a function that returns a class based on the component's state.
Pass a URL to render the button as a routed anchor instead of a `<button>`. Internal hrefs route through the configured `RoadieLinkProvider` (or fall back to plain `<a>`); external hrefs (`http(s)://`, `//…`) render as `<a target='_blank' rel='noopener noreferrer'>`; `mailto:` / `tel:` / `sms:` render as plain `<a>`. Pair with `external`, `target`, or `rel` to override the defaults.
Force external-link treatment regardless of `href` shape. Useful for first-party URLs that should still open in a new tab, or for an `https://` URL that should route internally through the provider.
Override the auto `target='_blank'` default on external hrefs.
Download the `href` instead of navigating, optionally as this filename.
Icon-button sizing. Use `'xs' | 'sm' | 'md' | 'lg'` (plain) — the `'icon-*'` aliases are accepted for backwards compatibility but discouraged.
Defaults to md.
Inherited from HTMLAttributes
Override the auto `rel='noopener noreferrer'` default on external hrefs.
Inherited from ButtonProps
Whether the button should be focusable when disabled.
Defaults to false.
Inherited from NativeButtonProps
Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if the rendered element is not a button (for example, `<div>`).
Defaults to true.