Vident

Build type-safe Rails components with Stimulus integration via a Ruby DSL.

40|1|Updated Nov 22, 2022
One-click install
npx skills add https://github.com/stevegeek/vident --skill vident
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Vident
Source: https://github.com/stevegeek/vident/tree/main/skills/vident
Command: npx skills add https://github.com/stevegeek/vident --skill vident

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vident provides a structured approach to building Rails UI components with Stimulus integration, enabling typed props, a declarative Ruby DSL, and first-class outlets for robust interactivity.

Core Features & Use Cases

  • Typed props via Literal for components and easy prop validation.
  • Declarative DSL (stimulus do) to declare controllers, actions, targets, values, and outlets that serialize to Stimulus data attributes.
  • Supports both ViewComponent and Phlex rendering engines with SSR-friendly helpers and stable IDs.
  • Outlets, values, params, classes, and responsive SSR inlining for initial paint.
  • Caching and flexible root-element configuration for consistent rendering.

Quick Start

Install Vident, generate a component with the bundled generator, and wire Stimulus alongside your component.

Frequently Asked Questions about Vident

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add type-safe props to Rails ViewComponent or Phlex components?

You can add type-safe props to Rails ViewComponent or Phlex components using Vident, which leverages Literal for typed props and easy validation. It provides a declarative Ruby DSL to wire props directly into your UI components.

What is the best way to wire Stimulus controllers and outlets in Rails components?

Wiring Stimulus controllers and outlets in Rails components is best handled via a declarative DSL using Vident. The `stimulus do` block declares controllers, actions, targets, values, and outlets, which automatically serialize into Stimulus data attributes.

Does Vident work with both ViewComponent and Phlex for server-side rendering?

Yes, Vident works with both ViewComponent and Phlex rendering engines. It supports SSR-friendly helpers and StableId-based SSR IDs to ensure reliable server-side rendering and responsive initial paint.

Can I cache Rails UI components with typed props and Stimulus bindings?

Yes, you can cache Rails UI components with typed props and Stimulus bindings. Vident supports optional caching alongside flexible root-element configuration to maintain consistent rendering across server-side renders.

How do I generate Rails components with typed props and Stimulus integration?

You generate Rails components with typed props and Stimulus integration by installing Vident and using its bundled generator. This scaffolds the component structure and automatically wires Stimulus alongside your typed props.

Why does my Rails component need a declarative DSL for Stimulus data attributes?

A declarative DSL for Stimulus data attributes is needed to manage complex interactivity without manual HTML data attribute serialization. Vident handles this serialization automatically, supporting outlets, values, params, and classes robustly.