<?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>Forem: Wexop</title>
    <description>The latest articles on Forem by Wexop (@wexop).</description>
    <link>https://forem.com/wexop</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%2F3407807%2Fd9b0b88b-ab4c-4f84-b354-f1927fbf1841.jpg</url>
      <title>Forem: Wexop</title>
      <link>https://forem.com/wexop</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/wexop"/>
    <language>en</language>
    <item>
      <title>react-console-notify | Made a small React package to show console logs in the UI</title>
      <dc:creator>Wexop</dc:creator>
      <pubDate>Sat, 02 Aug 2025 12:46:32 +0000</pubDate>
      <link>https://forem.com/wexop/react-console-notify-made-a-small-react-package-to-show-console-logs-in-the-ui-4fnn</link>
      <guid>https://forem.com/wexop/react-console-notify-made-a-small-react-package-to-show-console-logs-in-the-ui-4fnn</guid>
      <description>&lt;p&gt;Hi all !&lt;/p&gt;

&lt;p&gt;I built a small React package that displays console.log, warn, error, etc., directly in the app as floating notifications, it should be helpful for debugging without having the dev tools always open :)&lt;/p&gt;

&lt;p&gt;It's called react-console-notify. Still fresh so feedbacks are appreciated !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/wexop/react-console-notify" rel="noopener noreferrer"&gt;GitHub &lt;/a&gt;- &lt;a href="https://www.npmjs.com/package/react-console-notify" rel="noopener noreferrer"&gt;Npm &lt;/a&gt;- &lt;a href="https://wexop.github.io/react-console-notify/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Im new into creating package, I just had this idea because I always find myself digging through the dev tools to find THE log i want ahah&lt;/p&gt;

&lt;p&gt;So i'd be happy to hear your thoughts or feedback !&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;npm&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-console-notify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;pnpm&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pnpm i react-console-notify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;yarn&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add react-console-notify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;

&lt;p&gt;To use react-console-notify in your React project, import the main component and the CSS file like this&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Make sure to import the CSS file (index.css) so the notifications are styled correctly&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;ConsoleNotifier&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-console-notify&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-console-notify/index.css&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;


&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ConsoleNotifier&lt;/span&gt; &lt;span class="nx"&gt;enabled&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="cm"&gt;/* your app content */&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ConsoleNotifier&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&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;h2&gt;
  
  
  Props
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Prop&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Default&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;types&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;LogType[]&lt;/code&gt; (&lt;code&gt;"log"&lt;/code&gt;, &lt;code&gt;"warn"&lt;/code&gt;, etc.)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;["log", "warn", "error", "info", "debug"]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Console methods to intercept and notify.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;onNotify&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;(type: LogType, ...args: unknown[]) =&amp;gt; void&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;undefined&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Custom callback called on each intercepted log. Overrides default notification behavior.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;colorMap&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Record&amp;lt;LogType, string&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;See below&lt;/td&gt;
&lt;td&gt;Allows custom colors per log type.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;children&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;ReactNode&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;undefined&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Optional children to render within the same tree.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;enabled&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;true&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Enable notifications or not. This can be useful to disable on production environment.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;position&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;"top-right"&lt;/code&gt; \&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"top-left"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;"top-right"&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;duration&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;`number \&lt;/td&gt;
&lt;td&gt;null`&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;5000&lt;/code&gt; (ms)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;backgroundOpacity&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;number&lt;/code&gt; (&lt;code&gt;0&lt;/code&gt; → transparent, &lt;code&gt;1&lt;/code&gt; → solid)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;0.5&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Background transparency of the notification.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;containerHeight&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;`number \&lt;/td&gt;
&lt;td&gt;string`&lt;/td&gt;
&lt;td&gt;&lt;code&gt;500px&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Default colorMap
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    log: "#6c757d",    // Gray
    warn: "#f4b400",   // Yellow
    error: "#f28b82",  // Red
    info: "#719dcb",   // Blue
    debug: "#61b96e",  // Green
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>npm</category>
      <category>debugging</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
