{"name":"text","helper":"rui_text","complexity":"moderate","param_count":22,"slot_count":2,"form_builder":true,"standalone":true,"ai_score":8,"human_score":8,"token_estimate":154,"slots":{"icon":{"type":"renders_one","component":"lambda","example":"component.with_icon"},"badge":{"type":"renders_one","component":"Badge::Component","example":"component.with_badge"}},"gotchas":[{"id":"text_heading_size_override","severity":"high","component":"rui_text","summary":"as: h1-h6 silently ignores size: param (but weight/leading/tracking work)","params":["as","size"],"behavior":"When as: is :h1 through :h6, the size: param is completely ignored. Headings use TypographyHelper responsive presets (h1=5xl/md:6xl, h2=4xl/md:5xl, etc.). However, explicit weight:, line_height:/leading:, and letter_spacing:/tracking: DO override heading defaults.","wrong":"\u003c%= rui_text(\"Title\", as: :h1, size: :xl) %\u003e","right":"\u003c%= rui_text(\"Title\", as: :h1) %\u003e","workaround":"For custom-sized heading-like text, skip as: and use size: + weight: directly.","detection":"Scan for rui_text calls where as: is :h1-:h6 AND size: is also present. Regex: /rui_text\\(.*as:\\s*:h[1-6].*size:/","recovery":"Remove the size: param. If custom sizing is needed, remove as: and use size: + weight: instead."},{"id":"text_heading_weight_override","severity":"low","component":"rui_text","summary":"Explicit weight: DOES work with heading tags (asymmetric with size:)","params":["as","weight"],"behavior":"Unlike size:, explicit weight: overrides the heading default weight. h1-h3 default to extrabold, h4-h6 to bold. Pass weight: to change.","example":"\u003c%= rui_text(\"Light Heading\", as: :h2, weight: :light) %\u003e","notes":"This is intentionally asymmetric — size is locked to responsive presets, but weight is overridable.","detection":"Not a bug — informational. Flag if agent assumed weight: is ignored like size: and omitted an intended weight override.","recovery":"Add explicit weight: param to heading. Unlike size:, this will apply correctly."},{"id":"text_paragraph_margin","severity":"medium","component":"rui_text","summary":"Default \u003cp\u003e tag adds mb-2 bottom margin","params":["as"],"behavior":"rui_text defaults to \u003cp\u003e tag which includes mb-2 (margin-bottom). This can cause unexpected spacing in flex layouts or tight compositions.","workaround":"Use inline: true (renders \u003cspan\u003e, no margin) or as: :div (no margin) or pass class: 'mb-0' to override.","wrong":"\u003cdiv class=\"flex items-center gap-2\"\u003e\u003c%= rui_text(\"Label\") %\u003e\u003c%= rui_badge(text: \"New\") %\u003e\u003c/div\u003e","right":"\u003cdiv class=\"flex items-center gap-2\"\u003e\u003c%= rui_text(\"Label\", inline: true) %\u003e\u003c%= rui_badge(text: \"New\") %\u003e\u003c/div\u003e","detection":"Scan for rui_text inside flex/inline containers without inline: true or as: :span/:div. Regex: /class=.*flex.*rui_text\\([^)]*\\)/ where call lacks inline: true.","recovery":"Add inline: true to rui_text calls inside flex layouts. Or use as: :span for inline semantics, as: :div for block without margin."},{"id":"text_leading_tracking_aliases","severity":"low","component":"rui_text","summary":"leading:/tracking: are aliases — leading takes priority over line_height","params":["leading","tracking","line_height","letter_spacing"],"behavior":"leading: maps to line_height:, tracking: maps to letter_spacing:. When both alias and canonical are provided, the alias takes priority (leading: overrides line_height:).","example":"\u003c%= rui_text(\"Hello\", leading: :tight, tracking: :wide) %\u003e","notes":"Canonical names (line_height:/letter_spacing:) are preferred. Aliases exist for Tailwind naming familiarity.","detection":"Scan for rui_text calls with both leading: and line_height:, or both tracking: and letter_spacing:. Regex: /rui_text\\(.*leading:.*line_height:|rui_text\\(.*tracking:.*letter_spacing:/","recovery":"Remove the canonical param (line_height:/letter_spacing:) and keep only the alias (leading:/tracking:), or vice versa. Pick one naming style and use it consistently."}],"families":[{"tree":"text_display","question":"What kind of text display?","use_case":"Page/section heading","notes":"Headings use built-in responsive sizes. Do NOT pass size: — it is ignored. Explicit weight: still works."},{"tree":"text_display","question":"What kind of text display?","use_case":"Body paragraph / description","notes":"Default tag is \u003cp\u003e with mb-2 margin. Use as: :span or inline: true for inline text."},{"tree":"text_display","question":"What kind of text display?","use_case":"Inline text fragment","notes":"inline: true renders \u003cspan\u003e instead of \u003cp\u003e. No bottom margin."}],"compositions":[{"name":"author_byline","description":"Avatar + author name + date — used in blog posts, comments, cards","components":["rui_avatar","rui_text"]},{"name":"page_header","description":"Page title + description + action buttons — used at top of index/show pages","components":["rui_text","rui_button","rui_link"]},{"name":"stat_card","description":"Metric label + large value + optional badge — used in dashboards","components":["rui_text","rui_badge","rui_icon"]},{"name":"empty_state","description":"Icon + message + CTA button — shown when table/list has no data","components":["rui_icon","rui_text","rui_link"]},{"name":"comment_thread","description":"Avatar + author + body + action links — used in discussions, reviews","components":["rui_avatar","rui_text","rui_link","rui_button_to"]},{"name":"form_section","description":"Section heading + description + grouped form fields — used in settings","components":["rui_text","rui_input","rui_textarea","rui_checkbox"]},{"name":"resource_list_item","description":"Bordered card row with name/link + metadata badges + edit/delete actions","components":["rui_link","rui_badge","rui_text","rui_button_to"]},{"name":"detail_row","description":"Label + value inline pair for key-value display on show pages","components":["rui_text"]},{"name":"associated_list","description":"Section heading + compact cards for related records — used on show pages","components":["rui_text","rui_link","rui_badge"]}],"relationships":{"composes_with":["avatar","badge","button","button_to","checkbox","icon","input","link","textarea"],"slotted_into":[],"confused_with":["text_fmt"]}}