Oihana Next UI - 0.9.0

Application logo

Table Components

Basic Table

Simple Table

NameJobFavorite Color
1Cy GandertonQuality Control SpecialistBlue
2Hart HagertyDesktop Support TechnicianPurple
3Brice SwyreTax AccountantRed

With Border and Background

NameJobFavorite Color
1Cy GandertonQuality Control SpecialistBlue
2Hart HagertyDesktop Support TechnicianPurple
3Brice SwyreTax AccountantRed

Row States

With Active Row

NameJob
1Cy GandertonQuality Control Specialist
2Hart HagertyDesktop Support Technician

Hover Highlight

NameJob
1Cy GandertonQuality Control Specialist
2Hart Hagerty (hover me)Desktop Support Technician

Zebra Striping

Zebra Stripes

NameJobFavorite Color
1Cy GandertonQuality Control SpecialistBlue
2Hart HagertyDesktop Support TechnicianPurple
3Brice SwyreTax AccountantRed

Table Sizes

Extra Small (xs)

NameJobCompanyLocationDateColor
1Person 1Job 1Company 1Location 101/1/2024Blue
2Person 2Job 2Company 2Location 201/2/2024Red
3Person 3Job 3Company 3Location 301/3/2024Green
4Person 4Job 4Company 4Location 401/4/2024Purple
5Person 5Job 5Company 5Location 501/5/2024Yellow

Small (sm)

NameJobColor
1Cy GandertonQuality Control SpecialistBlue
2Hart HagertyDesktop Support TechnicianPurple
3Brice SwyreTax AccountantRed

Large (lg)

NameJobColor
1Cy GandertonQuality Control SpecialistBlue
2Hart HagertyDesktop Support TechnicianPurple
3Brice SwyreTax AccountantRed

Pinned Rows (Sticky Header/Footer)

Scrollable with Pinned Headers

Scroll to see sticky headers

Heroes - A
Ant-Man
Aquaman
Asterix
Heroes - B
Batman
Black Panther
Heroes - C
Captain America
Captain Marvel
Heroes - D
Daredevil
Doctor Strange
Heroes - S
Spider-Man
Superman
Heroes - T
Thor
Heroes - W
Wolverine
Wonder Woman

Pinned Rows & Columns

Sticky Header and First/Last Columns

Scroll horizontally and vertically to see sticky elements

NameJobCompanyLocationDateColor
1Person 1Job 1Company 1Location 101/1/2024Blue1
2Person 2Job 2Company 2Location 201/2/2024Red2
3Person 3Job 3Company 3Location 301/3/2024Green3
4Person 4Job 4Company 4Location 401/4/2024Purple4
5Person 5Job 5Company 5Location 501/5/2024Yellow5
6Person 6Job 6Company 6Location 601/6/2024Blue6
7Person 7Job 7Company 7Location 701/7/2024Red7
8Person 8Job 8Company 8Location 801/8/2024Green8
9Person 9Job 9Company 9Location 901/9/2024Purple9
10Person 10Job 10Company 10Location 1001/10/2024Yellow10
11Person 11Job 11Company 11Location 1101/11/2024Blue11
12Person 12Job 12Company 12Location 1201/12/2024Red12
13Person 13Job 13Company 13Location 1301/1/2024Green13
14Person 14Job 14Company 14Location 1401/2/2024Purple14
15Person 15Job 15Company 15Location 1501/3/2024Yellow15
16Person 16Job 16Company 16Location 1601/4/2024Blue16
17Person 17Job 17Company 17Location 1701/5/2024Red17
18Person 18Job 18Company 18Location 1801/6/2024Green18
19Person 19Job 19Company 19Location 1901/7/2024Purple19
20Person 20Job 20Company 20Location 2001/8/2024Yellow20
NameJobCompanyLocationDateColor

With Visual Elements

Checkboxes, Avatars, Badges, and Buttons

NameJobStatus
C
Cy Ganderton
United States
Quality Control Specialist
Department
Blue
H
Hart Hagerty
United States
Desktop Support Technician
Department
Purple
B
Brice Swyre
United States
Tax Accountant
Department
Red

With Status Indicators

Avatars with Online/Offline Status

UserStatusRole
1
C
Cy Ganderton
cy@example.com
OnlineQuality Control
2
H
Hart Hagerty
hart@example.com
OfflineDesktop Support
3
B
Brice Swyre
brice@example.com
OnlineTax Accountant

Sortable Table Component

Sortable Table with Drag Handles (uncontrolled)

NameJobFavorite Color
Cy Ganderton
Cy Ganderton
Quality ControlBlue
Hart Hagerty
Hart Hagerty
Desktop SupportPurple
Brice Swyre
Brice Swyre
Tax AccountantRed
Marjy Ferencz
Marjy Ferencz
Insurance BrokerGreen
Yancy Tear
Yancy Tear
Sales ManagerYellow
<SortableTable
    head={ [ 'Name' , 'Job' , 'Favorite Color' ] }
    defaultItems={ people }
    renderRow={ person => (
        <SortableTableRow><td>...</td></SortableTableRow>
    )}
/>
// the empty handle-column <th> is prepended automatically

Whole-Row Dragging (controlled, zebra)

Current order :1 , 2 , 3 , 4 , 5
#NameJob
1Cy GandertonQuality Control
2Hart HagertyDesktop Support
3Brice SwyreTax Accountant
4Marjy FerenczInsurance Broker
5Yancy TearSales Manager
<SortableTable
    zebra handle={ false }
    items={ rows } onReorder={ next => setRows( next ) }
/>
// zebra stripes follow DOM positions : they reassign after a drop

Sticky Header (pinRows + vertical scroll)

NameJobFavorite Color
Cy GandertonQuality ControlBlue
Hart HagertyDesktop SupportPurple
Brice SwyreTax AccountantRed
Marjy FerenczInsurance BrokerGreen
Yancy TearSales ManagerYellow
Irma VasilikDesignerTeal
Icarus GnosisDeveloperOrange
Sylvia PlummerWriterPink
Cy GandertonQuality ControlBlue
Hart HagertyDesktop SupportPurple
Brice SwyreTax AccountantRed
Marjy FerenczInsurance BrokerGreen
<SortableTable
    pinRows
    containerClassName="max-h-72 overflow-y-auto"
/>
// the header stays sticky while rows scroll and reorder underneath

Async Reorder with API Call (optimistic revert on failure)

NameJob
Cy GandertonQuality Control
Hart HagertyDesktop Support
Brice SwyreTax Accountant
Marjy FerenczInsurance Broker
<SortableTable
    defaultItems={ people }
    onReorder={ ( items ) => api.saveOrder( items ) }
/>
// onReorder may return a promise : a rejection restores the previous order

Props Reference

PropTypeDescription
items / defaultItemsArrayControlled / uncontrolled rows (each needs a stable id)
onReorderfunction(items, { from, to, item }) => void | Promise — a rejected promise reverts the order (uncontrolled)
renderRowfunction(item, index) => SortableTableRow element (children = the td cells)
head / footArrayHeader / footer cells, one entry per column (the handle column th is added automatically)
handlebooleanShow a drag-handle cell (default true) ; false = whole rows draggable
getItemId / disabledSame contract as the other sortable components
zebra / pinRows / size / ...Table propsEvery other prop is forwarded to Table