Marker
uiable/markerFreeComponent
Marker component.
Live preview
live · rendered by the registry
Rendered by uiable on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://uiable.com/r/marker.jsonSource
1import { ComponentProps } from "react"2import { mergeProps } from "@base-ui/react/merge-props"3import { useRender } from "@base-ui/react/use-render"4import { cva, VariantProps } from "class-variance-authority"5import { cn } from "@/lib/utils"67const markerVariants = cva(8 "group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground",9 {10 variants: {11 variant: {12 default: "",13 separator:14 "before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border",15 border: "border-b border-border pb-2",16 },17 },18 }19)2021function Marker({22 className,23 variant = "default",24 render,25 ...props26}: useRender.ComponentProps<"div"> & VariantProps<typeof markerVariants>) {27 return useRender({28 defaultTagName: "div",29 props: mergeProps<"div">(30 {31 className: cn(markerVariants({ variant, className })),32 },33 props34 ),35 render,36 state: {37 slot: "marker",38 variant,39 },40 })41}4243function MarkerIcon({ className, ...props }: ComponentProps<"span">) {44 return (45 <span46 data-slot="marker-icon"47 aria-hidden="true"48 className={cn(49 "size-4 shrink-0 [&_svg:not([class*='size-'])]:size-4",50 className51 )}52 {...props}53 />54 )55}5657function MarkerContent({ className, ...props }: ComponentProps<"span">) {58 return (59 <span60 data-slot="marker-content"61 className={cn(62 "min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",63 className64 )}65 {...props}66 />67 )68}6970export { Marker, MarkerIcon, MarkerContent, markerVariants }
What it pulls in
npm packages
Files it writes
More from uiable
All 712 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | uiable | Components | Free | 2 deps | |
| Alertalert | uiable | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | uiable | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | uiable | Components | Free | no deps | |
| Attachmentattachment | uiable | Components | Free | 2 deps | |
| Avataravatar | uiable | Components | Free | 1 dep | |
| Badgebadge | uiable | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | uiable | Components | Free | 2 deps |
