Skip to content

Conversation

@djalmaaraujo
Copy link
Contributor

Related issue

Continues documentation migration work from #336

Description

Adds documentation files for the second batch of components (10 components total):

  • Carousel - A carousel with motion and swipe built using Embla
  • Chart - Displays information in a visual way using Chart.js
  • Checkbox - A control that allows the user to toggle between checked and not checked
  • Clipboard - A control to allow you to copy content to the clipboard
  • Codeblock - A component for displaying highlighted code
  • Collapsible - An interactive component which expands/collapses a panel
  • Combobox - Autocomplete input and command palette with a list of suggestions
  • Command - Fast, composable, unstyled command menu for Phlex
  • Context Menu - Displays a menu to the user triggered by a right click
  • Dialog - A window overlaid on the primary window, rendering the content underneath inert

These documentation files are copied from the web repository and will be installed to Rails apps via the ruby_ui:install:docs generator.

Testing instructions

  1. Point your Rails app to local ruby_ui source via Gemfile:
    gem "ruby_ui", path: "../ruby_ui"
  2. Remove any existing docs files for the 10 components:
    • app/views/docs/carousel.rb
    • app/views/docs/chart.rb
    • app/views/docs/checkbox.rb
    • app/views/docs/clipboard.rb
    • app/views/docs/codeblock.rb
    • app/views/docs/collapsible.rb
    • app/views/docs/combobox.rb
    • app/views/docs/command.rb
    • app/views/docs/context_menu.rb
    • app/views/docs/dialog.rb
  3. Run the docs generator: bin/rails g ruby_ui:install:docs
  4. Confirm all 10 documentation files were created in app/views/docs/
  5. Run the test suite: bundle exec rake

Introduce a new generator (`ruby_ui:install:docs`) that copies component
documentation files from the gem to Rails applications. Documentation
files follow the naming convention `{component}_docs.rb` and are copied
to `app/views/docs/` with the `_docs` suffix removed.

Usage:
  bin/rails g ruby_ui:install:docs
  bin/rails g ruby_ui:install:docs --force

Include stub classes for docs dependencies (Views::Base, Docs::Header,
Docs::VisualCodeExample, etc.) so docs files can be loaded without errors.
Rails apps can override these with full implementations.

Includes button component documentation as the first example.
Add docs files for:
- accordion
- alert
- alert_dialog
- aspect_ratio
- avatar
- badge
- breadcrumb
- calendar
- card
Add documentation files for: carousel, chart, checkbox, clipboard,
codeblock, collapsible, combobox, command, context_menu, dialog
@djalmaaraujo djalmaaraujo requested a review from cirdes as a code owner December 10, 2025 20:44
@djalmaaraujo djalmaaraujo changed the base branch from main to docs/batch-1 December 10, 2025 20:48
Base automatically changed from docs/batch-1 to docs-generator December 11, 2025 17:33
Base automatically changed from docs-generator to main December 11, 2025 17:33
@cirdes cirdes merged commit 271d07c into main Dec 11, 2025
2 checks passed
@cirdes cirdes deleted the docs/batch-2 branch December 11, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants