<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Vijay Ramesh on Medium]]></title>
        <description><![CDATA[Stories by Vijay Ramesh on Medium]]></description>
        <link>https://medium.com/@vjyramesh?source=rss-b64e2e13e0f1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TT-kV4vh24JVhsmwk8dKcQ.jpeg</url>
            <title>Stories by Vijay Ramesh on Medium</title>
            <link>https://medium.com/@vjyramesh?source=rss-b64e2e13e0f1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 05:37:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vjyramesh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building Modular React Blocks with WCAG AAA Accessibility Using Agent Skills]]></title>
            <link>https://vjyramesh.medium.com/building-modular-react-blocks-with-wcag-aaa-accessibility-using-agent-skills-e9ab39ec538a?source=rss-b64e2e13e0f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9ab39ec538a</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[skills]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Vijay Ramesh]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 06:04:59 GMT</pubDate>
            <atom:updated>2026-11-22T06:04:59.058Z</atom:updated>
            <content:encoded><![CDATA[<h3>Where to Put Skills in Your Project</h3><p>Most agents look for project skills inside a hidden folder at the root of your repository so your team can version and review them in Git. For GitHub workflows, .github/skills/&lt;skill-name&gt;/SKILL.md is the standard home (alongside shared paths like .agents/skills/ if you use multiple tools):</p><pre>.github/<br>├── copilot-instructions.md<br>└── skills/<br>    ├── create-new-block/<br>    │   └── SKILL.md<br>    └── add-aaa-html/<br>        └── SKILL.md</pre><p>Each skill lives in its own folder with a SKILL.md file starting with YAML frontmatter (name and description) followed by clear, numbered instructions.</p><h3>Step 1: Write the Block Scaffolding Skill (create-new-block)</h3><p>A good scaffolding skill names exact files and expected outputs so steps aren’t skipped. Notice how documentation is given a clear file and structure rather than a vague wish:</p><pre>---<br>name: create-new-block<br>description: Scaffold a modular frontend block with separated types, styles which uses tailwind, component logic and isolated tests<br>---<br><br># Create Frontend Block<br><br>## Instructions<br>1. Create a dedicated directory under `block/&lt;/kebab-case-name/&gt;`.<br>2. Define explicit prop, state and callback interfaces in `&lt;kebab-case-name&gt;.types.ts`\-avoid `any` and inline sprawling tyope inside the view file.<br>3. Implement the UI in `&lt;PascalCaseName&gt;.tsx` handling `loading`, `error`, `empty` and `ready` states explicitly.<br>4. Implement the block logic in a seperate file `&lt;PascalCaseName&gt;.ts` and import it to the `&lt;PascalCaseName&gt;.tsx` file for code maintainability.<br>5. Keep styling scoped to the block (using css layers or modular stylesheet) so styles never bleed into surrounding blocks.<br>6. Use the tailwindcss in the stylesheet for component development.<br>7. in the stylesheet on top of the file add the `@reference @/src/styles/globals.css`.<br>8. Add an isolated test file (`&lt;kebab-case-name&gt;.test.tsx`) covering default rendering, empty/error states, and primary user interactions.<br>9. Create a documentation for the `&lt;PascalCaseName&gt;.tsx` and the `&lt;PascalCaseName&gt;.ts` files<br>  - 2 line description about the block at the top of the file.<br>  - Add the argument type, expected values, return type for the method.<br>  - Create the 1 or 2 line documentation for the HTML code as well whenever there is a logic written to show the content based on the business logic where those logic is written<br>10. Create a `&lt;kebab-case-name&gt;.md` inside `block/&lt;kebab-case-name&gt;/` containing:<br><br>- A concise **2-line summary** of what the block does and the primary method/handler it is created for.<br>- A **Method / Handler** section showing the signature and a 2-line desription of what it does.<br>- An **Arguments &amp; Props** list or table with each name, type and brief role.<br><br>12. Add the `loading.tsx` file based onthe html it is created with a shimmer effect on the `&lt;PascalCaseName&gt;.tsx` file.<br>    - create the loading css using the tailwind in the `src/styles/loader.css` file if not already present.<br>    - use the class name as `shimmer` for giving the shimmmer effect.<br>13. This is a standalone block any change in the component css or jsx logic in the parent component should able to override the logic written in the block.<br>14. Blocks should be extendable to the parent block.</pre><h3>Step 2: Write the React AAA Accessibility Skill (add-aaa-html)</h3><p>WCAG Level AAA sets a high bar — including enhanced contrast (7:1 for normal text and 4.5:1 for large text), strong and unobstructed focus indicators, clear link/button names out of context, predictable interactions without surprises on focus, error prevention/confirmation for consequential actions, and accessible status/error messaging.</p><p>Here is how to turn those rules into a practical React block skill:</p><pre>---<br>name: react-block-aaa<br>description: Author or audit React blocks against WCAG 2.2 Level AAA accessibility standards using semantic JSX, clear labeling, focus protection, live regions, and accessible tests.<br>---<br><br># React Block AAA Accessibility<br><br>## Instructions<br>1. **Use native semantic JSX first:** Render `&lt;button&gt;`, `&lt;a href&gt;`, `&lt;label htmlFor=&quot;...&quot;&gt;`, `&lt;fieldset&gt;`/`&lt;legend&gt;`, `&lt;section&gt;`, `&lt;article&gt;`, and `&lt;nav&gt;` before reaching for ARIA roles or attributes. Never attach click handlers to non-interactive `&lt;div&gt;` or `&lt;span&gt;` elements.<br>2. **Enforce unambiguous accessible names (SC 2.4.9 &amp; 2.5.3):** Avoid generic labels like &quot;Click here&quot;, &quot;Read more&quot;, or &quot;Submit&quot; when ambiguous out of context. Ensure any visible label is included in or matches the control&#39;s accessible name, and give icon-only buttons an explicit `aria-label`.<br>3. **Protect focus visibility and avoid obstruction (SC 2.4.12 &amp; 2.4.13):** Preserve visible keyboard focus styles (`:focus-visible`) with high contrast and clear thickness/outline rather than removing outlines. Add scroll/focus margin (`scroll-mt-*` / `scroll-margin-top`) on focusable elements inside blocks when sticky headers or footers could cover them.<br>4. **Prevent surprises and guide user input (SC 1.4.6, 3.2.5, 3.3.5, 3.3.6):**<br>   - Style text and controls with high contrast in mind (targeting **7:1** for normal text and **4.5:1** for large text) and never rely on color alone to signal status or required fields.<br>   - Do not trigger navigation, form submission, or abrupt context changes merely on focus or input selection without warning.<br>   - Associate form fields with labels and `aria-describedby` hints/errors, and require confirmation or reversible review before destructive or irreversible actions.<br>5. **Announce state and async changes cleanly:** Use `role=&quot;status&quot;` / `aria-live=&quot;polite&quot;` for non-urgent updates (loading/empty/saved states) and `role=&quot;alert&quot;` for urgent validation or action errors.<br>6. **Add accessibility assertions in tests:** In the block&#39;s test file, verify keyboard interaction, accessible names/labels, live state messages, and automated accessibility checks (such as `axe`).<br>7. **Note non-static AAA limits:** In the final summary, call out AAA criteria that require page/app or human evaluation (such as live computed contrast across themes, full-page reading level, sign language, or session/time-limit policies).<br>8. Update the details in the `block/&lt;kebab-case-name&gt;.md` for better understanding.<br>9. Write a test case in the `block/&lt;kebab-case-name&gt;.test.tsx` for the AAA accessibility and proved the score out of 100<br>9. Get the score of the AAA accessibility from the test case and add it on the `block/&lt;kebab-case-name&gt;.md` out of 100.</pre><p>You don’t have to rewrite your create-new-block and add-aaa-html skills for every editor or agent on your team. Most follow the same SKILL.md convention—just in different folders. Commit skills to .github/skills/&lt;skill-name&gt;/SKILL.md for GitHub workflows, .claude/skills/&lt;skill-name&gt;/SKILL.md for Claude Code, and .codex/skills/&lt;skill-name&gt;/SKILL.md or .agents/skills/&lt;skill-name&gt;/SKILL.md for Codex and cross-agent setups (with .cursor/skills/ if Cursor is in the mix). If you want one single source of truth across tools without copy-paste drift, keep a canonical skills folder and sync or symlink it into each agent&#39;s expected directory.</p><h3>Summary</h3><p>Building React blocks with <strong>WCAG 2.2 Level AAA</strong> accessibility doesn’t have to rely on memory or repetitive prompts. By separating <strong>block scaffolding</strong> (create-new-block) from <strong>AAA accessibility</strong> (add-aaa-html) inside .github/skills/, you get modular, predictable blocks every time—and a reusable accessibility standard you can apply both when a block is born and whenever it evolves.</p><p>Keep the file boundaries explicit, require real states and accessible controls upfront, and back your workflow with automated tests and checks rather than guesswork. Once the foundation is in place, every new block starts closer to production-ready — and every future update gets cleaner to maintain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9ab39ec538a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Form Validation with React Hook Form and useFieldArray]]></title>
            <link>https://vjyramesh.medium.com/form-validation-with-react-hook-form-and-usefieldarray-40d6fcae5ea6?source=rss-b64e2e13e0f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/40d6fcae5ea6</guid>
            <dc:creator><![CDATA[Vijay Ramesh]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 11:31:03 GMT</pubDate>
            <atom:updated>2025-09-07T11:31:03.083Z</atom:updated>
            <content:encoded><![CDATA[<p>Designing dynamic forms that scale efficiently while managing validation can be tricky. React Hook Form (RHF) simplifies this process to handle form state, validation, and dynamic fields through <em>useFieldArray.</em></p><p>In this blog, we’ll walk through how to:</p><ul><li>Set up a form using React Hook Form</li><li>Add dynamic fields with <strong>useFieldArray</strong></li><li>Apply validation rules to both static and dynamic fields</li><li>Display error messages elegantly</li></ul><h3>Example: Product Form with Features</h3><p>Imagine you’re building a product form where a product has:</p><ul><li><strong>Name</strong> (string)</li><li><strong>Price</strong> (number)</li><li><strong>Features</strong> (a dynamic list of strings)</li></ul><p>Each of these fields should be validated before submission.</p><h3>Step 1: Define the Form Types</h3><p>We’ll start by defining a ProductType interface that represents our form structure:</p><blockquote>interface ProductType extends FieldValues {<br> name: string;<br> price: number;<br> features: string[];<br>}</blockquote><h3><strong>Step 2: Initialize React Hook Form</strong></h3><p>We set up the form with default values and validation mode:</p><blockquote>const {register, handleSubmit, control, formState: { errors }} = useForm&lt;ProductType&gt;({<br>defaultValues: {<br> name: “”,<br> price: 0,<br> features: [“”],<br>},<br>mode: “onBlur”,<br>reValidateMode: “onChange”,<br>});</blockquote><h3>Step 3: Manage Dynamic Fields with useFieldArray</h3><p>To handle features, we use useFieldArray. It provides fields, append, and remove methods.</p><blockquote>const { fields, append, remove } = useFieldArray&lt;ProductType, “features”&gt;({<br>control,<br>name: “features”,<br>});</blockquote><ul><li>fields → current list of dynamic fields</li><li>append → add a new field</li><li>remove → delete an existing field</li></ul><h3>Step 4: Apply Validation Rules</h3><p>React Hook Form supports validation directly in the register function. Here are our rules:</p><ul><li><strong>Name</strong> → required</li><li><strong>Price</strong> → required, must be at least 1</li><li><strong>Feature</strong> → required, must be at least 3 characters long</li></ul><blockquote>&lt;form onSubmit={handleSubmit(onSubmit)}&gt;<br>{/* Product Name */}<br>&lt;input type=”text” placeholder=”Product Name” {…register(“name”, { required: true, minLength: 3 })}/&gt;<br>{errors.name?.type === “required” &amp;&amp; (&lt;span className=”error”&gt;This field is required&lt;/span&gt;)}<br>{errors.name?.type === “minLength” &amp;&amp; (&lt;span className=”error”&gt;This field must be at least 3 characters long&lt;/span&gt;<br>)}<br>{/* Product Price */}<br>&lt;input type=”number” placeholder=”Product Price” {…register(“price”, { required: true })}/&gt;<br>{errors.price &amp;&amp; &lt;span className=”error”&gt;This field is required&lt;/span&gt;}<br>{/* Features */}<br>{fields.map((field, index) =&gt; (<br>&lt;div key={field.id}&gt;<br>&lt;input type=”text” placeholder=”Feature” {…register(`features.${index}`, { required: “This field is required” })}/&gt;<br>{errors.features?.[index] &amp;&amp; (<br>&lt;span className=”error”&gt;{errors.features[index]?.message}&lt;/span&gt;<br>)}<br>&lt;button type=”button” onClick={() =&gt; remove(index)}&gt;Remove Feature&lt;/button&gt;<br>&lt;/div&gt;<br>))}<br>&lt;button type=”button” onClick={() =&gt; append(“”)}&gt;Add Feature&lt;/button&gt;<br>&lt;button type=”submit”&gt;Add Product&lt;/button&gt;<br>&lt;/form&gt;</blockquote><h3>Key Takeaways</h3><ol><li><strong>useFieldArray makes dynamic forms simple</strong> – you can append and remove fields easily.</li><li><strong>Validation rules integrate directly in </strong><strong>register</strong> – no need for extra state management.</li><li><strong>Errors are scoped</strong> — each field has its own validation error message.</li></ol><p>With React Hook Form and useFieldArray, you can now build powerful and flexible forms with validation that scales with your application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40d6fcae5ea6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating React i18n (Internationalization)with Storybook using React + Typescript]]></title>
            <link>https://vjyramesh.medium.com/integrating-react-i18n-internationalization-with-storybook-using-react-typescript-7bbb72f87472?source=rss-b64e2e13e0f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bbb72f87472</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[storybook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[i18n]]></category>
            <category><![CDATA[typescript-with-react]]></category>
            <dc:creator><![CDATA[Vijay Ramesh]]></dc:creator>
            <pubDate>Sun, 11 May 2025 09:46:31 GMT</pubDate>
            <atom:updated>2025-05-11T09:46:31.100Z</atom:updated>
            <content:encoded><![CDATA[<p>In a modern development context, <strong>i18n</strong> (internationalization) is used to make applications adaptable to different languages and regions without engineering changes. This is especially critical for apps targeting global users.</p><h3><strong>React i18n</strong></h3><p>Using <strong>React i18n</strong>, typically with the react-i18next library, allows developers to build multilingual React applications efficiently</p><h3><strong>Storybook</strong></h3><p><strong>Storybook</strong> is a powerful tool for building, testing, and documenting UI components in isolation — especially valuable in React projects</p><h3><strong>Integrating React i18n with storybook</strong></h3><ol><li>Install the react-i18n and storybook and its dependencies first</li><li>Change the preview.ts file to preview.tsx file</li><li>Update the preview.tsx file as below</li></ol><pre>import type { Preview } from &#39;@storybook/react&#39;;<br>import { I18nextProvider } from &#39;react-i18next&#39;;<br>import i18n from &#39;../src/i18n/config&#39;;<br><br>const withI18n = (Story: any, context: any) =&gt; {<br>  const lang = context.globals.locale;<br>  i18n.changeLanguage(lang); // 🌐 Switch language based on selected global<br><br>  return (<br>    &lt;I18nextProvider i18n={i18n}&gt;<br>      &lt;Story /&gt;<br>    &lt;/I18nextProvider&gt;<br>  );<br>};<br><br>const preview: Preview = {<br>  decorators: [withI18n],<br>  globalTypes: {<br>    locale: {<br>      name: &#39;Locale&#39;,<br>      description: &#39;Internationalization locale&#39;,<br>      defaultValue: &#39;en&#39;,<br>      toolbar: {<br>        icon: &#39;globe&#39;,<br>        items: [<br>          { value: &#39;en&#39;, title: &#39;English&#39; },<br>          { value: &#39;fr&#39;, title: &#39;Français&#39; },<br>          { value: &#39;es&#39;, title: &#39;Español&#39; },<br>        ],<br>      },<br>    },<br>  },<br>};<br><br>export default preview;</pre><p>Once you’ve completed the setup steps for react-i18next, you can update your component-level code to <strong>retrieve and display text based on the selected language</strong> using the t() function from useTranslation.</p><h3><strong>Steps to Use Translations in a Component</strong></h3><p>Assume you already have the i18n setup done (as discussed earlier), and you have translation files like below under public folder.</p><pre>// locales/en/home.json<br>{<br>  &quot;header&quot;: &quot;Home Page&quot;,<br>  &quot;intro&quot;: &quot;This is your dashboard&quot;<br>}</pre><pre>// locales/fr/home.json<br>{<br>  &quot;header&quot;: &quot;Page d&#39;accueil&quot;,<br>  &quot;intro&quot;: &quot;C&#39;est votre tableau de bord&quot;<br>}</pre><p>Change your component like below</p><pre>import React from &#39;react&#39;;<br>import { useTranslation } from &#39;react-i18next&#39;;<br><br>const WelcomeComponent = () =&gt; {<br>  const { t } = useTranslation();<br><br>  const name = &quot;John Doe&quot;;<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;{t(&#39;title&#39;)}&lt;/h1&gt;<br>      &lt;p&gt;{t(&#39;message&#39;, { name })}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default WelcomeComponent;</pre><p>Once all the above steps are done, you can see the language switcher in the storybook.</p><figure><img alt="Storybook Language Switcher" src="https://cdn-images-1.medium.com/max/582/1*1ywqlu7CCA0mVTNyuCgooA.png" /></figure><p>Once the language is changed then the component will update to the selected language.</p><p>Hope this finds helpfull to you all. Happy Coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bbb72f87472" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React JS — Simple Functional Components]]></title>
            <link>https://vjyramesh.medium.com/react-js-simple-functional-components-f6bb21e65cc2?source=rss-b64e2e13e0f1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6bb21e65cc2</guid>
            <dc:creator><![CDATA[Vijay Ramesh]]></dc:creator>
            <pubDate>Tue, 06 Sep 2022 04:49:09 GMT</pubDate>
            <atom:updated>2022-09-06T04:49:09.261Z</atom:updated>
            <content:encoded><![CDATA[<h3>React JS — Simple Functional Components</h3><p>The functional component is just a simple javascript function; it accepts the data in the form of <strong>props</strong> and returns the react element.</p><p>Below is an example of a react functional component.</p><pre>export default function Hello(props) {<br>    return (<br>        &lt;div&gt;<br>            Good morning! {props.name}.<br>        &lt;/div&gt;<br>    )<br>}</pre><p>Props are an integral part of every react application.<strong> It gives information from one component to another</strong>, which helps us build dynamic and robust applications.</p><p>Most developers prefer creating functional components using <strong>arrow functions</strong> over components with specific function keywords. Creating components using the arrow function is more accessible, and the code looks clean</p><p>We can pass props to the arrow functions; nothing has been changed to props. In the end, we will export this component so that we can use this later in other components.</p><pre>import React from &#39;react&#39;;<br>import Hello from &quot;./components/Hello&quot;;<br>import &#39;./App.css&#39;;<br>function App() {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;Hello name=&#39;abc&#39; /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6bb21e65cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>