How to customize Trek
Trek is designed to get you started fast with useful conventions, then get out of the way: most of the generated code lives in your application, so customizing it is just regular Rails work. Here are the most common entry points.
Admin panel branding
You can pick the title and subtitle used in the admin panel header.
# config/locales/en.yml
en:
admin:
brand:
title: My Awesome Project
subtitle: Back-officeFavicon & logo
Replace Trek's favicon with your own:
- in SVG format at
app/assets/images/favicon.svg - in PNG format (512 × 512 px) at
public/favicon.png
Components
Trek's UI components accept options where it matters:
Trek::Form::ActionsComponent— pick anaspectand add your ownclassnamesto restyle form action bars.Trek::DialogComponent— set thetitleand the buttons of modal dialogs.Trek::Form::ContentEditorComponent— toggle thenodes,blocksandfloatingoptions to slim down the editor where full rich text isn't needed:
f.content_editor :intro, nodes: false, floating: falseTrek::LayoutComponent— use thepanelslot to add your own side panel to admin screens.
Models
The models generated by the installer and the scaffold are plain Active Record models in your app/models. Enable the commented-out hooks to opt into Trek features, for instance:
class Book < ApplicationRecord
include Trek::Formattable
format_attributes Trek::TypographyFormatter, :title
include Trek::Translatable
translate_attributes :title
include RecordImageUploader::Attachment(:image)
endSee the concerns reference for the full list.
Policies
Each scaffolded resource gets its own policy in app/policies/admin. Adjust the rules and permitted_attributes per role — the policies reference shows the generated default.
Theming
Trek's admin supports light, dark and auto themes, selectable per user. The design tokens are based on Radix colors; override the CSS custom properties in your own stylesheet to adapt the palette.
Dependencies configuration
The installer configures Shrine, Postmark, Sorcery, ActionPolicy, Mobility and friends with sensible defaults — through initializers generated in your app. You can edit them at any time:
config/initializers/shrine.rb— storage backends, upload limitsconfig/credentials.yml.enc— Postmark API token (EDITOR="code --wait" bin/rails credentials:edit)config/i18n-tasks.yml— locale management rules