Meda Filter Rail
meda/meda-filter-railFreeComponent
Install the Meda dense filter rail primitive.
Live preview
live · rendered by the registry
Rendered by @meda on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://meda.medalsocial.com/r/meda-filter-rail.jsonSource
1import { type ComponentPropsWithoutRef, type ReactNode, useId } from 'react'2import { cn } from '@/lib/utils'34export interface FilterRailProps extends Omit<ComponentPropsWithoutRef<'aside'>, 'title'> {5 title?: ReactNode6 description?: ReactNode7 search?: ReactNode8 actions?: ReactNode9 footer?: ReactNode10 children?: ReactNode11}1213export interface FilterRailGroupProps extends Omit<ComponentPropsWithoutRef<'fieldset'>, 'title'> {14 title?: ReactNode15 description?: ReactNode16 children?: ReactNode17}1819function FilterRailGroup({ title, description, children, className, ...props }: FilterRailGroupProps) {20 return (21 <fieldset data-slot="filter-rail-group" className={cn('space-y-2 border-0 p-0', className)} {...props}>22 {title ? <legend data-slot="filter-rail-group-title" className="text-xs font-semibold text-foreground">{title}</legend> : null}23 {description ? <p data-slot="filter-rail-group-description" className="text-xs text-muted-foreground">{description}</p> : null}24 <div data-slot="filter-rail-group-content" className="space-y-1.5">{children}</div>25 </fieldset>26 )27}2829function FilterRailRoot({ title, description, search, actions, footer, children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: FilterRailProps) {30 const titleId = useId()31 const label = ariaLabel ?? (ariaLabelledBy ? undefined : typeof title === 'string' ? title : undefined)32 const labelledBy = ariaLabelledBy ?? (label ? undefined : title ? titleId : undefined)3334 return (35 <aside36 data-slot="filter-rail"37 aria-label={label}38 aria-labelledby={labelledBy}39 className={cn('flex min-h-0 w-full flex-col border-border bg-card text-card-foreground', className)}40 {...props}41 >42 {title || description || actions ? (43 <div data-slot="filter-rail-header" className="flex shrink-0 items-start justify-between gap-3 border-b border-border px-4 py-3">44 <div className="min-w-0">45 {title ? <h2 id={titleId} data-slot="filter-rail-title" className="text-sm font-semibold text-foreground">{title}</h2> : null}46 {description ? <p data-slot="filter-rail-description" className="mt-0.5 text-xs text-muted-foreground">{description}</p> : null}47 </div>48 {actions ? <div data-slot="filter-rail-actions" className="shrink-0">{actions}</div> : null}49 </div>50 ) : null}51// … truncated
Files it writes
More from @meda
All 12 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Meda Context Railmeda-context-rail | @meda | Components | Free | 1 dep | |
| Meda Empty Statemeda-empty-state | @meda | Components | Free | 1 dep | |
| Meda Marketing Calloutmeda-marketing-callout | @meda | Components | Free | 1 dep | |
| Meda Marketing Contactmeda-marketing-contact | @meda | Components | Free | 1 dep | |
| Meda Marketing Lead Magnetmeda-marketing-lead-magnet | @meda | Components | Free | 1 dep | |
| Meda Skeletonmeda-skeleton | @meda | Components | Free | no deps | |
| Meda Workbench Layoutmeda-workbench-layout | @meda | Components | Free | 1 dep |
