marker
shadcn-solidjs/markerFreeComponent
shadcn-solidjs publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn-solidjs on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcn-solidjs.com/r/marker.jsonSource
1import type { PolymorphicProps } from "@kobalte/core/polymorphic";2import { Polymorphic } from "@kobalte/core/polymorphic";34import { cn } from "~/lib/utils.ts";5import type { VariantProps } from "class-variance-authority";6import { cva } from "class-variance-authority";7import type { Component, ComponentProps, ValidComponent } from "solid-js";89import { splitProps } from "solid-js";1011const markerVariants = cva(12 "min-h-4 gap-2 text-left text-sm text-muted-foreground [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground [&_svg:not([class*='size-'])]:size-4 group/marker relative flex w-full items-center",13 {14 variants: {15 variant: {16 default: "",17 separator: "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",18 border: "border-b border-border pb-2",19 },20 },21 defaultVariants: {22 variant: "default",23 },24 },25);2627type MarkerProps =28 & VariantProps<typeof markerVariants>29 & { class?: string | undefined };3031const Marker = <T extends ValidComponent = "div">(32 props: PolymorphicProps<T, MarkerProps>,33) => {34 const [local, others] = splitProps(props as MarkerProps, [35 "class",36 "variant",37 ]);38 return (39 <Polymorphic40 as="div"41 data-slot="marker"42 data-variant={local.variant ?? "default"}43 class={cn(44 markerVariants({ variant: local.variant, class: local.class }),45 )}46 {...others}47 />48 );49};5051const MarkerIcon: Component<ComponentProps<"span">> = (props) => {52 const [local, others] = splitProps(props, ["class"]);53 return (54 <span55 data-slot="marker-icon"56 aria-hidden="true"57 class={cn("size-4 [&_svg:not([class*='size-'])]:size-4 shrink-0", local.class)}58 {...others}59 />60 );61};6263const MarkerContent: Component<ComponentProps<"span">> = (props) => {64 const [local, others] = splitProps(props, ["class"]);65 return (66 <span67 data-slot="marker-content"68 class={cn("group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground wrap-break-word min-w-0", local.class)}69 {...others}70 />71 );72};7374export type { MarkerProps };75export { Marker, MarkerContent, MarkerIcon, markerVariants };
What it pulls in
npm packages
More from shadcn-solidjs
All 85 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn-solidjs | Components | Free | 1 dep | |
| alertalert | shadcn-solidjs | Components | Free | 2 deps | |
| alert-dialogalert-dialog | shadcn-solidjs | Components | Free | 2 deps | |
| aspect-ratioaspect-ratio | shadcn-solidjs | Components | Free | no deps | |
| attachmentattachment | shadcn-solidjs | Components | Free | 2 deps | |
| avataravatar | shadcn-solidjs | Components | Free | 1 dep | |
| badgebadge | shadcn-solidjs | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | shadcn-solidjs | Components | Free | 1 dep |
