Separator
solid-ui/separatorFreeComponent
A separator component
Live preview
live · rendered by the registry
Rendered by solid-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.solid-ui.com/r/separator.jsonSource
1import type { ValidComponent } from "solid-js"2import { splitProps } from "solid-js"34import type { PolymorphicProps } from "@kobalte/core/polymorphic"5import * as SeparatorPrimitive from "@kobalte/core/separator"67import { cn } from "~/lib/utils"89type SeparatorRootProps<T extends ValidComponent = "hr"> =10 SeparatorPrimitive.SeparatorRootProps<T> & { class?: string | undefined }1112const Separator = <T extends ValidComponent = "hr">(13 props: PolymorphicProps<T, SeparatorRootProps<T>>14) => {15 const [local, others] = splitProps(props as SeparatorRootProps, ["class", "orientation"])16 return (17 <SeparatorPrimitive.Root18 orientation={local.orientation ?? "horizontal"}19 class={cn(20 "shrink-0 bg-border",21 local.orientation === "vertical" ? "h-full w-px" : "h-px w-full",22 local.class23 )}24 {...others}25 />26 )27}2829export { Separator }
What it pulls in
npm packages
Files it writes
More from solid-ui
All 55 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | solid-ui | Components | Free | 2 deps | |
| Alertalert | solid-ui | Components | Free | 3 deps | |
| Alert Dialogalert-dialog | solid-ui | Components | Free | 2 deps | |
| Aspect Ratioaspect-ratio | solid-ui | Components | Free | 1 dep | |
| Avataravatar | solid-ui | Components | Free | 2 deps | |
| Badgebadge | solid-ui | Components | Free | 2 deps | |
| Badge Deltabadge-delta | solid-ui | Components | Free | 2 deps | |
| Bar Listbar-list | solid-ui | Components | Free | 1 dep |
