UNPKG

matrix-react-sdk

Version:
23 lines (22 loc) 881 B
import { FieldsetHTMLAttributes, ReactNode } from "react"; export type FilterTab<T> = { label: string | ReactNode; id: T; }; type FilterTabGroupProps<T extends string = string> = FieldsetHTMLAttributes<any> & { name: string; onFilterChange: (id: T) => void; value: T; tabs: FilterTab<T>[]; }; /** * React component which styles a set of content filters as tabs * * This is used in displays which show a list of content items, and the user can select between one of several * filters for those items. For example, in the Poll History dialog, the user can select between "Active" and "Ended" * polls. * * Type `T` is used for the `value` attribute for the buttons in the radio group. */ export declare const FilterTabGroup: <T extends string = string>({ name, value, tabs, onFilterChange, ...rest }: FilterTabGroupProps<T>) => JSX.Element; export {};