@@ -409,20 +409,28 @@ export function DataTableViewOptions<TData>({
409
409
* -------------------------------------------------------------------------- */
410
410
411
411
export function DataTableToolbar < TData > ( {
412
- table ,
412
+ children ,
413
413
className,
414
+ table,
414
415
} : {
415
- table : TableType < TData > ;
416
+ children ?: React . ReactNode ;
416
417
className ?: string ;
418
+ table : TableType < TData > ;
417
419
} ) : React . JSX . Element {
418
420
return (
419
421
< div
420
- className = { twMerge ( 'flex items-center justify-between gap-4' , className ) }
422
+ className = { twMerge (
423
+ 'flex flex-wrap items-center justify-between gap-4' ,
424
+ className ,
425
+ ) }
421
426
>
422
427
< div className = "flex grow items-center gap-2" >
423
428
< DataTableSearch table = { table } />
424
429
</ div >
425
- < DataTableViewOptions table = { table } />
430
+ < div className = "flex flex-wrap items-center gap-2" >
431
+ < DataTableViewOptions table = { table } />
432
+ { children }
433
+ </ div >
426
434
</ div >
427
435
) ;
428
436
}
@@ -739,10 +747,12 @@ export function DataTable<TData>({
739
747
columns = [ ] ,
740
748
classNames = { } ,
741
749
showFooter = false ,
750
+ toolbar,
742
751
...props
743
752
} : Omit < TableOptions < TData > , 'getCoreRowModel' > & {
744
753
classNames ?: React . ComponentProps < typeof DataTableContent > [ 'classNames' ] ;
745
754
showFooter ?: boolean ;
755
+ toolbar ?: React . ReactNode ;
746
756
} ) : React . JSX . Element {
747
757
const table = useReactTable ( {
748
758
columns,
@@ -757,7 +767,9 @@ export function DataTable<TData>({
757
767
758
768
return (
759
769
< div className = { twMerge ( 'space-y-4' , classNames . root ) } >
760
- < DataTableToolbar className = { classNames . toolbar } table = { table } />
770
+ < DataTableToolbar className = { classNames . toolbar } table = { table } >
771
+ { toolbar }
772
+ </ DataTableToolbar >
761
773
< DataTableContent
762
774
classNames = { classNames }
763
775
columns = { columns }
0 commit comments