kolibri-design-system icon indicating copy to clipboard operation
kolibri-design-system copied to clipboard

Add option to DocsExample to hide a tab

Open MisRob opened this issue 8 months ago • 5 comments

🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.

Current behavior

DocsExample doesn't have a configuration that would allow us to hide a tab.

This, in some cases, results in showing information that is unnecessary, e.g. examples in KCard > Layout have this "Style" tab that have no value for reader, and could even cause confusion since these styles are internal styles that don't need to necessarily correspond to our product pill styles.

Image

Desired behavior

DocsExample has new props hideTemplate, hideScript, and hideStyle. A truthy value hides the corresponding tab (in the example above, this means that only "Template" and "Script" tabs would be displayed.

This will support our attempts to keep the documentation concise and to the point, and allow more flexibility.

Guidance

MisRob avatar Apr 17 '25 14:04 MisRob

@EshaanAgg any feedback for this proposal? I will wait to hear your thoughts before I mark it as ready for work.

MisRob avatar Apr 17 '25 14:04 MisRob

Hi @MisRob! I am so sorry for being AFK for the past couple of weeks!

I think that this issue would be a great addition to the API of the DocExample component, as it would allow the developers to hide the not-so-important parts of the examples! The idea of having three separate props seems the most flexible and clear way to me as well.

EshaanAgg avatar Apr 23 '25 11:04 EshaanAgg

Hi @EshaanAgg, no problem, nothing pressing. Thanks for confirming. I will mark this as ready for work then.

MisRob avatar May 01 '25 03:05 MisRob

Hi @MisRob, I would like to work on this issue

I am proposing that we implement a single, dynamic prop, docTabs. This prop would be an array of strings (e.g., ['script', 'template', 'style']), and the tabs rendered would be based on the items within this array.

yeshwanth235 avatar May 08 '25 06:05 yeshwanth235

HI @yeshwanth235! Yes sure! I have assigned you the issue. Please feel free to reach out incase you have any questions. Thank you!

akolson avatar May 08 '25 16:05 akolson

Closed by https://github.com/learningequality/kolibri-design-system/pull/1021

MisRob avatar May 22 '25 04:05 MisRob