Inspector Icon

Settings row that names the chosen icon and shows it on the right; pressing the row opens a searchable palette below it, width-matched to the row, with clearing offered at the foot of it. The icon set is passed in, so the row never bundles an icon library of its own.

Installation

Adds the component and everything it depends on to your project.

npx shadcn add https://ui.beste.co/component/r-base/inspector-icon

New here? Read the installation guide.

Usage

The import and the props worth knowing about, in one place.

import { InspectorIcon } from "@/components/beste/component/inspector-icon";
import { HeartIcon, SparklesIcon, StarIcon } from "lucide-react";

const icons = [
  { name: "sparkles", icon: SparklesIcon },
  { name: "star", icon: StarIcon },
  { name: "heart", icon: HeartIcon, label: "Favourite" }, // label is what search and the tooltip use
];

<InspectorIcon label="Icon" icons={icons} defaultValue="star" />

<InspectorIcon
  label="Badge icon"
  icons={icons}
  value={iconName}
  onValueChange={setIconName}
  onOpenChange={(open) => console.log("palette open:", open)}
  clearable                 // adds a "Remove Icon" button at the foot of the palette
  columns={6}               // icons per row in the palette, 8 by default
  searchable                // on by default past sixteen icons
  emptyMessage="Nothing matches"
  tone="outline"            // "muted" (default) | "outline" | "ghost"
  size="sm"                 // "sm" | "default" | "lg"
/>

Playground

Turn the props on the right; the snippet under them is what you would write to get what you see.

Usage
import { InspectorIcon } from "@/components/beste/component/inspector-icon";

<InspectorIcon
  label="Icon"
  className="w-72"
  defaultValue="zap"
  clearable
  icons={[{"name":"sparkles","icon":{"displayName":"Sparkles"}},{"name":"star","icon":{"displayName":"Star"}},{"name":"heart","icon":{"displayName":"Heart"}},{"name":"flame","icon":{"displayName":"Flame"}},{"name":"zap","icon":{"displayName":"Zap"}},{"name":"sun","icon":{"displayName":"Sun"}},{"name":"moon","icon":{"displayName":"Moon"}},{"name":"cloud","icon":{"displayName":"Cloud"}},{"name":"leaf","icon":{"displayName":"Leaf"}},{"name":"globe","icon":{"displayName":"Globe"}},{"name":"compass","icon":{"displayName":"Compass"}},{"name":"map-pin","icon":{"displayName":"MapPin"}},{"name":"rocket","icon":{"displayName":"Rocket"}},{"name":"shield","icon":{"displayName":"Shield"}},{"name":"gift","icon":{"displayName":"Gift"}},{"name":"tag","icon":{"displayName":"Tag"}},{"name":"bookmark","icon":{"displayName":"Bookmark"}},{"name":"bell","icon":{"displayName":"Bell"}},{"name":"calendar","icon":{"displayName":"Calendar"}},{"name":"camera","icon":{"displayName":"Camera"}},{"name":"image","icon":{"displayName":"Image"}},{"name":"layers","icon":{"displayName":"Layers"}},{"name":"music","icon":{"displayName":"Music"}},{"name":"activity","icon":{"displayName":"Activity"}}]}
/>

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
label*stringLabel rendered on the left, inside the row.
iconLucideIconOptional leading icon shown before the label.
iconsInspectorIconChoice[]The icons on offer. Passing the set rather than importing one keeps this component out of the business of bundling an icon library — hand it the subset that belongs to whatever is being edited.
valuestringControlled selection, by `name`. Pair it with `onValueChange`.
defaultValuestringInitial selection in uncontrolled mode.
onValueChange(name: string) => void
onOpenChange(open: boolean) => voidFires when the palette opens or closes.
clearablebooleanOffer a clear button once something is selected.
searchablebooleanShow the search field. Defaults to on once there are more than sixteen icons.
columnsnumber8Icons per row in the palette.
emptyMessagestringMessage shown when nothing matches the search.
disabledbooleanBlock interaction and dim the row.
tone"muted" | "outline" | "ghost""muted"Surface treatment: filled (default), hairline outline, or bare until hover.
size"sm" | "default" | "lg""default"Row height preset.
classNamestring
aria-labelstringAccessible name. Falls back to `label`.

More Inspector components

View all Inspector

Inspector Border

Settings row for a border: the row draws one exactly as described beside a summary of it, and opens an editor with the sides as icon toggles and the width, style and colour under them, each one a row of the family.

Inspector Media

Settings row for an image or a video: the asset itself as a thumbnail on the right, and pressing the row opens a width-matched editor with the URL, a preview and a remove. Given a picker of your own, it hands the choosing to your media library instead.

Inspector Variants

The choice that has to be seen to be made: a template, a layout, a chart type. Each option is a picture, normally a rendered screenshot passed as a URL, or markup for the choices no photograph would show. The row is the trigger, the grid is width-matched to it, and the captions under the pictures can be dropped for a set whose pictures say everything.

Inspector Shadow

Settings row for a box shadow: the row shows the shadow itself, and opens an editor holding a larger preview with offset, blur, spread and colour under it, each one a row of the family.

Dark Mode

Inspector Segmented

Settings row whose choices sit side by side on the right, with a marker that slides between them: the readable alternative to a switch when the two states deserve names, and the compact one to a select at three or four options.

Inspector Select

Settings row that pairs a label with its current choice inside one pill, opening a width-matched dropdown below: option icons, colour swatches, descriptions and grouped sections, on top of the accessible shadcn select.