SurfaceBootstrap.Table (surface_bootstrap v0.2.5)
A Bootstrap HTML table: https://getbootstrap.com/docs/5.0/content/tables/
You can create a table by passing data
to it and defining
columns using the Table.Column
component.
Look in the documentation for Table.Column
for information on how to do sorting.
Properties
- id :string, required: true - The id of the live component (required by LiveView for stateful components). .
- data :list, required: true - The data that populates the table internal.
- caption :string - Caption text.
- caption_top :boolean - Move caption text to the top.
- bordered :boolean - Add borders to all the cells.
- borderless :boolean - Make table borderless.
- border_color :string, values: @colors - Color for borders.
- small :boolean - Compact table?.
- striped :boolean - Add stripes to the table.
- hover :boolean - Hoverable rows?.
- class :css_class, default: [] - Any extra CSS class for the
<table>
element. - color :string, values: @colors - Main table color.
- table_header_color :string, values: @colors - Table header color.
- table_footer_color :string, values: @colors - Table footer color (ignored if no footer).
- row_class :fun - A function that returns a class for the item's underlying
<tr>
element. The function receives the item and index related to the row. Can be used to set row color ie. "table-dark", "table-success" etc or if row is active; "table-active". .
Slots
- cols, args: [item: ^data], required: true - The columns of the table.
Link to this section Summary
Functions
Callback implementation for Phoenix.LiveComponent.handle_event/3
.
Callback implementation for Phoenix.LiveComponent.mount/1
.
Callback implementation for Phoenix.LiveComponent.render/1
.
Callback implementation for Phoenix.LiveComponent.update/2
.
Link to this section Functions
Link to this function
handle_event(binary, map, socket)
Callback implementation for Phoenix.LiveComponent.handle_event/3
.
Link to this function
mount(socket)
Callback implementation for Phoenix.LiveComponent.mount/1
.
Link to this function
render(assigns)
Callback implementation for Phoenix.LiveComponent.render/1
.
Link to this function
update(assigns, socket)
Callback implementation for Phoenix.LiveComponent.update/2
.