MicroClub Select
mcoli-ui-registry/mc-selectFreeComponent
A select component for MicroClub UI
Live preview
live · rendered by the registry
Rendered by mcoli-ui-registry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://mcoli-ui.microclub.info/r/mc-select.jsonSource
1'use client';23import * as React from 'react';4import { Select as SelectPrimitive } from '@base-ui/react/select';5import { CheckIcon, ChevronDownIcon, ChevronUpIcon, SearchIcon } from 'lucide-react';67import { cn } from '@/lib/utils';89export type McSelectVariant =10 | 'default'11 | 'icon-leading'12 | 'avatar-leading'13 | 'dot-leading'14 | 'search';1516const McSelect = SelectPrimitive.Root;1718function McSelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {19 return (20 <SelectPrimitive.Group21 data-slot="select-group"22 className={cn('scroll-my-1', className)}23 {...props}24 />25 );26}2728function McSelectValue({ className, ...props }: SelectPrimitive.Value.Props) {29 return (30 <SelectPrimitive.Value31 data-slot="select-value"32 className={cn('flex flex-1 text-left', className)}33 {...props}34 />35 );36}3738function McSelectLabel({ className, children }: { className?: string; children: React.ReactNode }) {39 return (40 <label41 className={cn(42 'mb-1.5 block text-sm font-medium leading-5',43 'text-muted-foreground',44 className45 )}46 >47 {children}48 </label>49 );50}5152interface McSelectTriggerProps extends SelectPrimitive.Trigger.Props {53 size?: 'sm' | 'default';54 variant?: McSelectVariant;5556 leadingIcon?: React.ReactNode;5758 leadingAvatar?: React.ReactNode;5960 dotColor?: string;61}6263function McSelectTrigger({64 className,65 size = 'default',66 variant = 'default',67 leadingIcon,68 leadingAvatar,69 dotColor,70 children,71 ...props72}: McSelectTriggerProps) {73 const isSearch = variant === 'search';7475 return (76 <SelectPrimitive.Trigger77 data-slot="select-trigger"78 data-size={size}79 data-variant={variant}80 className={cn(81 'flex w-80 items-center gap-2 rounded-lg outline-none select-none',82 'px-3.5 py-2.5 text-sm whitespace-nowrap',83 'transition-all duration-150',8485 isSearch86 ? ['bg-input', 'border border-border', 'shadow-sm']87 : ['bg-input', 'border border-border', 'shadow-sm'],8889 'data-placeholder:text-muted-foreground',9091 'data-popup-open:border-ring',92 'data-popup-open:ring-4 data-popup-open:ring-ring',93 'focus-visible:border-ring',94 'focus-visible:ring-4 focus-visible:ring-ring',9596 'disabled:cursor-not-allowed disabled:opacity-50',97 'aria-invalid:border-destructive aria-invalid:ring-4 aria-invalid:ring-destructive',9899 'data-[size=default]:h-11',100// … truncated
What it pulls in
npm packages
Files it writes
More from mcoli-ui-registry
All 42 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| MicroClub Accordionmc-accordion | mcoli-ui-registry | Components | Free | 2 deps | |
| MicroClub Alertmc-alert | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Alert Dialogmc-alert-dialog | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Avatarmc-avatar | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Badgemc-badge | mcoli-ui-registry | Components | Free | 1 dep | |
| MicroClub Breadcrumbmc-breadcrumb | mcoli-ui-registry | Components | Free | 2 deps | |
| MicroClub Buttonmc-button | mcoli-ui-registry | Components | Free | 2 deps | |
| MicroClub Calendarmc-calendar | mcoli-ui-registry | Components | Free | 3 deps |
