Skip to main content

IconButtonProps

Props for IconButton.

This is an interface exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import type { IconButtonProps } from "@mapcairn/map";

interface IconButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "aria-busy" | "aria-controls" | "aria-disabled" | "aria-expanded" | "aria-label" | "aria-pressed" | "children" | "disabled" | "type">

Properties​

busy​

readonly busy?: boolean;

Shows a loader in place of the icon and sets aria-busy. Clicks are ignored while busy. The loader spins only when motion is allowed.

controls​

readonly controls?: string;

Sets aria-controls to the id of the element it opens or changes.

disabled​

readonly disabled?: boolean;

Disables the action with aria-disabled. The button stays focusable so its name is still discoverable, and clicks do nothing.

expanded​

readonly expanded?: boolean;

Sets aria-expanded for a button that opens a popover or panel.

icon​

readonly icon: IconComponent;

The icon to show, imported by name from @phosphor-icons/react.

label​

readonly label: string;

The accessible name. Describe the action, for example "Zoom in".

mirrorInRtl​

readonly mirrorInRtl?: boolean;

Flips the icon when the page reads right to left, for one that points along the reading direction.

pressed​

readonly pressed?: boolean;

Makes it a toggle. Renders aria-pressed and a shape change (tinted fill plus a bar under the icon). Leave undefined for a plain action button.

size​

readonly size?: "control" | "compact";

control is 48 px square and compact is 44 px. Defaults to control.

See also​

Source: packages/map/src/ui/IconButton/IconButton.tsx:9