Skip to content

Commit c74ccd5

Browse files
committed
docs(data-table): add "With toolbar and selectable rows" example
1 parent 667fe61 commit c74ccd5

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

docs/src/pages/components/DataTable.svx

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,70 @@ Use `size="short"` to create a more compact table with a small toolbar.
502502
</Toolbar>
503503
</DataTable>
504504

505+
## With toolbar and selectable rows
506+
507+
Set `selectable` to `true` to enable selectable rows. Here, the toolbar is used standalone. For batch actions for selected rows, see the [batch selection with toolbar](#batch-selection-with-batch-actions-toolbar) example.
508+
509+
<DataTable selectable size="short" title="Load balancers" description="Your organization's active load balancers."
510+
headers="{[
511+
{ key: "name", value: "Name" },
512+
{ key: "protocol", value: "Protocol" },
513+
{ key: "port", value: "Port" },
514+
{ key: "rule", value: "Rule" }
515+
]}"
516+
rows="{[
517+
{
518+
id: "a",
519+
name: "Load Balancer 3",
520+
protocol: "HTTP",
521+
port: 3000,
522+
rule: "Round robin"
523+
},
524+
{
525+
id: "b",
526+
name: "Load Balancer 1",
527+
protocol: "HTTP",
528+
port: 443,
529+
rule: "Round robin"
530+
},
531+
{
532+
id: "c",
533+
name: "Load Balancer 2",
534+
protocol: "HTTP",
535+
port: 80,
536+
rule: "DNS delegation"
537+
},
538+
{
539+
id: "d",
540+
name: "Load Balancer 6",
541+
protocol: "HTTP",
542+
port: 3000,
543+
rule: "Round robin"
544+
},
545+
{
546+
id: "e",
547+
name: "Load Balancer 4",
548+
protocol: "HTTP",
549+
port: 443,
550+
rule: "Round robin"
551+
},
552+
{
553+
id: "f",
554+
name: "Load Balancer 5",
555+
protocol: "HTTP",
556+
port: 80,
557+
rule: "DNS delegation"
558+
},
559+
]}"
560+
>
561+
<Toolbar size="sm">
562+
<ToolbarContent>
563+
<ToolbarSearch persistent />
564+
<Button>Action</Button>
565+
</ToolbarContent>
566+
</Toolbar>
567+
</DataTable>
568+
505569
## Filterable
506570

507571
Set `shouldFilterRows` to `true` to enable client-side filtering. The default filter performs string comparisons on cell values.

0 commit comments

Comments
 (0)