Utilities

hasErrorInput

A utility to set the style of erroneous input elements globally.

You can use the hasErrorInput utility to ensure that all input components have the same error style. This approach lets you style the error state once, rather than having to do it for each component individually.

Project structure

If you are not sure how to structure your project or where to place the utils.ts, we have a recommended project structure for Next.js, Vite, and Remix.

Installation

  1. 1

    Add the following code to your utils.ts file.

    // Tremor hasErrorInput [v0.0.1]
    export const hasErrorInput = [  // base  "ring-2",  // border color  "border-red-500 dark:border-red-700",  // ring color  "ring-red-200 dark:ring-red-700/30",]