Project

terrazzo

0.0
The project is in a healthy, maintained state
Drop-in admin panel for Rails apps using the Administrate dashboard DSL with a React SPA frontend powered by Superglue.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

>= 0.0.6
~> 1.2
>= 7.1
~> 1.1
 Project Readme

Terrazzo

A drop-in admin panel for Rails apps. Uses the Administrate dashboard DSL with a React SPA frontend powered by Superglue.

  • Familiar DSL — same ATTRIBUTE_TYPES, COLLECTION_ATTRIBUTES, FORM_ATTRIBUTES you already know
  • React SPA — search, sort, and paginate without full page reloads, no separate API needed
  • shadcn/ui + Tailwind — every generated component lives in your app and is fully editable
  • 17 field types — string, number, money, boolean, date/time, email, URL, select, rich text, belongs_to, has_many, has_one, polymorphic, and more

Quick start

# Add the gem and npm package
bundle add terrazzo
npm install terrazzo

# Install Superglue (if not already set up)
rails g superglue:install

# Install Terrazzo — generates admin namespace, UI components, and dashboards
# Uses Vite by default; for Sprockets pass --bundler=sprockets
rails g terrazzo:install

# Start the server
bin/dev

Visit http://localhost:3000/admin to see your admin panel.

Documentation

Full docs at gohypelab.github.io/terrazzo — covers dashboards, fields, controllers, views, generators, and customization.

Requirements

  • Ruby 3.1+
  • Rails 7.1+
  • Node.js 18+
  • A JS bundler (Vite recommended, esbuild and Sprockets also supported)

Customizing Per-Row Actions

Terrazzo generates Show, Edit, and Destroy action buttons for each row on index pages and has_many tables on show pages. These are driven by the collection_item_actions(resource) helper (defined in Terrazzo::CollectionActionsHelper).

Override in your controller helper to customize actions per resource type:

module Admin
  module CollectionActionsHelper
    def collection_item_actions(resource)
      actions = super
      if resource.is_a?(User)
        actions << { label: "Ghost", url: admin_user_ghost_path(user_id: resource.id) }
      end
      actions
    end
  end
end

Each action hash supports label (String), url (String), method (optional, e.g. "delete"), confirm (optional confirmation message), and sg_visit (set to false to bypass SPA navigation).

License

MIT