This application is a simple tip calculator built with React and Vite. It allows users to calculate the tip amount based on the bill and the service rating.
-
App
: This is the main component of the application. It maintains the state of the bill amount, the service rating, and the calculated tip. It also renders the other components and handles the reset functionality. -
BillInput
: This component allows users to input the bill amount. It accepts a number and ensures that the value is always positive. -
ServiceInput
: This component is used to rate the service. The rating affects the calculated tip. -
Output
: This component displays the calculated tip based on the bill amount and the service rating.
To run the application, use the dev
script in the package.json file:
npm run dev