Icon Block

A block for icon, emoji, or image display.

Installation

pnpm add @notion-kit/ui

Options


Size

Use the size prop to control the size of the button.

Examples


Lucide Icon

Image Url

Text

API Reference

IconBlock

PropTypeDefaultDescription
icon*IconData-The icon data.
size"sm" | "md" | "lg" | "xl""sm"The size of the block.
fallbackstring-The fallback string to display when an image can not be loaded.

type IconData

There are 4 types of icons:

  1. emoji: An emoji icon, whose src is simply the emoji string. See Emoji Cheat Sheet.
  2. lucide: A Lucide icon, whose src is the name of the icon. See Lucide Icons.
  3. url: An image URL. The image will be displayed in the block.
  4. text: A text string. Only the first letter of src will be displayed in the block.
PropTypeDescription
type*"emoji" | "lucide" | "url" | "text"The icon type.
src*stringThe source of the icon.
colorstringThe color of the lucide icon.