IconButton
- Library
- Allium Design Systemweb-only
- Repository
- github.com/telus/allium-design-system
- Package
- npmjs.com/package/@telus-uds/ds-allium
- Package version
- 1.14.0
Introduction
import { IconButton } from '@telus-uds/ds-allium'
IconButton can be used to control actions or navigation on pressing a universally-recognizable icon that doesn’t need visually displayed accompanying text (but may include an accessibility label for screen reader users).
The button shows the icon only, which is limited to a sub-set of icons (Add, Close, PlayVideo, Subtract, ArrowLeft, ArrowRight, CaretDown, CaretUp).
Guidance
- Use
accessibilityLabel
to provide context for screen reader users - Use
iconName
to set the icon: one of Add, Close, Play, Subtract, ArrowLeft, ArrowRight, CaretDown, CaretUp - Pass a
href
if the IconButton should render as an<a>
link with a URL as a target. Rendered semantic role may also be controlled usingaccessibilityRole
(default role isbutton
ifhref
is not provided)
Accessibility
- Pass an
accessibilityLabel
so that the icon button is accessible to screen readers.
Platform considerations
The version of IconButton
bundled in @telus-uds/ds-allium
is intended only for web use and
is set up for common web iconography.
A cross-platform version of IconButton
is available from @telus-uds/components-base
. It does not
prescribe specific icons, so should be used as a base on to which platform-specific or cross-platform
components are built that restrict use to a subset of platform-appropraite icons.
Props
Name | Type | Default | Description |
---|---|---|---|
icon | () => {} | ||
iconName* | "Add" | "Subtract" | "Close" | "Play" | "CaretUp" | "CaretDown" | "ChevronLeft" | "ChevronRight" | "ArrowLeft" | "ArrowRight" |
Figma
Variants
There are three sizes available (default, small, large) and "inverse" and "raised" stylistic variants.
Default
The default choice on light backgrounds.
Inverse
A light icon button for use on dark backgrounds.
Raised
Uses a solid background and shadow effect, for sitting above other content.
Feedback
- Spotted a problem with this component? Raise an issue on GitHub
- See any existing issues for this component
- Contact the team on slack in #ds-allium-support