Skip to content

Commit 0fd9c01

Browse files
authored
Improve Spinner parameter docs and metadata (#1228)
Enhanced XML comments for Spinner parameters using <see cref="..."/> and <para> tags for clarity. Added [AddedVersion], [DefaultValue], and [Description] attributes to all parameters for better tooling support. Changed VisuallyHiddenText from nullable string to non-nullable string. Improves API documentation and developer experience.
1 parent 5ff193f commit 0fd9c01

1 file changed

Lines changed: 42 additions & 24 deletions

File tree

blazorbootstrap/Components/Spinner/Spinner.razor.cs

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,63 +63,81 @@ protected override void OnInitialized()
6363
($"{Type.ToSpinnerTypeClass()}-{Size.ToSpinnerSizeClass()}", Type is (SpinnerType.Border or SpinnerType.Grow)));
6464

6565
/// <summary>
66-
/// Gets or sets the color of the spinner.
67-
/// </summary>
68-
/// <remarks>
66+
/// Gets or sets the color of the <see cref="Spinner" />.
67+
/// <para>
6968
/// Default value is <see cref="SpinnerColor.None" />.
70-
/// </remarks>
69+
/// </para>
70+
/// </summary>
71+
[AddedVersion("2.0.0")]
72+
[DefaultValue(null)]
73+
[Description("")]
7174
[Parameter]
7275
public SpinnerColor Color { get; set; } = SpinnerColor.None;
7376

7477
/// <summary>
75-
/// Gets or sets the size of the spinner.
76-
/// </summary>
77-
/// <remarks>
78+
/// Gets or sets the size of the <see cref="Spinner" />.
79+
/// <para>
7880
/// Default value is <see cref="SpinnerSize.Medium" />.
79-
/// </remarks>
81+
/// </para>
82+
/// </summary>
83+
[AddedVersion("2.0.0")]
84+
[DefaultValue(SpinnerSize.Medium)]
85+
[Description("Gets or sets the color of the <b>Spinner</b>.")]
8086
[Parameter]
8187
public SpinnerSize Size { get; set; } = SpinnerSize.Medium;
8288

8389
/// <summary>
84-
/// Gets the width, height, and circles information for the spinner SVG.
90+
/// Gets the width, height, and circles information for the <see cref="Spinner" /> SVG.
8591
/// </summary>
8692
private (int Width, int Height, List<SpinnerCircle> Circles) SpinnerSvg => GetSpinnerSvgInfo();
8793

8894
/// <summary>
8995
/// Gets or sets the title text used as an accessibility attribute.
96+
/// <para>
97+
/// Default value is <see langword="null"/>.
98+
/// </para>
9099
/// </summary>
91-
/// <remarks>
92-
/// Default value is null.
93-
/// </remarks>
100+
[AddedVersion("2.0.0")]
101+
[DefaultValue(null)]
102+
[Description("Gets or sets the title text used as an accessibility attribute.")]
94103
[Parameter]
95104
public string? Title { get; set; }
96105

97106
/// <summary>
98-
/// Gets or sets the type of the spinner.
99-
/// </summary>
100-
/// <remarks>
107+
/// Gets or sets the type of the <see cref="Spinner" />.
108+
/// <para>
101109
/// Default value is <see cref="SpinnerType.Border" />.
102-
/// </remarks>
110+
/// </para>
111+
/// </summary>
112+
[AddedVersion("2.0.0")]
113+
[DefaultValue(SpinnerType.Border)]
114+
[Description("Gets or sets the type of the <b>Spinner</b>.")]
103115
[Parameter]
104116
public SpinnerType Type { get; set; } = SpinnerType.Border;
105117

106118
/// <summary>
107-
/// Gets or sets whether the spinner is visible or not.
119+
/// Gets or sets whether the <see cref="Spinner" /> is visible or not.
120+
/// <para>
121+
/// Default value is <see langword="true"/>.
122+
/// </para>
108123
/// </summary>
109-
/// <remarks>
110-
/// Default value is true.
111-
/// </remarks>
124+
[AddedVersion("2.0.0")]
125+
[DefaultValue(true)]
126+
[Description("Gets or sets whether the <b>Spinner</b> is visible or not.")]
112127
[Parameter]
113128
public bool Visible { get; set; } = true;
114129

115130
/// <summary>
116131
/// Gets or sets the visually hidden text.
117-
/// </summary>
118-
/// <remarks>
132+
/// <para>
119133
/// Default value is 'Loading...'.
120-
/// </remarks>
134+
/// </para>
135+
/// </summary>
136+
[AddedVersion("2.0.0")]
137+
[DefaultValue("Loading...")]
138+
[Description("Gets or sets the visually hidden text.")]
121139
[Parameter]
122-
public string? VisuallyHiddenText { get; set; } = "Loading...";
140+
public string VisuallyHiddenText { get; set; } = "Loading...";
123141

124142
#endregion
125143
}

0 commit comments

Comments
 (0)