FilterListSection

Wrapper that renders a labeled section inside a filter sidebar.

Installation

pnpm dlx shadcn@latest add @shadmin/filter-list-section

Usage

<FilterListSection> provides the title row used by <FilterList>, but can also be used standalone to group custom controls (for example a <FilterLiveForm>) alongside other filter widgets:

import { Card } from "@/components/ui/card";
import { Type } from "lucide-react";
import {
  FilterListSection,
  FilterLiveForm,
  TextInput,
} from "@/components/admin";
 
export const BookListAside = () => (
  <Card className="p-4">
    <FilterListSection label="Title" icon={<Type className="size-4" />}>
      <FilterLiveForm>
        <TextInput source="title" helperText={false} />
      </FilterLiveForm>
    </FilterListSection>
  </Card>
);

Props

PropRequiredTypeDefaultDescription
labelRequiredstring-Section header label, translated through the i18n provider
iconOptionalReactNode-Icon displayed before the label
childrenRequiredReactNode-Content rendered below the header
classNameOptionalstring-Extra Tailwind classes appended to the root element