Separator
separatoruiHorizontal or vertical visual divider — a `<div>` with the right ARIA role and a registry-token border color. Use between sections, list rows, and toolbar groups.
Installation
$pnpm dlx shadcn@latest add https://uipkge.dev/r/lit/separator.json$npx shadcn@latest add https://uipkge.dev/r/lit/separator.json$yarn dlx shadcn@latest add https://uipkge.dev/r/lit/separator.json$bunx shadcn@latest add https://uipkge.dev/r/lit/separator.jsonManifest:
https://uipkge.dev/r/lit/separator.jsonInstalls to:src/uip/components/separator/Examples
Loading interactive previews…
Loading interactive previews…
Props
| Name | Type / Values | Default | Required |
|---|---|---|---|
orientation | 'horizontal' | 'vertical' | horizontal | optional |
converter | string | — | optional |
Schema
Type aliases from this item's source — use them to shape the data you pass in.
HTMLElementTagNameMapinterface HTMLElementTagNameMap {
'uip-separator': UipSeparator
}
}Used by
auth-sign-inauth-sign-upcart-drawercheckout-flowdashboard-layoutevent-calendar-dashboardfooter-01headerheader-mega-menulogin-01login-02logo-cloud-grayscalelogosnewsletterorder-confirmationpricingpricing-01pricing-matrix-plan-cardsproduct-detail-pageproduct-grid-pagerecord-detail-pageregister-01rich-text-editorsettings-pagetestimonialuser-profile-page
Files installed (1)
src/uip/components/separator/separator.ts2.2 kB
import { LitElement, css, html, nothing } from 'lit' import { tailwind } from '../../lib/styles' import { ThemeController } from '../../lib/theme' /** * <uip-separator> — the registry Separator (Radix Separator) as a web component. * * React's class string verbatim on an inner <div>. Like Radix: decorative * (the default) renders role="none"; `decorative=false` renders * role="separator" with aria-orientation for vertical ones. Set * `decorative="false"` or `.decorative=${false}`. * * The host is `display: contents`, so the inner div is laid out directly by * the parent (its `h-full` / `w-full` resolve against the flex/grid parent the * same way React's div does). Because the host generates no box, margins and * other overrides (React's `className`) go on `::part(base)`, e.g. * `class="[&::part(base)]:my-3"`. */ export class UipSeparator extends LitElement { static styles = [tailwind, css`:host { display: contents; }`] static properties = { orientation: { reflect: true }, decorative: { reflect: true, converter: { fromAttribute: (v: string | null) => v !== 'false', toAttribute: (v: boolean) => String(v), }, }, } orientation: 'horizontal' | 'vertical' = 'horizontal' decorative = true constructor() { super() new ThemeController(this) } connectedCallback() { super.connectedCallback() this.setAttribute('data-uipkge', '') this.setAttribute('data-slot', 'separator') } willUpdate() { this.setAttribute('data-orientation', this.orientation) } render() { const vertical = this.orientation === 'vertical' return html`<div part="base" data-slot="separator" data-orientation=${this.orientation} role=${this.decorative ? 'none' : 'separator'} aria-orientation=${!this.decorative && vertical ? 'vertical' : nothing} class="bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px" ></div>` } } customElements.get('uip-separator') || customElements.define('uip-separator', UipSeparator) declare global { interface HTMLElementTagNameMap { 'uip-separator': UipSeparator } }
Raw manifest:https://uipkge.dev/r/lit/separator.json