page Tablecomponent { seo { title = "Table component" description = "Theme-aware, responsive table component." } view {
W WRNexusJS
tables component

Table

Theme-aware, responsive table component.

@wrnexus/ui 0.3.57 props1 slots0 events

Usage

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

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

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

Props and attributes

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

Slots

  • default

Events

This component does not declare a custom event.

Source contract

Installed source: components/Table.wrn

component Table {
  props {
    size = "default"
    color = "primary"
    caption = "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>
    }
}
} }