page DataTablecomponent { seo { title = "DataTable component" description = "Theme-aware, responsive data table component." } view {
W WRNexusJS
integrations component

DataTable

Theme-aware, responsive data table component.

@wrnexus/ui 0.3.67 props1 slots0 events

Usage

Components are auto-discovered. Use the component directly in any .wrn view:

<DataTable
  size="default"
  color="primary"
  caption="Data Table"
  columns="[]"
  rows="[]"
/>

Legacy mount name: data-component="DataTable".

Props and attributes

PropTypeRequirementDefault
sizestringOptional"default"
colorstringOptional"primary"
captionstringOptional"Data Table"
columnsstringOptional[]
rowsstringOptional[]
stripedbooleanOptionaltrue
classstringOptional""

Slots

  • default

Events

This component does not declare a custom event.

Source contract

Installed source: components/DataTable.wrn

component DataTable {
  props {
    size = "default"
    color = "primary"
    caption = "Data Table"
    columns = []
    rows = []
    striped = true
    class = ""
  }
  view {
        <div class="wire-next wire-next--color-{color} wire-next--size-{size} wire-next--table {class}">
        <table>
        <caption>{caption}</caption>
        <thead>
        <tr>{#each columns as column}<th>{column.label}</th>{/each}</tr>
        </thead>
        <tbody>{#each rows as row}<tr>{#each columns as column}<td>{row[column.key]}</td>{/each}</tr>{/each}</tbody>
        </table>
        <slot />
        </div>
    }
}
} }