Icon and icon button
Data displayRenders named SVG icons and provides supporting icon-button and decorative disk primitives.
Try it
Add to your project
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/icon.jsonThe command includes the component’s shared dependencies. Your project keeps editable source files.
Include the complete example
This example also composes animated-icon, button, input, label. Install its parts together:
npx shadcn@latest add https://luv-jeri.github.io/cojeev-ui/r/icon.json https://luv-jeri.github.io/cojeev-ui/r/animated-icon.json https://luv-jeri.github.io/cojeev-ui/r/button.json https://luv-jeri.github.io/cojeev-ui/r/input.json https://luv-jeri.github.io/cojeev-ui/r/label.jsonUsing icon and icon button
Browse and search the icon pack in the live example. AnimatedIcon adds configurable motion; StateChevron follows open and closed trigger state.
Choose a supported icon name and size, then pair it with text to reinforce an action or status.
Use IconButton for an icon-only action and Disk when the icon needs a containing surface.
Friendly action aliases include check-circle, close, alert, loader, refresh and trash.
Default feedback responds once to the nearest enabled control with action-specific SVG-part motion. Set feedback={false} to opt out; draw mode owns its own animation.
The iconActionNames and iconActionDescriptions exports describe all 100 semantic actions. The searchable example pages through the complete family; new geometry retains Lucide and Feather license notices.
API
Compose the exported parts below. The prop types are read from the React source during the registry build.
Native element or underlying primitive props are inherited where declared, including accessible labels, event handlers and refs.
IconProps
| Prop | Type | Required |
|---|---|---|
name | string | undefined | Yes |
size | "default"|"sm"|"lg" | No |
draw | boolean | No |
feedbackOne-shot feedback from the nearest control. Disable when another owner animates this icon. | boolean | No |
DiskProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | "pink" | "yellow" | "blue" | "olive" | "ink" | "cream" | "beige" | null | undefined | No |
size | "default" | "sm" | "lg" | null | undefined | No |
IconButtonProps
| Prop | Type | Required |
|---|---|---|
variant | "default" | "pink" | "ink" | "cream" | "dashed" | "beige" | null | undefined | No |
size | "default" | "sm" | "lg" | "xl" | null | undefined | No |
Accessibility
Icons are hidden from assistive technology by default; give an IconButton its own accessible action name.
States and appearance
For conditional content, keep a MotionPresence boundary around keyed MotionSurface children. The shared entrance and exit states work with native primitives and respect your motion preference.
Try pointer and keyboard interaction, and switch the appearance control in the navigation to compare light and dark mode. Motion respects reduced motion preferences.