Skip to content

Components

Trek's admin UI is built with ViewComponent, Stimulus and Turbo, styled with PostCSS and Radix colors, with light & dark themes.

UI components

The main building blocks, all in the Trek:: namespace:

ComponentPurpose
LayoutComponentadmin layout, with header, menu and panel slots
HeaderComponenttop navigation bar
MenuComponentsidebar navigation, with polymorphic slots
BrandComponentlogo, title & subtitle area
DialogComponentmodal dialogs, with configurable title and buttons
TabsComponenttabbed interfaces
ButtonComponentbuttons & button-styled links
ListComponentrecord lists
PropertiesComponentkey-value property display
PaginationComponentKaminari-backed pagination
ToasterComponent / ToastComponentflash notifications
HeadingComponentheadings
GateComponentauthorization-based visibility gate
IconComponentSVG icon renderer

Form components

Rendered by the form builder helpers, under Trek::Form:::

GroupComponent, FieldsetComponent, ActionsComponent (configurable aspect & classnames), ErrorsComponent, TextFieldComponent, ImageFieldComponent, SoundFieldComponent, SwitchBoxComponent, CollectionSelectComponent, GroupedCollectionSelectComponent, LinkSelectComponent and ContentEditorComponent.

Content editor

Trek::Form::ContentEditorComponent wraps the Tiptap editor and accepts three options — nodes, blocks and floating (all enabled by default) — to toggle the node toolbar, block formatting and floating menu:

ruby
f.content_editor :intro, nodes: false, floating: false

Content is stored as ProseMirror JSON and rendered with formatted_content. Image uploads (Uppy), link insertion and prompts are served by the panel controllers.

Released under the MIT License.