FilterSidebar
FilterSidebar splits a dashboard page into a resizable filter rail and a content pane. On narrow screens the same choices move into a drawer behind a summary button.
import { FilterSidebar } from '@lobehub/ui/dashboard';Default
FilterRow is the label-and-count pair for a tree node. FilterOption is a choice in a flat list. useInFilterSplit reports when the split itself is the card, so a nested table can drop its own frame.
APIs
FilterSidebar
bodyRequired(dismiss: () => void) => ReactNodeScrolling choices. `dismiss` closes the compact drawer.
childrenRequiredReactNodeflushbooleanFill the parent and scroll the two panes separately. Leave this off when a header or tabs sit above the split.
head(dismiss: () => void) => ReactNodeFixed controls, such as search. They stay put while `body` scrolls. `dismiss` closes the compact drawer.
headernull | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>Title block rendered in the content pane, above the compact trigger.
labelRequiredstringNames the sidebar, and titles the drawer on compact screens.
storageKeystringPersists width and collapsed state.
summaryRequiredstringCurrent filter, shown on the compact trigger.
widebooleanWider rail. Default width is 264px; wide is 300px.
FilterOption
countnull | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>iconnull | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>labelstringOverrides the accessible name when the visible one lacks context.
nameRequiredReactNodeonClickRequired() => voidselectedRequiredbooleantitlestring
FilterRow
countnull | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>nameRequiredReactNode