🪄 v0.19.2 — Tables, Dark Mode & Polish
What's New
TableComponent — clickable rows
Pass row_href: with a callable that returns a URL for each row to make entire rows navigable. Clicks on interactive elements within the row (links, buttons, inputs) are not intercepted. Cmd/Ctrl+click opens in a new tab. Uses Turbo.visit when available, falling back to a standard page load.
<%= midwest_table(collection: @users, row_href: ->(row) { user_path(row) }) do |t| %> <% t.with_column('Name', key: :name) %> <% t.with_column('Email', key: :email) %><% end %>The TablePresenter DSL supports it too — declare row_href in the class and midwest_table_from wires it automatically:
class UsersTable < Midwest::TablePresenter row_href ->(row, view) { view.user_path(row) }endTablePresenter — conditional columns
Pass if: to a column definition with a symbol or callable to show or hide the column at render time. The condition is evaluated against the presenter instance, so it has access to params, filters, and custom methods.
column "Balance", key: :balance, if: :show_balance?column "Status", key: :status, if: -> { filter(:view) == "detailed" }CalloutComponent — actions slot
A new with_actions slot renders buttons in a dedicated row below the callout content. Action buttons are styled independently from the callout's text colour overrides, so button variants display correctly on coloured backgrounds.
<%= midwest_callout(state: :warning) do |c| %> Your trial expires in 3 days. <% c.with_actions do %> <%= midwest_button("Upgrade now", "/billing", variant: :primary, size: :small) %> <%= midwest_button("Dismiss", "#", variant: :ghost, size: :small) %> <% end %><% end %>midwest_stat view helper
StatComponent is now registered in the view helper map, so you can use midwest_stat(...) in templates instead of rendering the component class directly.
Five new layout previews
The Lookbook pattern library gains five new full-page layout compositions: Product Marketplace, Metrics Dashboard, FAQ Knowledge Base, Document Editor, and Learning Course. Each demonstrates how multiple Midwest components compose together in realistic application contexts.
What Changed
TableComponent — dark mode & sticky header refresh
Table styling has been fully migrated from hard-coded colour values to theme tokens. Borders, row backgrounds, header text, sort links, and the sticky-header shadow all respond correctly to dark mode. The sticky header now uses a proper box-shadow underline and overflow-clip for cleaner scroll containment. Clickable rows receive a cursor-pointer style automatically.
StatComponent — dark mode, layout & visual refresh
The stat tile now supports dark mode with dedicated token overrides. The icon gains a gradient background (from-theme-6 to-complement-6) with a drop shadow. The trend indicator has moved into the card footer and renders as a BadgeComponent with contextual up/down icons (switched from caret to arrow-circle). A CSS container query reflows the layout to a centred stack in narrow containers.
ButtonGroupComponent — popover-aware border radius
When a popover element (e.g. a confirmation dialog) precedes the first visible button in a group, the border radius and margin are now applied correctly. Both standard and pill variants handle this edge case.
EmptyStateComponent — dark mode support
Border, background, icon, title, and body text colours now use dark-mode token variants so the component renders correctly in dark themes.
PaginationComponent — Stimulus controller & navigation fix
The pagination Stimulus controller is now registered in the global registerMidwestControllers bundle, so it works without per-project registration. Turbo navigation has been simplified — page changes now use Turbo.visit() directly instead of frame-targeted visits, ensuring the browser URL updates correctly.
View helper refactor
The midwest_table_from helper has been decomposed into focused private methods (midwest_table_presenter_options, midwest_table_presenter_columns, midwest_table_presenter_pagination) for readability and easier extension.
What Was Removed
Nothing removed.
Dev Process
Table presenter documentation
The Rails Features docs gain a new Clickable rows section with examples for both the presenter DSL and direct component usage, including keyboard/modifier behaviour notes. The config reference tables have been updated with row_href and row_href_for entries.
Slide deck preview (WIP)
An in-progress presentation deck preview has been added under Patterns::DeckPreview. This is not yet complete and is intended for internal demo use.
Layout preview expansion
Existing layout previews (App Sidebar, SaaS Dashboard, Analytics Report, Billing Portal, Page Overview, and others) received dark-mode and structural improvements alongside the five new additions.