react-mkx-components
Advanced tools
+1
-1
| { | ||
| "name": "react-mkx-components", | ||
| "version": "1.0.7", | ||
| "version": "1.0.8", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
+50
-4
@@ -1,4 +0,5 @@ | ||
| ## Custom Input Component | ||
| ## React Useful Custom Components | ||
| A simple custom input component for React applications. | ||
|   | ||
|    | ||
@@ -21,2 +22,4 @@ ## Installation | ||
| `Input` Component | ||
| ```jsx | ||
@@ -43,6 +46,49 @@ import React, { useState } from "react"; | ||
| `Choice` Component | ||
| The `Choice` component provides conditional rendering functionality with the following sub-components: | ||
| - `When`: Renders children when a condition is true. | ||
| - `Then`: Renders children when a condition is false. | ||
| - `And`: Renders children if both conditions are true. | ||
| ```jsx | ||
| import { Choice } from "react-mkx-components"; | ||
| const ExampleComponent = () => { | ||
| const condition = true; | ||
| return ( | ||
| <div> | ||
| <Choice.When condition={condition}> | ||
| <p>This will be rendered if the condition is true.</p> | ||
| </Choice.When> | ||
| <Choice.Then condition={condition}> | ||
| <p>This will be rendered if the condition is false.</p> | ||
| </Choice.Then> | ||
| <Choice.And condition={condition}> | ||
| <p>This will be rendered if both conditions are true.</p> | ||
| </Choice.And> | ||
| </div> | ||
| ); | ||
| }; | ||
| export default ExampleComponent; | ||
| ``` | ||
| ## Browser Support | ||
| |  |  |  |  |  |  | | ||
| | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | | ||
| ## License | ||
| This project is licensed under the ISC License - see the LICENSE file for details. | ||
| This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
| Author : Mani Kant Sharma | ||
| ## Author | ||
| [Mani Kant Sharma](https://www.linkedin.com/in/manikants98) | ||
| [](mailto:manikants157@gmail.com) | ||
| [](https://www.instagram.com/manikantsharmaa/) | ||
| [](https://github.com/manikants98) |
10021
55.9%93
97.87%