<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rafael Hovhannisyan</title>
    <description>The latest articles on DEV Community by Rafael Hovhannisyan (@hosembafer).</description>
    <link>https://dev.to/hosembafer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F45050%2Fb8b9ebc7-e415-4052-b41a-a0e40cb76dbc.jpeg</url>
      <title>DEV Community: Rafael Hovhannisyan</title>
      <link>https://dev.to/hosembafer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hosembafer"/>
    <language>en</language>
    <item>
      <title>Angular Directive that Elegantly Continues Truncated Text</title>
      <dc:creator>Rafael Hovhannisyan</dc:creator>
      <pubDate>Tue, 11 Nov 2025 03:49:37 +0000</pubDate>
      <link>https://dev.to/hosembafer/angular-directive-that-elegantly-continues-truncated-text-1f1h</link>
      <guid>https://dev.to/hosembafer/angular-directive-that-elegantly-continues-truncated-text-1f1h</guid>
      <description>&lt;p&gt;We've all been there. You're building a sleek data table, everything looks perfect, and then... the client's data arrives. Suddenly, "&lt;strong&gt;John&lt;/strong&gt;" becomes "&lt;strong&gt;Dr. Jonathan Christopher Montgomery III&lt;/strong&gt;" and your beautiful layout explodes. So you slap on some CSS truncation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.table-cell&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-overflow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ellipsis&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;nowrap&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Problem solved? Not really. Now users can't read the full content. Time to add tooltips? Another 50KB library? Custom overlay logic? Ugh.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter ngx-overflow-reveal
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;&lt;a href="https://github.com/hosembafer/ngx-overflow-reveal" rel="noopener noreferrer"&gt;ngx-overflow-reveal&lt;/a&gt;&lt;/strong&gt; because I was tired of reinventing this wheel in every project. But here's the twist - unlike traditional tooltips that duplicate the entire text in a popup, this directive creates a &lt;strong&gt;seamless continuation&lt;/strong&gt; from where your text was cut off. No re-reading. No visual jumps. Just a natural flow that reveals only the hidden part.&lt;/p&gt;

&lt;p&gt;Oh, and it's zero dependencies. Just Angular.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NgxOverflowRevealDirective&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ngx-overflow-reveal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Component&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;selector&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app-table&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;NgxOverflowRevealDirective&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;template&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`
    &amp;lt;td 
      ngxOverflowReveal
      style="max-width: 150px; overflow: hidden; text-overflow: ellipsis;"&amp;gt;
      {{ userBio }}
    &amp;lt;/td&amp;gt;
  `&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. The directive handles everything else.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Makes It Smart?
&lt;/h2&gt;

&lt;p&gt;Here's what sets this apart from every tooltip library out there: instead of showing the entire text in a separate overlay (forcing users to re-read from the beginning), &lt;strong&gt;ngx-overflow-reveal&lt;/strong&gt; creates a seamless continuation from where the text was cut off.&lt;/p&gt;

&lt;p&gt;Think about it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Traditional tooltip&lt;/strong&gt;: "Dr. Jonathan Christopher..." → [hover] → "Dr. Jonathan Christopher Montgomery III" &lt;em&gt;(start over reading)&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ngx-overflow-reveal&lt;/strong&gt;: "Dr. Jonathan Christopher..." → [hover] → &lt;em&gt;continues naturally&lt;/em&gt; → "...Montgomery III"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The revealed portion appears to extend from the truncated text, maintaining your reading flow. It's like the text simply slides out from hiding, because that's exactly what it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customization Options
&lt;/h2&gt;

&lt;p&gt;The directive comes with several handy properties to fine-tune the behavior:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; 
  &lt;span class="nx"&gt;ngxOverflowReveal&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ngxOverflowRevealElevated&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;true&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;        &lt;span class="c1"&gt;// Add subtle shadow (default: false)&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ngxOverflowRevealDelay&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;            &lt;span class="c1"&gt;// Hover delay in ms (default: 120)&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ngxOverflowRevealAnimated&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;false&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;       &lt;span class="c1"&gt;// Disable fade-in (default: true)&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ngxOverflowRevealMaxWidth&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;400&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;         &lt;span class="c1"&gt;// Constrain panel width (default: undefined)&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ngxOverflowRevealViewportPadding&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;24&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;   &lt;span class="c1"&gt;// Edge padding (default: 24)&lt;/span&gt;
  &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;ngxOverflowRevealPanelClass&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;'custom'&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;  &lt;span class="c1"&gt;// Add custom CSS class&lt;/span&gt;
  &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;width: 200px; overflow: hidden; text-overflow: ellipsis;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;Configure&lt;/span&gt; &lt;span class="nx"&gt;everything&lt;/span&gt; &lt;span class="nx"&gt;or&lt;/span&gt; &lt;span class="nx"&gt;nothing&lt;/span&gt;&lt;span class="err"&gt;—&lt;/span&gt;&lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;choice&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The best part? Most of the time you won’t need any of these options, the defaults just work.​​​​​​​​​​​​​​​​&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Now
&lt;/h2&gt;

&lt;p&gt;Don't take my word for it. &lt;strong&gt;&lt;a href="https://stackblitz.com/github/hosembafer/ngx-overflow-reveal" rel="noopener noreferrer"&gt;Open the StackBlitz demo&lt;/a&gt;&lt;/strong&gt; and see it in action. Or better yet, install it in that project where you're currently fighting with truncated text.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/hosembafer/ngx-overflow-reveal" rel="noopener noreferrer"&gt;github.com/hosembafer/ngx-overflow-reveal&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Like it? Star it on &lt;a href="https://github.com/hosembafer/ngx-overflow-reveal" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Found a bug? Open an issue. Have an idea? PRs are welcome.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built with ❤️ by &lt;a href="https://github.com/hosembafer" rel="noopener noreferrer"&gt;Rafayel Hovhannisyan&lt;/a&gt; because sometimes the simplest problems deserve elegant solutions.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>overflow</category>
      <category>ellipsis</category>
      <category>tooltip</category>
    </item>
  </channel>
</rss>
