Table
Selectable Rows
Allow users to select rows with the selectable
prop.
Rows with a disabled
property set to true
will render a disabled
checkbox. You can set the initially selected rows with the
defaultSelectedRows
prop. onToggleRow
and onToggleAllRows
callbacks are also available.
Fruits | Vegetables | Grains | Dairy | Protein | |
---|---|---|---|---|---|
Pomello | Bok Choi | Chia | Pule | Crickets | |
Starfruit | Romanesco | Sorghum | Casu marzu | Barnacles | |
Durian | Ramps | Teff | Vieux Lille | Inca nuts |
() => { const data = [ sharedData[0], sharedData[1], { ...sharedData[2], disabled: true } ]; return ( <Table selectable defaultSelectedRows={[data[1]]} data={data} rowKey="Fruits" title="Foods of the World" hideTitle /> ); }