check
Code copied to clipboard.
close
menu

Icon Button

Icon buttons are like normal buttons except their size is controlled via fontClass, and they're perfectly circular. They contain an Icon and use a state layer to control interactivity.

Example Instance

<IconButton key="search" icon="search" variant="text" color="surfacecontainer" />
content_copy
warning
Note: The above snippet omits import statements and surrounding markup. It's assumed you'd be pasting this inside the return block of an existing functional component.

Installation

Next.js

Note: Other React frameworks are not currently supported, but they might still work. Try at your own risk.

Method Instructions
LiftKit CLI
From any Next.js project, run the following command in your terminal.
npm run add icon-button
content_copy
Github open_in_new View on Github

Props

Unique

Props unique to this component.

Name Required Type Description Default Val
className no string Additional CSS classes to apply undefined
color no LkColorWithOnToken Controls the button's color undefined
fontClass no LkFontClass Controls the size directly when provided undefined
icon yes IconName The icon to render inside the button
size no "xs" | "sm" | "md" | "lg" | "xl" Controls the size of the icon button undefined
variant no "fill" | "outline" | "text" Visual style variant of the button undefined

Common

Props with globally-defined behavior that are used in multiple components.

Common PropsStatus
{children}Not Supported
Native HTML attributesSupported