OctantisWeb.Components.Polaris.IndexTable (octantis v0.1.12)
View SourceAn index table displays a collection of objects of the same type, like orders or products. The main job of an index table is to help merchants get an at-a-glance of the objects to perform actions or navigate to a full-page representation of it.
Examples
<.index_table />
See
Summary
Functions
Attributes
id
(:string
) (required)on_toggle_all
(:any
)selected_count
(:integer
) (required)selected
(:map
) - A map of row ids to 'true' or 'false'. Defaults to%{}
.
Slots
promoted_bulk_action
- BulkActions for the table. Accepts attributes:content
(:string
) - Content the action displays.disabled
(:boolean
) - Whether or not the action is disabled.variant
(:string
) - Changes the visual appearance of the Button.Must be one of"plain"
,"primary"
,"secondary"
,"tertiary"
, or"monochromePlain"
.tone
(:string
) - Sets the color treatment of the Button.Must be one of"critical"
, or"success"
.full_width
(:boolean
) - Allows the button to grow to the width of its container.size
(:string
) - Changes the size of the button, giving it more or less padding.Must be one of"micro"
,"slim"
,"medium"
, or"large"
.navigate
(:string
) - Passes through to .link component.patch
(:string
) - Passes through to .link component.href
(:string
) - Passes through to .link component.target
(:string
) - Passes through to .link component.icon
(:any
) - Source of the icon.Examples include&OctantisWeb.Components.Polaris.Icons.arrow_right/1
.phx_click
(:any
) - Click function passed through to the button.
Attributes
id
(:string
) (required)name
(:string
) - Defaults to"select_all"
.accessibility_label
(:string
) - Defaults tonil
.label
(:string
) - Defaults tonil
.checked
(:atom
) - Must be one oftrue
,false
, or:indeterminate
.disabled
(:boolean
) - Defaults tofalse
.phx_click
(:any
) - onClick: Callback when row is clicked.aria_live
(:atom
) - Defaults tonil
.
An index table displays a collection of objects of the same type, like orders or products. The main job of an index table is to help merchants get an at-a-glance of the objects to perform actions or navigate to a full-page representation of it.
Attributes
phx_click
(:any
) - onClick: Callback when row is clicked.class
(:any
) - Class to be passed on to the cell.
Slots
inner_block
Attributes
phx_click
(:any
) - onClick: Callback when row is clicked.checked
(:boolean
) (required)selectable
(:boolean
) (required)
Slots
inner_block
Attributes
id
(:string
)parent_id
(:string
)on_selection_change
(:any
) - Callback for when the checkbox is toggled.checked
(:boolean
) - Defaults tofalse
.
Attributes
heading
(:any
) (required)index
(:integer
) (required)last
(:boolean
) (required)selectable
(:boolean
) (required)class
(:any
) - Class to be passed on to the header and cel.
Attributes
id
(:string
)on_selection_change
(:any
) - Callback for when the checkbox is toggled.checked
(:boolean
) - Defaults tofalse
.selected_count
(:integer
) (required) - The number of selected rows.
Functions
Attributes
id
(:string
) (required)on_toggle_all
(:any
)selected_count
(:integer
) (required)selected
(:map
) - A map of row ids to 'true' or 'false'. Defaults to%{}
.
Slots
promoted_bulk_action
- BulkActions for the table. Accepts attributes:content
(:string
) - Content the action displays.disabled
(:boolean
) - Whether or not the action is disabled.variant
(:string
) - Changes the visual appearance of the Button.Must be one of"plain"
,"primary"
,"secondary"
,"tertiary"
, or"monochromePlain"
.tone
(:string
) - Sets the color treatment of the Button.Must be one of"critical"
, or"success"
.full_width
(:boolean
) - Allows the button to grow to the width of its container.size
(:string
) - Changes the size of the button, giving it more or less padding.Must be one of"micro"
,"slim"
,"medium"
, or"large"
.navigate
(:string
) - Passes through to .link component.patch
(:string
) - Passes through to .link component.href
(:string
) - Passes through to .link component.target
(:string
) - Passes through to .link component.icon
(:any
) - Source of the icon.Examples include&OctantisWeb.Components.Polaris.Icons.arrow_right/1
.phx_click
(:any
) - Click function passed through to the button.
Attributes
id
(:string
) (required)name
(:string
) - Defaults to"select_all"
.accessibility_label
(:string
) - Defaults tonil
.label
(:string
) - Defaults tonil
.checked
(:atom
) - Must be one oftrue
,false
, or:indeterminate
.disabled
(:boolean
) - Defaults tofalse
.phx_click
(:any
) - onClick: Callback when row is clicked.aria_live
(:atom
) - Defaults tonil
.
An index table displays a collection of objects of the same type, like orders or products. The main job of an index table is to help merchants get an at-a-glance of the objects to perform actions or navigate to a full-page representation of it.
Examples
<.index_table />
See
- https://polaris.shopify.com/components/tables/index-table
- https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/IndexTable/IndexTable.tsx
Attributes
id
(:string
) - A unique identifier for the table. Defaults to"IndexTable"
.selectable
(:boolean
) (required) - Include the selection checkboxes to the left.selected
(:map
) - A map of row ids to 'true' or 'false'. Defaults to%{}
.rows
(:list
) (required) - A list of items, each item must have an id.class
(:any
) - A class name to be added to the component class name. Defaults to""
.on_selection_change
(:any
) - Callback for when the checkbox is toggled. Defaults tonil
.
Slots
col
(required) - Accepts attributes:header
(:any
) (required) - Examples include"Order"
,"Date"
,"Customer"
, and{"Total", [alignment: "end"]}
.class
(:any
) - Class to be passed on to the header and cell.
promoted_bulk_action
- BulkActions for the table. Accepts attributes:content
(:string
) - Content the action displays.disabled
(:boolean
) - Whether or not the action is disabled.variant
(:string
) - Changes the visual appearance of the Button.Must be one of"plain"
,"primary"
,"secondary"
,"tertiary"
, or"monochromePlain"
.tone
(:string
) - Sets the color treatment of the Button.Must be one of"critical"
, or"success"
.full_width
(:boolean
) - Allows the button to grow to the width of its container.size
(:string
) - Changes the size of the button, giving it more or less padding.Must be one of"micro"
,"slim"
,"medium"
, or"large"
.navigate
(:string
) - Passes through to .link component.patch
(:string
) - Passes through to .link component.href
(:string
) - Passes through to .link component.target
(:string
) - Passes through to .link component.icon
(:any
) - Source of the icon.Examples include&OctantisWeb.Components.Polaris.Icons.arrow_right/1
.phx_click
(:any
) - Click function passed through to the button.
inner_block
Attributes
phx_click
(:any
) - onClick: Callback when row is clicked.class
(:any
) - Class to be passed on to the cell.
Slots
inner_block
Attributes
phx_click
(:any
) - onClick: Callback when row is clicked.checked
(:boolean
) (required)selectable
(:boolean
) (required)
Slots
inner_block
Attributes
id
(:string
)parent_id
(:string
)on_selection_change
(:any
) - Callback for when the checkbox is toggled.checked
(:boolean
) - Defaults tofalse
.
Attributes
heading
(:any
) (required)index
(:integer
) (required)last
(:boolean
) (required)selectable
(:boolean
) (required)class
(:any
) - Class to be passed on to the header and cel.
Attributes
id
(:string
)on_selection_change
(:any
) - Callback for when the checkbox is toggled.checked
(:boolean
) - Defaults tofalse
.selected_count
(:integer
) (required) - The number of selected rows.