Repository navigation
YesNoTag
YesNoTag normalizes loosely typed values into a simple Yes or No label. It is intended for display-only contexts such as tables, summaries, and read-only details where source data may arrive as booleans, numbers, strings, or nullable values.
| Name | Type | Required | Description |
|---|---|---|---|
value |
boolean | string | number | null | undefined |
Yes | Raw value to normalize into Yes or No. |
The component applies these normalization rules:
-
true=>Yes -
false=>No
- values greater than
0=>Yes -
0and negative numbers =>No
Strings are trimmed and compared case-insensitively against this truthy set:
truetyyes
Only those values map to Yes. All other strings map to No.
Examples:
-
"TRUE","True"," true ","YES"=>Yes -
"false","no","n","f","","random"=>No
-
null=>No -
undefined=>No
import YesNoTag from "@/components/core/Tags/YesNoTag";
<YesNoTag value={true} />;
<YesNoTag value={1} />;
<YesNoTag value="yes" />;
<YesNoTag value="no" />;
<YesNoTag value={null} />;- The component renders a plain
<span>containing eitherYesorNo. - It does not apply custom styling, tag semantics, or interactivity.
Unit tests cover all supported input categories:
- booleans
- numbers (positive, zero, negative)
- truthy and non-truthy strings (including case and whitespace handling)
-
nullandundefined
This wiki documents NR Waste Plus for users and developers. Verify security and deployment guidance against the current application configuration before applying it elsewhere.
- Report an issue or ask a question in the GitHub repository.
- Follow the Contributing Guidelines to propose an update.
- Read the Code of Conduct.
Collection indexes support human browsing and machine retrieval. Keep both current when adding or moving wiki pages.
NR Waste Plus Wiki | GitHub Repository