Icon Picker

Searchable Lucide icon grid with arrow-key navigation, roving tabindex, recent icons, and tags search.

@drift-ui/icon-pickerRegistry JSONOpen in v0
folder-openSelected
Selected:folder-open

Keyboard

↑↓←→
Move through the grid
HomeEnd
First or last icon in the row
PageUpPageDown
Previous or next section
EnterSpace
Pick the focused icon
On this page

Installation

The CLI also installs the npm packages and registry items it builds on, and reads the style in your components.json to pick the Base UI or Radix build.

Usage

icon-picker-usage.tsx
"use client"

import { useState } from "react"
import { IconPicker } from "@/components/ui/icon-picker"

export function Example() {
  const [icon, setIcon] = useState("folder-open")

  return (
    <IconPicker
      value={icon}
      onValueChange={setIcon}
      aria-label="Choose icon"
    />
  )
}

Examples

In a popover

IconPicker is an inline panel, so place it in a Popover for a compact icon selector. Selecting an icon updates the state and closes the popover.

Curated icon set

Pass a constrained list of icon names and search tags via icons to restrict choices to category-relevant icons.

folderSelected
Project icon:folder

API reference

IconPicker

An inline Lucide icon panel with search, roving tabindex, arrow-key navigation, tags search, and recently used icons. Icons load dynamically on demand.

Prop
valuestringControlled Lucide icon name (e.g. "folder-open").
defaultValuestringDefault""Initial uncontrolled Lucide icon name.
onValueChange(value: string) => voidCalled when an icon is selected.
onSelect(value: string) => voidAlias callback called when an icon is selected.
icons(string | { name: string; tags?: string[] })[]Optional custom icon subset. Defaults to all Lucide icons.
tagsRecord<string, string[]>Additional search tags keyed by icon name.
columnsnumberDefault6Number of columns in the icon grid.
maxRecentnumberDefault16Maximum number of recently used icons to preserve.
storageKeystringDefault"drift-ui:icon-picker"localStorage key for persisting recently used icons.

Other props go to the <div>.

searchIcons

searchIcons(icons: IconItem[], query: string, customTags?: Record<string, string[]>): IconItem[]

Pure logic helper in @/lib/icon-picker-utils that matches query against icon names, hyphenated segments, and tags.

Source

components/ui/icon-picker.tsx